/* ============================================
   CERTINOM MODERN CSS v2 - Glassmorphism
   ============================================ */

:root {
    --bg: #0a0e1a;
    --bg-secondary: #0f1420;
    --bg-card: rgba(19, 24, 38, 0.7);
    --bg-glass: rgba(19, 24, 38, 0.5);
    --text: #e8eaf0;
    --text-muted: #8890a8;
    --text-dim: #5a6178;
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --accent: #8b5cf6;
    --accent-pink: #ec4899;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(37, 43, 61, 0.6);
    --border-light: rgba(255, 255, 255, 0.05);
    --gradient-1: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --gradient-3: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background anime */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, -2%) rotate(2deg); }
}

/* Header moderne */
header {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(10, 14, 26, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu > a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.menu > a:hover {
    color: var(--text);
    background: rgba(59, 130, 246, 0.1);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: var(--gradient-3);
    color: white;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Cards modernes */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

/* Stat cards */
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: var(--shadow-glow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 0.4rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inputs modernes */
.input-modern {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.25s;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: rgba(10, 14, 26, 0.9);
}

.input-modern::placeholder {
    color: var(--text-dim);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-admin {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-user {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Layout container */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem;
}

/* Section */
.section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Grid responsive */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive */
@media (max-width: 768px) {
    header { padding: 1rem; }
    .container { padding: 1rem; }
    .menu > a { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
    .stat-value { font-size: 1.75rem; }
    .grid-2 { grid-template-columns: 1fr; }
}

/* Header user clean (dashboard) */
.header-user-clean {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    z-index: 100;
}
.header-user-clean nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
}
.header-user-clean .logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.header-user-clean .menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.header-user-clean .menu > a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.25s;
}
.header-user-clean .menu > a:hover {
    color: var(--text);
    background: rgba(59, 130, 246, 0.1);
}

/* ============================================
   AMÉLIORATIONS UX (2026-10-09)
   ============================================ */

/* Avatar utilisateur dans le header */
.header-user-clean .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}
.header-user-clean .user-avatar:hover {
    transform: scale(1.05);
}
.header-user-clean .user-info-block {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: 30px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    margin-right: 0.5rem;
}
.header-user-clean .user-name-small {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badge notifications avec animation */
.badge-notif {
    background: #ef4444 !important;
    color: white !important;
    animation: notifPulse 2s infinite;
    font-weight: 700 !important;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}
@keyframes notifPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Bouton retour en haut */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-1);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}
.back-to-top.visible {
    display: flex;
    animation: fadeInUp 0.3s;
}
.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.6);
}

/* Empty states engageants */
.empty-state-modern {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.05), rgba(139,92,246,0.05));
    border: 1px dashed rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    transition: all 0.3s;
}
.empty-state-modern:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
}
.empty-state-modern .empty-icon-lg {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    display: block;
}
.empty-state-modern .empty-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.empty-state-modern .empty-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}
.empty-state-modern .btn {
    display: inline-flex;
}

/* Hero : derniere connexion */
.hero-last-login {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 30px;
    color: #86efac;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 1rem;
}
.hero-last-login .dot-green {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
}

/* Compteur homepage */
.home-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 30px;
    color: #86efac;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
}
.home-counter .counter-value {
    font-weight: 800;
    color: #22c55e;
    font-size: 1rem;
}


/* Fix alignement header-auth (avatar + nom + deconnexion sur une ligne) */
#header-auth {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Amelioration .menu pour aligner verticalement */
.header-user-clean .menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   PHASE 4 — ANIMATIONS SCROLL + PARTAGE
   ============================================ */

/* Animations d'apparition au scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delai progressif pour les grilles */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Hover scale pour cartes */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15);
}

/* Shake pour erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.shake {
    animation: shake 0.5s;
}

/* Success pulse */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.success-pulse {
    animation: successPulse 0.5s;
}

/* ============================================
   BOUTONS PARTAGE
   ============================================ */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.25s;
    background: var(--bg-card);
    color: var(--text);
}
.share-btn:hover {
    transform: translateY(-2px);
    border-color: transparent;
}
.share-btn.whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #4ade80;
    border-color: rgba(37, 211, 102, 0.3);
}
.share-btn.whatsapp:hover {
    background: #25D366;
    color: white;
}
.share-btn.twitter {
    background: rgba(29, 155, 240, 0.15);
    color: #60a5fa;
    border-color: rgba(29, 155, 240, 0.3);
}
.share-btn.twitter:hover {
    background: #1DA1F2;
    color: white;
}
.share-btn.facebook {
    background: rgba(24, 119, 242, 0.15);
    color: #93c5fd;
    border-color: rgba(24, 119, 242, 0.3);
}
.share-btn.facebook:hover {
    background: #1877F2;
    color: white;
}
.share-btn.copy {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.3);
}
.share-btn.copy:hover {
    background: #8b5cf6;
    color: white;
}
.share-btn.copy.copied {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

/* Section partage */
.share-section {
    text-align: center;
    padding: 2rem 1rem;
    margin: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.share-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
}
.share-section .share-buttons {
    justify-content: center;
}

/* ============================================
   RESPONSIVE MOBILE AMELIORE
   ============================================ */
@media (max-width: 480px) {
    /* Header */
    .header-user-clean {
        padding: 0.75rem 1rem !important;
    }
    .header-user-clean nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .header-user-clean .menu {
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    .header-user-clean .menu > a {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
    }
    .header-user-clean .logo {
        font-size: 1.1rem !important;
    }
    .header-user-clean .user-name-small {
        display: none !important;
    }
    
    /* Conteneurs */
    .container {
        padding: 1rem 0.75rem !important;
    }
    
    /* Titres */
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.2rem !important; }
    
    /* Grilles */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Cards */
    .stat-card {
        padding: 1.25rem 1rem !important;
    }
    .stat-value {
        font-size: 1.75rem !important;
    }
    
    /* Boutons */
    .btn {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Chat */
    .input-box {
        padding: 0.4rem 0.4rem 0.4rem 0.75rem !important;
    }
    .icon-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.9rem !important;
    }
    .send-btn {
        width: 34px !important;
        height: 34px !important;
    }
    
    /* Partage */
    .share-buttons {
        justify-content: center;
    }
    .share-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    .share-btn .label {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-user-clean .menu > a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}

/* ============================================
   THÈME CLAIR (Light mode)
   ============================================ */
[data-theme="light"] {
    --bg: #f5f7fb;
    --bg-secondary: #eef1f8;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --text: #0a0e1a;
    --text-muted: #4a5568;
    --text-dim: #8890a8;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --accent: #7c3aed;
    --accent-pink: #db2777;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --border: rgba(203, 213, 225, 0.8);
    --border-light: rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.1);
}

[data-theme="light"] body {
    background: var(--bg);
    color: var(--text);
}

[data-theme="light"] body::before {
    background: radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
}

[data-theme="light"] header,
[data-theme="light"] .header-user-clean {
    background: rgba(245, 247, 251, 0.85);
    border-bottom-color: var(--border);
}

[data-theme="light"] .msg-bubble {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .msg.user .msg-bubble {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
}

[data-theme="light"] .msg.assistant .msg-bubble {
    background: white;
    border-color: var(--border);
}

[data-theme="light"] .msg-bubble strong {
    color: #d97706;
}

[data-theme="light"] .input-box,
[data-theme="light"] .input-container,
[data-theme="light"] .chat-input-container {
    background: white;
    border-color: var(--border);
}

[data-theme="light"] .sidebar {
    background: white;
    border-right-color: var(--border);
}

[data-theme="light"] .msg-bubble code {
    background: rgba(37, 99, 235, 0.1);
    color: #1e40af;
}

/* Bouton toggle theme */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.25s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

/* ============================================
   ADAPTATION COULEURS AU THÈME CLAIR
   ============================================ */

/* 1. Badge "Dernière connexion" et badges verts */
[data-theme="light"] .hero-last-login {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.35);
    color: #15803d;
}
[data-theme="light"] .hero-last-login .dot-green {
    background: #16a34a;
}

/* 2. Badges génériques */
[data-theme="light"] .badge-admin {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.25);
}
[data-theme="light"] .badge-user {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.25);
}
[data-theme="light"] .badge-success {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.25);
}
[data-theme="light"] .badge-warning {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.25);
}
[data-theme="light"] .badge-moderator {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.25);
}

/* 3. Messages et boxes */
[data-theme="light"] .message-box.success {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.3);
    color: #15803d;
}
[data-theme="light"] .message-box.error {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.3);
    color: #b91c1c;
}
[data-theme="light"] .success-msg {
    color: #15803d;
}
[data-theme="light"] .error-msg {
    color: #b91c1c;
}

/* 4. Alertes admin */
[data-theme="light"] .alert-item.info {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.3);
    color: #1d4ed8;
}
[data-theme="light"] .alert-item.warning {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.3);
    color: #b45309;
}
[data-theme="light"] .alert-item.danger {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: #b91c1c;
}

/* 5. Feedback live / Thanks */
[data-theme="light"] .feedback-thanks {
    color: #15803d;
}
[data-theme="light"] .feedback-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}
[data-theme="light"] .feedback-btn.positif.active {
    background: rgba(22, 163, 74, 0.15);
    border-color: #16a34a;
    color: #15803d;
}
[data-theme="light"] .feedback-btn.negatif.active {
    background: rgba(220, 38, 38, 0.15);
    border-color: #dc2626;
    color: #b91c1c;
}

/* 6. Badge notification (rouge) */
[data-theme="light"] .badge-notif {
    background: #dc2626;
    color: white;
}

/* 7. Trust badge (signaler) */
[data-theme="light"] .trust-badge {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.3);
    color: #15803d;
}

/* 8. Anon banner (signaler) */
[data-theme="light"] .anon-banner {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
    color: #6d28d9;
}

/* 9. Live mode overlay */
[data-theme="light"] .live-status {
    background: white;
    color: #0a0e1a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .live-transcription {
    color: #4a5568;
}

/* 10. Stat values (chiffres gradient) */
[data-theme="light"] .stat-value {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 11. Hero stats */
[data-theme="light"] .hero-stat-value {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 12. Tags et labels */
[data-theme="light"] .section-tag {
    color: #1d4ed8;
}
[data-theme="light"] .hero-badge {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.25);
    color: #1d4ed8;
}

/* 13. Dot vert "Je t'écoute" */
[data-theme="light"] .main-header-title .dot {
    background: #16a34a;
}

/* 14. Buttons hover */
[data-theme="light"] .icon-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}
[data-theme="light"] .icon-btn.tts-on {
    background: rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
    color: #2563eb;
}
[data-theme="light"] .icon-btn.recording {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* 15. Speak button */
[data-theme="light"] .speak-btn:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

/* 16. Bouton partage */
[data-theme="light"] .share-btn.whatsapp {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.3);
}
[data-theme="light"] .share-btn.twitter {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.3);
}
[data-theme="light"] .share-btn.facebook {
    background: rgba(24, 119, 242, 0.12);
    color: #1d4ed8;
    border-color: rgba(24, 119, 242, 0.3);
}
[data-theme="light"] .share-btn.copy {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.3);
}

/* 17. Chips (suggestions chat) */
[data-theme="light"] .chip:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: #2563eb;
    color: #2563eb;
}

/* 18. Empty states */
[data-theme="light"] .empty-state-modern {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.05));
    border-color: rgba(37, 99, 235, 0.25);
}

/* 19. Trust badge signaler */
[data-theme="light"] .signaler-hero h1,
[data-theme="light"] .about-hero h1,
[data-theme="light"] .contact-hero h1 {
    background: linear-gradient(135deg, #0a0e1a, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 20. Hero title (index) */
[data-theme="light"] .hero h1 {
    background: linear-gradient(135deg, #0a0e1a, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 21. Welcome logo */
[data-theme="light"] .welcome h1 {
    background: linear-gradient(135deg, #0a0e1a, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 22. Sections sombres du chat */
[data-theme="light"] .chat-input-area {
    background: white;
    border-top-color: var(--border);
}
[data-theme="light"] .chips {
    background: transparent;
}
[data-theme="light"] .chip {
    background: white;
    border-color: var(--border);
}
[data-theme="light"] .message-time {
    color: #8890a8;
}

/* 23. Hero user dashboard */
[data-theme="light"] .hero-user {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
    border-color: var(--border);
}

/* 24. Menu user actif */
[data-theme="light"] .menu-user a.active,
[data-theme="light"] .menu-user a:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
}

/* 25. Action cards admin */
[data-theme="light"] .action-card:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: #2563eb;
}

/* 26. Stat-card glow */
[data-theme="light"] .stat-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.12);
}

/* 27. Items borders (users, entites, missions) */
[data-theme="light"] .list-item:hover {
    background: rgba(37, 99, 235, 0.05);
}
[data-theme="light"] .list-item-title {
    color: #0a0e1a;
}
[data-theme="light"] .list-item-sub {
    color: #4a5568;
}

/* 28. Journal */
[data-theme="light"] .journal-entry:hover {
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(37, 99, 235, 0.03);
}

/* 29. Feedback item */
[data-theme="light"] .feedback-item {
    background: white;
}

/* 30. Scrollbar (claire) */
[data-theme="light"] .messages-container::-webkit-scrollbar-thumb,
[data-theme="light"] .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.3);
}

/* 31. Input focus */
[data-theme="light"] .input-box:focus-within {
    border-color: #2563eb;
    box-shadow: 0 4px 30px rgba(37, 99, 235, 0.15);
}
[data-theme="light"] #chat-input::placeholder {
    color: #8890a8;
}

/* 32. Bouton "Retour en haut" en clair */
[data-theme="light"] .back-to-top {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

/* 33. Message META (hero-last-login pour le dashboard) */
[data-theme="light"] #last-login-container .hero-last-login {
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
}

/* 34. Sections "Comment ça marche" sur a-propos */
[data-theme="light"] .about-section {
    background: white;
}
[data-theme="light"] .about-stat {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.06));
}

/* 35. Contact card */
[data-theme="light"] .contact-card {
    background: white;
}
[data-theme="light"] .contact-card:hover {
    border-color: rgba(37, 99, 235, 0.4);
}

/* 36. Installer card */
[data-theme="light"] .install-card {
    background: white;
}

/* 37. Chat sidebar historique */
[data-theme="light"] .sidebar-history::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.2);
}
[data-theme="light"] .history-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #0a0e1a;
}
[data-theme="light"] .history-item.active {
    background: rgba(37, 99, 235, 0.15);
    color: #0a0e1a;
}

/* 38. Chat input box */
[data-theme="light"] .input-box {
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}


/* ============================================
   FIX COULEURS SPECIFIQUES THEME CLAIR
   ============================================ */

/* Status notifications push (profil.html) */
[data-theme="light"] #push-status > div {
    color: #0a0e1a !important;
}

[data-theme="light"] #push-status > div[style*="rgba(34,197,94"] {
    background: rgba(22, 163, 74, 0.12) !important;
    color: #15803d !important;
    font-weight: 600;
}

[data-theme="light"] #push-status > div[style*="rgba(245,158,11"] {
    background: rgba(217, 119, 6, 0.12) !important;
    color: #b45309 !important;
    font-weight: 600;
}

[data-theme="light"] #push-status > div[style*="rgba(239,68,68"] {
    background: rgba(220, 38, 38, 0.12) !important;
    color: #b91c1c !important;
    font-weight: 600;
}

/* Hero last login (badge dernière connexion) */
[data-theme="light"] .hero-last-login {
    background: rgba(22, 163, 74, 0.12) !important;
    border-color: rgba(22, 163, 74, 0.35) !important;
    color: #15803d !important;
    font-weight: 600;
}

/* Trust badge "100% anonyme" */
[data-theme="light"] .trust-badge {
    background: rgba(22, 163, 74, 0.12) !important;
    border-color: rgba(22, 163, 74, 0.35) !important;
    color: #15803d !important;
    font-weight: 600;
}

/* Anon banner (signaler-user) */
[data-theme="light"] .anon-banner {
    background: rgba(124, 58, 237, 0.1) !important;
    border-color: rgba(124, 58, 237, 0.3) !important;
    color: #6d28d9 !important;
    font-weight: 500;
}

/* Carte notifications profil */
[data-theme="light"] .push-notif-card {
    background: white;
}

/* Résultats signaler */
[data-theme="light"] .result-box.success {
    background: rgba(22, 163, 74, 0.12) !important;
    border-color: rgba(22, 163, 74, 0.3) !important;
    color: #15803d !important;
}
[data-theme="light"] .result-box.error {
    background: rgba(220, 38, 38, 0.12) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
    color: #b91c1c !important;
}
[data-theme="light"] .result-box a {
    color: #15803d;
    font-weight: 600;
}

/* Bouton désactiver push (rouge clair -> rouge foncé) */
[data-theme="light"] #push-disable-btn {
    background: rgba(220, 38, 38, 0.1) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
    color: #b91c1c !important;
}

/* Live overlay */
[data-theme="light"] .live-overlay .live-status {
    background: white;
    color: #0a0e1a;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--border);
}

/* Chat sidebar "Nouveau chat" */
[data-theme="light"] .sidebar-new-chat {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
}

/* Sidebar avatar */
[data-theme="light"] .sidebar-avatar {
    background: linear-gradient(135deg, #16a34a, #059669);
    color: white;
}


/* ============================================
   FIX INPUTS THEME CLAIR
   ============================================ */

/* Champ recherche rapide (dashboard user) */
[data-theme="light"] .search-quick input,
[data-theme="light"] .input-modern {
    background: white !important;
    border-color: #cbd5e1 !important;
    color: #0a0e1a !important;
}

[data-theme="light"] .search-quick input:focus,
[data-theme="light"] .input-modern:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

[data-theme="light"] .search-quick input::placeholder,
[data-theme="light"] .input-modern::placeholder {
    color: #8890a8 !important;
}

/* Tous les inputs de formulaire */
[data-theme="light"] .form-group-modern input,
[data-theme="light"] .form-group-modern select,
[data-theme="light"] .form-group-modern textarea,
[data-theme="light"] .form-group input {
    background: white !important;
    border-color: #cbd5e1 !important;
    color: #0a0e1a !important;
}

[data-theme="light"] .form-group-modern input:focus,
[data-theme="light"] .form-group-modern select:focus,
[data-theme="light"] .form-group-modern textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

[data-theme="light"] .form-group-modern input::placeholder,
[data-theme="light"] .form-group-modern textarea::placeholder {
    color: #8890a8 !important;
}

/* Filters (admin + user pages) */
[data-theme="light"] .filters input,
[data-theme="light"] .filters select,
[data-theme="light"] .filters-user input,
[data-theme="light"] .filters-user select {
    background: white !important;
    border-color: #cbd5e1 !important;
    color: #0a0e1a !important;
}

/* Chat input */
[data-theme="light"] #chat-input {
    color: #0a0e1a !important;
}

/* Bouton recherche rapide */
[data-theme="light"] .search-quick button {
    background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
    color: white !important;
}

