/* =====================================================
   VISION IMPACT ACADEMY — CSS Principal v2
   Couleurs : #174FA2 (bleu) | #F26722 (orange)
   ===================================================== */

:root {
    --primary:       #174FA2;
    --primary-dark:  #0f3a7a;
    --primary-light: #e8f0fb;
    --accent:        #F26722;
    --accent-dark:   #d4551a;
    --accent-light:  #fff4ee;
    --dark:          #0f172a;
    --gray-900:      #1e293b;
    --gray-700:      #334155;
    --gray-600:      #475569;
    --gray-500:      #64748b;
    --gray-400:      #94a3b8;
    --gray-300:      #cbd5e1;
    --gray-200:      #e2e8f0;
    --gray-100:      #f1f5f9;
    --gray-50:       #f8fafc;
    --white:         #ffffff;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --radius:        12px;
    --radius-lg:     16px;
    --radius-xl:     24px;
    --radius-full:   9999px;
    --shadow:        0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg:     0 10px 40px rgba(0,0,0,0.14);
    --shadow-primary:0 8px 24px rgba(23,79,162,0.25);
    --shadow-accent: 0 8px 24px rgba(242,103,34,0.30);
    --transition:    all 0.25s cubic-bezier(0.4,0,0.2,1);
    --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --navbar-h:      68px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--gray-900); background: var(--white); line-height: 1.65; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font); cursor: pointer; }

/* ===== NAVBAR ===== */
.academy-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--navbar-h);
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}
.academy-navbar.scrolled { box-shadow: var(--shadow); border-bottom-color: transparent; }
.academy-main { padding-top: var(--navbar-h); min-height: calc(100vh - var(--navbar-h)); }

/* ===== FLASH MESSAGES ===== */
.academy-flashes {
    position: fixed; top: calc(var(--navbar-h) + 12px); right: 1.5rem;
    z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
    max-width: 380px; width: calc(100% - 3rem);
}
.academy-flash {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.9rem 1.1rem; border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 500;
    box-shadow: var(--shadow-lg); animation: slideInRight 0.35s cubic-bezier(0.34,1.56,0.64,1);
    border: 1px solid transparent;
}
.academy-flash-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.academy-flash-error   { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.academy-flash-warning { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.academy-flash-info    { background: var(--primary-light); color: var(--primary-dark); border-color: #bfdbfe; }

/* ===== COURSE CARDS ===== */
.course-card {
    background: white; border-radius: var(--radius-lg);
    overflow: hidden; border: 1px solid var(--gray-200);
    transition: var(--transition); height: 100%;
    display: flex; flex-direction: column;
}
.course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.course-card-img {
    position: relative; height: 200px; overflow: hidden;
    background: var(--gray-100); flex-shrink: 0;
}
.course-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.course-card:hover .course-card-img img { transform: scale(1.05); }
.course-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }

/* ===== PROGRESS BAR ===== */
.progress-bar-wrap {
    background: var(--gray-200); border-radius: var(--radius-full);
    height: 8px; overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* ===== BADGE ===== */
.badge-card {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 1.25rem 0.75rem;
    background: white; border-radius: var(--radius);
    border: 1.5px solid var(--gray-200); transition: var(--transition);
}
.badge-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.badge-icon {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin-bottom: 0.6rem;
}

/* ===== DASHBOARD ===== */
.academy-dashboard { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - var(--navbar-h)); }
.academy-sidebar {
    background: var(--dark); color: white;
    padding: 1.5rem 0; position: sticky; top: var(--navbar-h);
    height: calc(100vh - var(--navbar-h)); overflow-y: auto;
}
.academy-sidebar::-webkit-scrollbar { width: 4px; }
.academy-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.sidebar-user { padding: 0 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.07); margin-bottom: 1rem; }
.sidebar-avatar {
    width: 48px; height: 48px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700; color: white; margin-bottom: 0.75rem;
}
.sidebar-nav { list-style: none; padding: 0 0.75rem; }
.sidebar-nav li { margin-bottom: 0.15rem; }
.sidebar-nav li a {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.85rem; border-radius: var(--radius);
    font-size: 0.85rem; font-weight: 500; color: rgba(255,255,255,0.6);
    text-decoration: none; transition: var(--transition);
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background: rgba(255,255,255,0.08); color: white;
}
.sidebar-nav li a i { width: 18px; text-align: center; color: var(--accent); font-size: 0.85rem; }
.sidebar-section { font-size: 0.68rem; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1.5px; padding: 1rem 1.25rem 0.4rem; }
.dashboard-content { padding: 2rem; background: var(--gray-50); overflow-y: auto; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card {
    background: white; border-radius: var(--radius-lg);
    padding: 1.5rem; border: 1px solid var(--gray-100);
    display: flex; align-items: center; gap: 1rem;
    transition: var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.orange { background: var(--accent-light);  color: var(--accent); }
.stat-icon.green  { background: #ecfdf5; color: var(--success); }
.stat-icon.yellow { background: #fffbeb; color: var(--warning); }
.stat-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.stat-num { font-size: 1.75rem; font-weight: 800; color: var(--dark); line-height: 1; letter-spacing: -0.5px; }
.stat-label { font-size: 0.78rem; color: var(--gray-500); margin-top: 0.25rem; }

/* ===== BUTTONS ===== */
.btn-academy-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; border: none; border-radius: var(--radius-full);
    font-weight: 700; font-size: 0.875rem; cursor: pointer;
    transition: var(--transition); box-shadow: var(--shadow-primary);
}
.btn-academy-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(23,79,162,0.4); color: white; }
.btn-academy-accent {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white; border: none; border-radius: var(--radius-full);
    font-weight: 700; font-size: 0.875rem; cursor: pointer;
    transition: var(--transition); box-shadow: var(--shadow-accent);
}
.btn-academy-accent:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(242,103,34,0.4); color: white; }
.btn-academy-outline {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.72rem 1.65rem;
    background: transparent; color: var(--primary);
    border: 2px solid var(--primary); border-radius: var(--radius-full);
    font-weight: 700; font-size: 0.875rem; cursor: pointer;
    transition: var(--transition);
}
.btn-academy-outline:hover { background: var(--primary); color: white; }

/* ===== FORMS ===== */
.academy-form-group { margin-bottom: 1.25rem; }
.academy-form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.45rem; }
.academy-form-group input,
.academy-form-group select,
.academy-form-group textarea {
    width: 100%; padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius);
    font-size: 0.875rem; color: var(--dark); background: var(--gray-50);
    transition: var(--transition); font-family: var(--font);
}
.academy-form-group input:focus,
.academy-form-group select:focus,
.academy-form-group textarea:focus {
    outline: none; border-color: var(--primary);
    background: white; box-shadow: 0 0 0 3px rgba(23,79,162,0.1);
}

/* ===== AUTH ===== */
.academy-auth-page {
    min-height: calc(100vh - var(--navbar-h));
    display: flex; align-items: center;
    background: linear-gradient(135deg, var(--gray-50), var(--primary-light));
    padding: 2.5rem 0;
}
.auth-card {
    background: white; border-radius: var(--radius-xl);
    padding: 2.5rem; box-shadow: var(--shadow-lg);
    max-width: 480px; width: 100%; margin: 0 auto;
    border: 1px solid var(--gray-100);
}

/* ===== QUIZ ===== */
.quiz-question {
    background: white; border-radius: var(--radius-lg);
    padding: 2rem; border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}
.quiz-option {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.85rem 1.1rem; border-radius: var(--radius);
    border: 1.5px solid var(--gray-200); cursor: pointer;
    transition: var(--transition); margin-bottom: 0.6rem;
    background: white;
}
.quiz-option:hover { border-color: var(--primary); background: var(--primary-light); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-light); }
.quiz-option.correct  { border-color: var(--success); background: #ecfdf5; }
.quiz-option.wrong    { border-color: var(--danger);  background: #fef2f2; }

/* ===== VIDEO PLAYER ===== */
.lesson-player { background: #000; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/9; }
.lesson-player video { width: 100%; height: 100%; object-fit: contain; }

/* ===== CERTIFICATE ===== */
.certificate-card {
    background: linear-gradient(135deg, #0a1628, #174FA2);
    border-radius: var(--radius-xl); padding: 2.5rem;
    color: white; text-align: center; position: relative; overflow: hidden;
}
.certificate-card::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ===== MOBILE MENU ===== */
#academyMenu.mobile-open {
    position: fixed; top: var(--navbar-h); left: 0; right: 0;
    background: white; flex-direction: column;
    padding: 1rem; box-shadow: var(--shadow-lg);
    z-index: 999; justify-content: flex-start; gap: 0.2rem;
    border-bottom: 1px solid var(--gray-100);
}

/* ===== ANIMATIONS ===== */
@keyframes slideInRight { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeInUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .academy-dashboard { grid-template-columns: 1fr; }
    .academy-sidebar { position: static; height: auto; }
}
@media (max-width: 768px) {
    :root { --navbar-h: 64px; }
    #academyMenu { display: none; }
    #academyMenu.mobile-open { display: flex; }
    #mobileToggle { display: flex !important; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .auth-card { padding: 1.75rem 1.25rem; }
    .academy-flashes { left: 1rem; right: 1rem; max-width: none; }
}
@media (max-width: 576px) {
    .stats-grid { grid-template-columns: 1fr; }
}