 /* ===== STOAHUB — style.css (Optimisé) ===== */

/* 1. Variables de thème (Design System) */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.6);
    --primary: #4f46e5;
    --glass-bg: rgba(255, 255, 255, 0.92);
}

/* 2. Variables Dark Mode (S'activent avec la classe .dark) */
body.dark {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --glass-bg: rgba(15, 23, 42, 0.95);
}

/* Base */
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background-color: var(--bg-main); 
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
}

/* Application des couleurs via variables sur les éléments Tailwind existants */
body.dark .bg-white { background-color: var(--bg-card) !important; }
body.dark .text-slate-900, body.dark .text-slate-800 { color: var(--text-main) !important; }
body.dark .text-slate-600, body.dark .text-slate-500 { color: var(--text-muted) !important; }
body.dark .border-slate-100, body.dark .border-slate-200 { border-color: var(--border-color) !important; }

/* Navbar Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Cards & Shadow */
.card-shadow {
    background-color: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    border-radius: 1rem;
}

.card-shadow:hover { 
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08); 
    transform: translateY(-2px);
}

/* Filtres & États */
.active-filter {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* Utilitaires Scrollbar */
.no-scrollbar { 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade { 
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
    will-change: transform, opacity;
}

/* Messagerie / Bulles */
.chat-bubble-me {
    background-color: var(--primary);
    color: white;
    border-radius: 1.25rem 1.25rem 0.25rem 1.25rem;
    padding: 0.75rem 1rem;
    max-width: 85%;
    font-size: 0.875rem;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.2);
}

.chat-bubble-other {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-radius: 1.25rem 1.25rem 1.25rem 0.25rem;
    padding: 0.75rem 1rem;
    max-width: 85%;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

/* Quiz Intéractif */
.quiz-btn { 
    transition: all 0.2s ease;
    border: 2px solid var(--border-color);
}
.quiz-btn:hover:not(:disabled) { border-color: var(--primary); }
.quiz-btn:active { transform: scale(0.98); }

.quiz-correct { 
    background-color: #d1fae5 !important; 
    color: #065f46 !important; 
    border-color: #10b981 !important; 
}
.quiz-wrong { 
    background-color: #fee2e2 !important; 
    color: #991b1b !important; 
    border-color: #ef4444 !important; 
}

/* Badge de Notification */
.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}