/* =========================================
   VARIABLES & THÈMES
   ========================================= */
:root {
    --primary: #004d99;
    --accent: #00a3e0;
    --bg-color: #f4f7f9;
    --card-bg: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #666;
    --danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f1c40f;
    --transition: all 0.3s ease;
}

.dark-theme {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #aaa;
    --primary: #00a3e0;
}

/* =========================================
   RESET & BASE
   ========================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: var(--transition);
}

a { text-decoration: none; color: inherit; }

/* =========================================
   MISE EN PAGE & CONTENEURS
   ========================================= */
.container { 
    padding: 2rem 10%; 
    max-width: 1400px;
    margin: 0 auto;
}

.grid-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo { 
    font-weight: 800; 
    font-size: 1.5rem; 
    color: var(--primary); 
    text-transform: uppercase;
    letter-spacing: 1px;
}
.logo span { font-weight: 300; }

.nav-links { list-style: none; display: flex; align-items: center; }
.nav-links li { margin-left: 2rem; }
.nav-links a { font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    height: 50vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), 
                url('https://images.unsplash.com/photo-1544620347-c4fd4a3d5957?auto=format&fit=crop&w=1200') center/cover;
    display: flex;
    align-items: center;
    padding: 0 10%;
    color: white;
}

.hero-content h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1rem; line-height: 1.2; }
.hero-content p { font-size: 1.2rem; opacity: 0.9; }

/* =========================================
   COMPOSANTS : CARTES
   ========================================= */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: var(--transition);
    border-bottom: 4px solid var(--accent);
    margin-bottom: 1.5rem;
    position: relative;
}

.card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); }

.icon-card { font-size: 2.5rem; color: var(--primary); margin-bottom: 1.5rem; }
.card h3 { margin-bottom: 1rem; color: var(--primary); }

/* =========================================
   FORMULAIRES & BOUTONS
   ========================================= */
input, textarea, select {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 1rem;
}

.btn-toggle {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-toggle:hover { opacity: 0.9; transform: scale(1.02); }

.btn-secondary {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent);
    border: 2px solid var(--accent);
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: bold;
    transition: var(--transition);
}

.btn-secondary:hover { background: var(--accent); color: white; }

.btn-emergency {
    background: var(--danger);
    color: white;
    padding: 15px;
    width: 100%;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 10px;
}

/* =========================================
   MESSAGERIE & ALERTES
   ========================================= */
.chat-box { 
    height: 300px; 
    background: rgba(0,0,0,0.02); 
    border: 1px solid #ddd; 
    overflow-y: auto; 
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-box div {
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 85%;
    font-size: 0.95rem;
}

.message-item { background: #eee; align-self: flex-start; }
.message-self { background: var(--primary); color: white; align-self: flex-end; }

.alert-box {
    background: #fff3cd;
    border-left: 5px solid var(--warning);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #856404;
}

/* =========================================
   ADMIN SIDEBAR
   ========================================= */
.admin-grid { display: flex; min-height: 100vh; }

.sidebar { 
    width: 260px; 
    background: #1a252f; 
    color: white; 
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar h3 { color: var(--accent); margin-bottom: 2rem; font-size: 1.2rem; }
.sidebar ul { list-style: none; }
.sidebar ul li { margin-bottom: 1rem; }
.sidebar a { 
    color: #bdc3c7; 
    display: block; 
    padding: 10px; 
    border-radius: 5px; 
}
.sidebar a:hover { background: #34495e; color: white; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 992px) {
    .sidebar { width: 80px; padding: 1rem 0.5rem; text-align: center; }
    .sidebar h3, .sidebar span { display: none; }
    .container { padding: 1.5rem 5%; }
}

@media (max-width: 768px) {
    .navbar { padding: 1rem 3%; }
    .hero { height: 40vh; text-align: center; justify-content: center; }
    .grid-services { margin-top: 2rem; }
    .nav-links li { margin-left: 1rem; }
}