/* --- Variables & Configuration de base --- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --neutral: #94a3b8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text-main);
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    margin: 0;
}

/* --- Conteneur Principal --- */
.container { 
    background: var(--card-bg); 
    padding: 2.5rem; 
    border-radius: 24px; 
    box-shadow: var(--shadow);
    width: 95%; 
    max-width: 650px; 
    text-align: center;
    margin: 20px;
}

/* --- Barre d'Identité Réseau (Identity Bar) --- */
.network-info-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #0f172a; /* Bleu nuit */
    color: white;
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.info-item { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.info-item .label { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; }
.info-item strong { font-family: 'Courier New', monospace; font-size: 1.1rem; color: #38bdf8; }

.btn-refresh {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s, background 0.2s;
}
.btn-refresh:hover { transform: rotate(180deg); background: var(--primary); }

/* --- Section Actions & Recherche --- */
.action-section { display: flex; flex-direction: column; gap: 1rem; }

.search-box { 
    display: flex; 
    gap: 0; 
    background: #f1f5f9; 
    padding: 6px; 
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    align-items: center;
}

.search-box input { 
    flex: 1; 
    padding: 12px 18px; 
    border: none !important; 
    background: transparent !important; 
    font-size: 0.95rem;
    outline: none;
    color: var(--text-main);
}

.search-box button { 
    padding: 12px 25px; 
    border: none; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600; 
    background: var(--primary);
    color: white;
    transition: all 0.2s;
}

/* --- Monitoring Cloud (Pulsing Dot) --- */
.cloud-monitor-box {
    margin: 10px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.server-badge { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.85rem; font-weight: 600; }

.dot-pulse {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    background: var(--neutral);
}

.dot-pulse.online {
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
    animation: pulse-green 2s infinite;
}

.dot-pulse.offline {
    background: var(--danger);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* --- Grille Interactive 1-254 --- */
.ip-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    gap: 6px;
    margin: 1rem 0;
    max-height: 250px;
    overflow-y: auto;
    padding: 15px;
    background: #f1f5f9;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.ip-check-grid::-webkit-scrollbar { width: 6px; }
.ip-check-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.ip-check-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 6px 0;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
}

.ip-check-item:hover { border-color: var(--primary); }

/* --- Résultats & Cartes --- */
.card { 
    padding: 1.2rem; 
    border-radius: 16px; 
    text-align: left; 
    animation: slideUp 0.3s ease-out; 
    border-left: 5px solid transparent;
}

.success { background: #f0fdf4; border-left-color: var(--success); color: #166534; }
.danger { background: #fef2f2; border-left-color: var(--danger); color: #991b1b; }
.neutral { background: #f8fafc; border-left-color: var(--neutral); color: #475569; }

.diagnosis { 
    margin-top: 8px; 
    font-size: 0.75rem; 
    font-style: italic; 
    opacity: 0.8; 
}

/* --- Footer --- */
footer { 
    margin-top: 2rem; 
    padding-top: 1rem; 
    border-top: 1px solid #f1f5f9; 
    font-size: 0.75rem; 
    color: var(--text-muted); 
}

.status-indicator { 
    height: 8px; width: 8px; background: #22c55e; border-radius: 50%; display: inline-block; margin-right: 4px; 
}

@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }