/* 🚀 styles.css - Thème Moderne et Animé (Geist/Vercel Dark) */

/* --- Variables et Base --- */
:root {
    --bg: #070D19;
    --card: #0F172A;
    --accent: #60A5FA;
    --accent-hover: #3B82F6;
    --success: #10B981;
    --error: #EF4444;
    --text-primary: #E2E8F0;
    --text-muted: #94A3B8;
    --border: rgba(255, 255, 255, 0.1);
    --shadow-light: rgba(96, 165, 250, 0.2);
    --shadow-dark: rgba(2, 6, 23, 0.8);
    --font-sans: 'Geist Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Variables pour l'effet de Glow */
    --accent-glow: rgba(96, 165, 250, 0.5); 
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(180deg, var(--bg) 0%, #050810 100%);
    color: var(--text-primary);
    min-height: 100vh;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.anim-fade-in {
    animation: fadeInSlideUp 0.5s ease-out forwards;
}

/* --- Layout et Structure --- */
.site-header {
    background-color: rgba(7, 13, 25, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.container {
    max-width: 800px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --- Typographie --- */
h2 {
    font-size: 2.25rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

.subtitle {
    font-size: 1.125rem;
    margin-top: -1.5rem;
}

.accent-text {
    color: var(--accent);
}

.score {
    font-weight: 500;
}
.score strong {
    color: var(--text-primary);
    font-weight: 700;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.admin-link {
    text-align: center;
    font-size: 0.9rem;
}

/* --- Composants Interactifs (Boutons) --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    border: 1px solid transparent;
    padding: 0.625rem 1.125rem;
    border-radius: 0.625rem;
    color: var(--bg);
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px var(--shadow-light), 0 0 8px var(--accent-glow);
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-light), 0 0 12px var(--accent-glow);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn.ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
    box-shadow: none;
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    transform: scale(1.02);
}

/* Bouton plus petit (Déconnexion) */
.btn.small {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* --- Cartes et Conteneurs --- */
.card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px var(--shadow-dark);
    border: 1px solid var(--border);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 40px var(--shadow-dark), 0 0 15px var(--accent-glow);
    border-color: var(--accent);
}

.parcours-unlocked {
    border-left: 4px solid var(--accent);
}

.parcours-list ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.parcours-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    color: var(--text-primary); /* Assure une bonne couleur de texte */
}

.parcours-list li:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.parcours-list li svg {
    color: var(--text-muted);
}

/* --- USER PROFILE (Déplacé ici) --- */

/* --- Styles pour l'affichage de l'utilisateur dans l'en-tête --- */

/* Conteneur principal du lien (Avatar + Noms/Classe) */
/* --- NOUVEAU: Styles Avatars & Profil Utilisateur --- */

/* Conteneur principal: pour aligner l'avatar et le texte */
.user-profile-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 12px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    border: 1px solid transparent;
}

/* Effet de survol joli: bordure accentuée et fond léger */
.user-profile-link:hover {
    background-color: rgba(96, 165, 250, 0.05); /* Accent bleu transparent */
    border-color: var(--accent);
}

/* 1. L'Avatar (le cercle avec l'initiale) */
.avatar {
    width: 44px;
    height: 44px;
    min-width: 44px; /* Empêche de rétrécir */
    border-radius: 50%;
    
    /* Gradient bleu/violet pour un look premium */
    background: linear-gradient(135deg, var(--accent), #7C3AED); /* Mélange votre accent et un violet */
    
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); /* Ombre pour le détacher */
    margin-right: 12px;
    transition: transform 0.3s ease;
}

/* Petit effet de zoom/dépassement au survol */
.user-profile-link:hover .avatar {
    transform: scale(1.05);
}

/* 2. Le Conteneur des noms et de la classe */
.user-names {
    line-height: 1.3;
    text-align: left;
}

/* Nom/Prénom (Texte principal) */
.user-names strong {
    display: block; /* Force le nom complet sur une ligne */
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    
    /* Tronquer le nom si trop long */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px; 
}

/* Classe (Petit texte) */
.user-names small {
    display: block; /* Force la classe sur la ligne suivante */
    color: var(--text-muted); /* Gris pour l'info secondaire */
    font-size: 0.85rem;
    font-weight: 400;
}

/* Couleur du texte du nom/prénom au survol (facultatif, pour une meilleure lisibilité) */
.user-profile-link:hover .user-names {
    color: #000;
}

/* Le petit texte de la classe (petite taille) */
.user-names small {
    display: block; /* Force la classe sur une nouvelle ligne */
    color: #666; 
}
}
@media (max-width: 600px) {
    .user-profile-link .avatar {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
    }
}


/* ---- MESSAGE GLOBAL (DASHBOARD ALERT MODERNISÉ) ---- */
.dashboard-alert {
    display: flex; 
    align-items: center;
    gap: 1rem;

    /* Style Moderne d'Alerte (Jaune/Orange subtil) */
    background: rgba(255, 179, 0, 0.1); /* Fond légèrement jaune/orange transparent */
    border: 1px solid rgba(255, 179, 0, 0.3); /* Bordure orange/jaune subtile */
    color: #FFD568; /* Texte d'alerte plus clair */
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(255, 179, 0, 0.1); 
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

.dashboard-alert .icon-alert {
    color: #FFB300; /* Couleur de l'icône */
    flex-shrink: 0;
}

.dashboard-alert p {
    color: inherit; 
    margin: 0;
    line-height: 1.4;
}

/* --- Messages Flash (Ajusté pour la cohérence du thème) --- */
.flash-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.flash {
    padding: 1rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    animation: fadeInSlideUp 0.4s ease-out;
    font-weight: 500;
}

.flash.error {
    background-color: rgba(239, 68, 68, 0.1); /* Basé sur var(--error) */
    color: #FEE2E2;
    border-color: rgba(239, 68, 68, 0.3);
}

.flash.success {
    background-color: rgba(16, 185, 129, 0.1); /* Basé sur var(--success) */
    color: #D1FAE5;
    border-color: rgba(16, 185, 129, 0.3);
}


/* --- Formulaires --- */
input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.5), 0 0 10px var(--accent-glow);
    background: var(--card);
}

/* --- Modale (Pop-up) --- */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease forwards;
}

.modal-content {
    animation: fadeInSlideUp 0.4s ease-out forwards;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    margin: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* --- Styles Admin (pour le cas où ils sont inclus) --- */

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

form label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
    margin-top: -0.25rem;
}

.table-wrapper {
    max-height: 400px; 
    overflow-y: auto; 
}

.results code {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.associate-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: flex-end;
    gap: 1rem;
}

.login-layout {
    display: flex; 
    min-height: 100vh;
    background: var(--bg);
}

.login-illustration {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #141f38;
    border-right: 1px solid var(--border);
}

.login-form-area {
    flex: 1; 
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
    .associate-form {
        grid-template-columns: 1fr;
    }
    .login-layout {
        flex-direction: column;
    }
    .login-illustration {
        height: 250px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .login-form-area {
        padding-top: 2rem;
    }
}

.user-profile-link {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg,#007bff,#6610f2);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.user-profile-link:hover .avatar {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

/* Tooltip-like info bubble */
.user-names {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 10;
}

.user-profile-link:hover .user-names {
    opacity: 1;
    transform: translateY(-50%) translateX(10px);
}

<style>
/* Nouveau style pour les badges et les notifications */
.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0;
    list-style: none;
}
/* ... (autres styles badge) ... */

/* Ajustements spécifiques à l'en-tête */
.user-info {
    display: flex; 
    align-items: center; /* Assure que tous les éléments sont alignés verticalement */
}

/* Retire la marge qui causait le décalage */
.notification-link {
    position: relative;
    /* Ajustement de la marge pour bien coller au Score */
    margin-right: 10px; 
    /* Permet au lien de notification d'être cliquable sur toute la surface de l'icône */
    display: flex; 
    align-items: center;
    height: 100%; /* S'aligne avec la hauteur du score */
}

/* Reste du style du compteur */
.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--geist-red); 
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    line-height: 1;
    min-width: 20px;
    text-align: center;
    border: 1px solid var(--background); 
}

/* Ajustement de la marge du score pour l'éloigner du profil */
.score {
    margin-right: 15px;
}


/* --- NOUVEAU : Centre de Notifications (Utilisation de variables) --- */

/* --- NOUVEAU : Centre de Notifications (Utilisation de variables forcées) --- */

/* Style du badge sur la cloche (doit rester visible) */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--error); 
    color: var(--text-primary);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--bg);
    z-index: 10;
}

/* Style de chaque élément de notification (LI) */
.notifications-list ul li { /* SÉLECTEUR PLUS SPÉCIFIQUE */
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: background-color 0.2s, border-color 0.2s;
    
    /* COULEURS SOMBRES FORCÉES */
    background-color: rgba(255, 255, 255, 0.05) !important; /* Important pour écraser le blanc */
    border: 1px solid var(--border); 
}

/* Notification non lue (Unread) */
.notifications-list ul li.unread { /* SÉLECTEUR PLUS SPÉCIFIQUE */
    /* Fond légèrement plus prononcé */
    background-color: rgba(96, 165, 250, 0.1) !important; /* Fond bleu transparent forcé */
    border-color: var(--accent);
    border-left: 5px solid var(--accent); /* Bande bleue épaisse pour "nouveau" */
}

/* Texte à l'intérieur de la notification */
.notifications-list .content .message { 
    color: var(--text-primary); /* Texte blanc/clair forcé */
}

/* Horodatage */
.notifications-list .content .timestamp {
    color: var(--text-muted); /* Texte gris/muet forcé */
}

/* --- Reste des styles (inchangé) --- */

.mark-read-form {
    text-align: right;
    margin-top: 10px;
}

.mark-read-form .btn.ghost {
    color: var(--text-muted); 
    border-color: var(--text-muted);
}

.mark-read-form .btn.ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
}/* === Avatar amélioré === */
/* === Avatar amélioré avec encadré ovale === */
.improved-avatar {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0070f3, #00c6ff);
    color: white;
    font-weight: 700;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.name-badge {
    background: white;
    border: 2px solid #0070f3;
    border-radius: 999px;
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    font-weight: 600;
    color: #0070f3;
    box-shadow: 0 2px 6px rgba(0, 112, 243, 0.15);
    transition: background 0.3s, color 0.3s;
}

.name-badge:hover {
    background: #0070f3;
    color: white;
}

.full-name {
    font-size: 14px;
}

.user-class {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
}

