@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Be+Vietnam+Pro:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&display=swap');

/* ============================================================
   DESIGN SYSTEM – Bách Khoa Tiểu Học
   Soft, warm, child-friendly with modern aesthetics
   ============================================================ */

:root {
    /* ---- Typography ---- */
    --font-primary: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Baloo 2', var(--font-primary);

    /* ---- Primary Colors ---- */
    --color-primary: #FF6B35;
    --color-primary-light: #FF8F5E;
    --color-primary-dark: #E55A28;
    --color-secondary: #7C3AED;
    --color-secondary-light: #A78BFA;
    --color-accent-pink: #FF8FAB;
    --color-accent-teal: #2DD4BF;
    --color-accent-yellow: #FBBF24;
    --color-accent-blue: #60A5FA;

    /* ---- Text Colors ---- */
    --color-text: #2D3748;
    --color-text-light: #718096;
    --color-text-white: #FFFFFF;

    /* ---- Background Colors ---- */
    --color-bg-white: #FFFFFF;
    --color-bg-cream: #FFFBF5;
    --color-bg-pink: #FFF0F3;
    --color-bg-mint: #F0FFF4;
    --color-bg-lavender: #F5F3FF;
    --color-bg-warm: #FFFBEB;
    --color-bg-sky: #EFF6FF;
    --color-bg-coral: #FFF5F5;
    --color-bg-dark: #1E293B;

    /* ---- Shadows ---- */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12);
    --shadow-color: 0 4px 20px rgba(255, 107, 53, 0.15);
    --shadow-card-hover: 0 12px 35px rgba(0, 0, 0, 0.12);

    /* ---- Border Radius ---- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* ---- Transitions ---- */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-cream);
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul { list-style: none; }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---- Container ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Utility ---- */
.text-center { text-align: center; }

.section-padding {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    color: var(--color-text);
    line-height: 1.3;
}

.section-title span {
    color: var(--color-primary);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto 50px;
    font-weight: 500;
}

.bg-colored-title {
    color: var(--color-text-white) !important;
}

/* ============================================================
   ANIMATED BACKGROUND DECORATIONS
   ============================================================ */
.animated-bg-container { display: none; }

/* ---- Keyframe Animations ---- */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes floatReverse {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(20px) rotate(-5deg); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

@keyframes floatDiag {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(15px, -20px) rotate(10deg); }
    66% { transform: translate(-10px, -10px) rotate(-5deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinSlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.15); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

@keyframes drift {
    0% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(20px) translateY(-10px); }
    50% { transform: translateX(10px) translateY(-25px); }
    75% { transform: translateX(-10px) translateY(-15px); }
    100% { transform: translateX(0) translateY(0); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.float-anim { animation: float 6s ease-in-out infinite; }

/* ---- Floating Decoration System ---- */
.section-decors {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.decor {
    position: absolute;
    pointer-events: none;
    will-change: transform;
}

/* ---- Shape: Circle ---- */
.decor-circle {
    border-radius: 50%;
}

/* ---- Shape: Ring ---- */
.decor-ring {
    border-radius: 50%;
    background: transparent !important;
    border: 3px solid currentColor;
}

/* ---- Shape: Star (CSS) ---- */
.decor-star {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    line-height: 1;
}

/* ---- Shape: Plus ---- */
.decor-plus {
    position: absolute;
    font-weight: 800;
    line-height: 1;
}

/* ---- Shape: Heart ---- */
.decor-heart::before {
    content: '♥';
    display: block;
}

/* ---- Shape: Triangle ---- */
.decor-triangle {
    width: 0;
    height: 0;
    background: transparent !important;
    border-left: var(--tri-size, 12px) solid transparent;
    border-right: var(--tri-size, 12px) solid transparent;
    border-bottom: calc(var(--tri-size, 12px) * 1.7) solid currentColor;
}

/* ---- Shape: Diamond ---- */
.decor-diamond {
    transform-origin: center;
}

/* ---- Shape: Squiggle ---- */
.decor-squiggle svg {
    width: 100%;
    height: 100%;
}

/* ---- Shape: Dot pattern ---- */
.decor-dots {
    display: grid;
    grid-template-columns: repeat(3, 8px);
    gap: 6px;
}
.decor-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* ---- Size Presets ---- */
.decor-xs { width: 10px; height: 10px; font-size: 10px; }
.decor-sm { width: 18px; height: 18px; font-size: 18px; }
.decor-md { width: 28px; height: 28px; font-size: 28px; }
.decor-lg { width: 42px; height: 42px; font-size: 42px; }
.decor-xl { width: 60px; height: 60px; font-size: 60px; }

/* ---- Animation Presets ---- */
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-float-rev { animation: floatReverse 7s ease-in-out infinite; }
.anim-float-diag { animation: floatDiag 8s ease-in-out infinite; }
.anim-spin { animation: spinSlow 20s linear infinite; }
.anim-wiggle { animation: wiggle 3s ease-in-out infinite; }
.anim-bounce { animation: bounce 4s ease-in-out infinite; }
.anim-pulse { animation: pulse 4s ease-in-out infinite; }
.anim-twinkle { animation: twinkle 3s ease-in-out infinite; }
.anim-drift { animation: drift 12s ease-in-out infinite; }

/* ---- Blob shapes ---- */
.decor-blob {
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
    opacity: 0.1;
}

.decor-blob-2 {
    border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
    opacity: 0.08;
}

/* ---- Responsive: hide on small screens ---- */
@media (max-width: 768px) {
    .decor-lg, .decor-xl, .decor-blob, .decor-blob-2 {
        display: none;
    }
    .section-decors .decor {
        opacity: 0.5 !important;
        transform: scale(0.7);
    }
    .cute-cloud, .cute-rainbow, .cute-sun, .cute-balloon {
        transform: scale(0.6);
    }
}

/* ============================================================
   CUTE SVG DECORATIONS (Clouds, Rainbows, Stars, Sun)
   ============================================================ */

/* ---- Floating Cloud ---- */
.cute-cloud {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}
.cute-cloud svg {
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.05));
}

@keyframes cloudDrift {
    0% { transform: translateX(0); }
    50% { transform: translateX(30px); }
    100% { transform: translateX(0); }
}

@keyframes cloudFloat {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(15px) translateY(-8px); }
    75% { transform: translateX(-10px) translateY(5px); }
}

/* ---- Rainbow Arc ---- */
.cute-rainbow {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

/* ---- Big Cute Star ---- */
.cute-star {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}
.cute-star svg {
    filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.3));
}

@keyframes starSparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    25% { transform: scale(1.15) rotate(5deg); opacity: 1; }
    50% { transform: scale(1) rotate(-3deg); opacity: 0.7; }
    75% { transform: scale(1.1) rotate(2deg); opacity: 0.9; }
}

/* ---- Cute Sun ---- */
.cute-sun {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.08) rotate(15deg); }
}

/* ---- Hot Air Balloon ---- */
.cute-balloon {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

@keyframes balloonFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    33% { transform: translateY(-15px) rotate(2deg); }
    66% { transform: translateY(-5px) rotate(-1deg); }
}

/* ---- Rocket ---- */
.cute-rocket {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

@keyframes rocketBob {
    0%, 100% { transform: translateY(0) rotate(-15deg); }
    50% { transform: translateY(-20px) rotate(-10deg); }
}

/* ---- Pencil ---- */
.cute-pencil {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

@keyframes pencilWiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* ---- Cloud Section Divider ---- */
.cloud-divider {
    position: absolute;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 3;
    pointer-events: none;
}
.cloud-divider.bottom {
    bottom: -2px;
}
.cloud-divider.top {
    top: -2px;
}
.cloud-divider svg {
    display: block;
    width: 100%;
    height: 80px;
}
@media (max-width: 768px) {
    .cloud-divider svg {
        height: 50px;
    }
}

/* ============================================================
   WAVE SECTION DIVIDERS
   ============================================================ */
.section-divider {
    position: absolute;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 2;
    pointer-events: none;
}

.section-divider.bottom {
    bottom: -1px;
}

.section-divider.top {
    top: -1px;
}

.section-divider svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: none;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-text-white);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-bg-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: var(--color-text-white);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-secondary), #6D28D9);
    color: var(--color-text-white);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(124, 58, 237, 0.45);
}

.btn-white {
    background: var(--color-bg-white);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Keep backward compat with old classes */
.btn-bubble { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-text-white);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
}
.btn-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.45);
}
.btn-bubble-yellow {
    background: linear-gradient(135deg, var(--color-accent-yellow), #F59E0B) !important;
    color: var(--color-text) !important;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.35) !important;
}
.btn-bubble-yellow:hover {
    box-shadow: 0 6px 25px rgba(251, 191, 36, 0.45) !important;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
    background: linear-gradient(135deg, #2D3748, #1A202C);
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 0;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: none;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-contact span {
    margin-right: 24px;
}

.topbar-contact i {
    color: var(--color-accent-yellow);
    margin-right: 6px;
}

.topbar-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.topbar-auth-btn i {
    font-size: 0.72rem;
}

.topbar-login-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.topbar-login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.topbar-register-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.topbar-register-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.4);
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.9);
}

.topbar-user i {
    color: var(--color-accent-teal, #2DD4BF);
    font-size: 0.9rem;
}

.topbar-logout-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.75);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.topbar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #F87171;
}

/* Custom Toast Notification */
.custom-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--color-bg-white, #ffffff);
    color: var(--color-text, #1E293B);
    padding: 14px 22px;
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 5px solid var(--color-primary, #FF6B35);
}

.custom-toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================================
   HEADER & NAV
   ============================================================ */
header {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-base);
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), inset 0 -4px 0 rgba(0, 0, 0, 0.03);
    border-bottom: 2px solid rgba(0, 0, 0, 0.02);
}

header .container {
    max-width: 100% !important;
    padding: 0 24px;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    gap: 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: all var(--transition-base);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text-group {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 900;
    background: linear-gradient(135deg, #3B82F6, #6366F1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.15;
    white-space: nowrap;
    display: inline-block;
}

.logo-text span {
    background: linear-gradient(135deg, #FF6B35, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-tagline {
    font-size: 0.95rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0284C7, #0D9488);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 2px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: inline-block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-link {
    font-size: 1.02rem;
    font-weight: 800;
    color: #334155 !important; /* Darker slate for better readability */
    padding: 10px 16px;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    white-space: nowrap;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px; /* spacing for FontAwesome icons */
}

.nav-link i.nav-icon {
    font-size: 1.08rem;
    opacity: 0.9;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3.5px;
    background: var(--color-primary); /* Orange line */
    border-radius: 2px;
    transition: transform 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-link.active {
    color: var(--color-primary) !important;
    font-weight: 800;
}

.nav-link:hover {
    color: var(--color-primary) !important;
}

/* ---- Nav Actions (right side) ---- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-contact-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-contact-link i {
    font-size: 0.85rem;
    color: #475569;
}

.nav-contact-link:hover {
    color: var(--color-primary);
    background-color: rgba(255, 107, 53, 0.05);
}

.nav-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 800;
    font-family: var(--font-primary);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white !important;
    border: 2px solid var(--color-primary-light);
    border-bottom-width: 5px;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.2);
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
}

.nav-cta-btn:hover {
    transform: translateY(1px);
    border-bottom-width: 4px;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
    box-shadow: 0 6px 15px rgba(255, 107, 53, 0.3);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.6rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 8px;
}

/* ============================================================
   MEGA MENU
   ============================================================ */
.mega-menu-trigger {
    position: static !important;
}

.mega-menu-trigger > .nav-link .mega-arrow {
    font-size: 0.6rem;
    margin-left: 4px;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.mega-menu-trigger:hover > .nav-link .mega-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-bg-white);
    border-top: 3px solid var(--color-primary);
    border-bottom: 5px solid var(--color-primary-dark);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
    overflow: visible; /* Đặt overflow: visible để pseudo-element ::before không bị trình duyệt cắt bỏ */
}

/* Vùng đệm hover vô hình kết nối header với dropdown để không bị mất hover */
.mega-menu::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 30px;
    background: transparent;
    z-index: 10;
}

/* Custom Scrollbar cho Mega Menu */
.mega-menu::-webkit-scrollbar {
    width: 6px;
}
.mega-menu::-webkit-scrollbar-track {
    background: transparent;
}
.mega-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}
.mega-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.mega-menu-trigger:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mega-menu-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 14px;
}

/* ---- Row Label ---- */
.mega-row {
    margin-bottom: 4px;
}

.mega-row-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--color-primary);
    margin-bottom: 18px;
    padding: 6px 14px;
    background: #FFF5F2;
    border-radius: var(--radius-full);
    border: 1.5px dashed var(--color-primary-light);
}

.mega-row-label i {
    font-size: 0.72rem;
}

/* ---- Columns ---- */
.mega-columns {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
}

.mega-col {
    padding: 0 12px;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.mega-col:last-child {
    border-right: none;
}

/* ---- Column Title ---- */
.mega-col-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--col-color, var(--color-primary)) !important;
    margin-bottom: 14px;
    padding: 6px 12px;
    background: var(--col-bg, rgba(255, 107, 53, 0.08));
    border-radius: var(--radius-md);
    letter-spacing: 0.5px;
    display: inline-block;
    border: 1.5px solid var(--col-border, rgba(255, 107, 53, 0.15));
    box-shadow: 2px 2px 0px var(--col-border, rgba(255, 107, 53, 0.15));
}

/* Custom styles to increase the size of inline-styled Tiếng Việt / Toán labels */
.mega-col > div:not(.mega-col-title) {
    font-size: 0.82rem !important;
}

/* ---- Links ---- */
.mega-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-col ul li {
    margin-bottom: 4px;
}

.mega-col ul li a {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: #475569;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    line-height: 1.4;
}

.mega-col ul li a:hover {
    color: var(--col-color, var(--color-primary));
    background-color: var(--col-bg, rgba(255, 107, 53, 0.06));
    transform: translateX(4px);
    box-shadow: inset 0 0 0 1.5px var(--col-border, rgba(255, 107, 53, 0.15));
}

/* ---- Divider between rows ---- */
.mega-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.15), rgba(124, 58, 237, 0.12), transparent);
    margin: 10px 0;
}

/* ---- Row 2 has fewer columns ---- */
.mega-row:last-of-type .mega-columns {
    grid-template-columns: repeat(6, 1fr);
}

/* ---- Footer CTA ---- */
.mega-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mega-footer span {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-text-white) !important;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.mega-footer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.35);
}

/* ============================================================
   MEGA MENU TAB LAYOUT (DESKTOP ONLY)
   ============================================================ */
.mega-tab-container-desktop {
    display: none; /* Hidden by default, only shown on Desktop */
}

@media (min-width: 1025px) {
    .mega-columns {
        display: none !important; /* Hide old 6-column layout on Desktop */
    }
    
    .mega-tab-container-desktop {
        display: flex !important;
        background: var(--color-bg-white);
        min-height: 400px;
        border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
        overflow: hidden;
    }
    
    /* Left Vertical Tabs Menu */
    .mega-tab-menu {
        width: 210px;
        flex-shrink: 0;
        background: var(--color-bg-cream);
        border-right: 2px solid rgba(0, 0, 0, 0.04);
        display: flex;
        flex-direction: column;
        padding: 20px 14px;
        gap: 8px;
    }
    
    .mega-tab-btn {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 12px 16px;
        font-family: var(--font-primary);
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--color-text);
        background: transparent;
        border: 2px solid transparent;
        border-radius: var(--radius-lg);
        cursor: pointer;
        text-align: left;
        transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.25);
    }
    
    .mega-tab-btn .tab-icon {
        font-size: 1.2rem;
        transition: transform 0.25s ease;
    }
    
    /* Hover tab effect */
    .mega-tab-btn:hover {
        background: rgba(255, 255, 255, 0.6);
        border-color: rgba(0, 0, 0, 0.02);
        transform: translateX(4px);
    }
    
    /* Active tab - Chunky 3D Pastel style with custom class color */
    .mega-tab-btn.active {
        background: var(--color-bg-white) !important;
        color: var(--tab-active-color, var(--color-primary)) !important;
        border-color: var(--tab-active-border, var(--color-primary-light)) !important;
        border-bottom-width: 4px !important;
        box-shadow: var(--shadow-sm);
        transform: translateY(-2px) translateX(2px);
    }
    
    .mega-tab-btn.active .tab-icon {
        transform: scale(1.2) rotate(5deg);
    }
    
    /* Right Content Panel Display */
    .mega-tab-content {
        flex: 1;
        padding: 20px 24px;
        position: relative;
        overflow: hidden;
    }
    
    .mega-tab-panel {
        display: none;
        height: 100%;
        animation: megaFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    
    .mega-tab-panel.active {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    @keyframes megaFadeIn {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    /* Panel Header info */
    .mega-panel-header {
        border-bottom: 2px dashed rgba(0, 0, 0, 0.05);
        padding-bottom: 10px;
        margin-bottom: 4px;
    }
    
    .panel-subtitle {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--color-text);
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .panel-subtitle::before {
        content: '✨';
        font-size: 1rem;
    }
    
    /* Panel body flex container */
    .mega-panel-body {
        display: flex;
        gap: 24px;
        flex: 1;
        align-items: stretch;
    }
    
    /* Left column section for subjects links */
    .mega-panel-links-wrap {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        flex: 1;
    }
    
    /* Special layout for single grade categories like Kindergarten/TTH */
    .mega-panel-links-wrap:has(> :only-child) {
        grid-template-columns: 1.2fr;
    }
    
    /* Subject block (Math & Vietnamese columns) */
    .mega-menu-subject-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .mega-subject-title {
        font-size: 0.95rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        padding: 4px 12px;
        background: var(--col-bg, rgba(255, 107, 53, 0.06));
        color: var(--col-color, var(--color-primary)) !important;
        border-radius: var(--radius-md);
        border: 1.5px solid var(--col-border, rgba(255, 107, 53, 0.12));
        box-shadow: 2px 2px 0px var(--col-border, rgba(255, 107, 53, 0.12));
        width: fit-content;
        margin-bottom: 6px;
    }
    
    .mega-menu-subject-group ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    /* Auto splitting into 2 columns if list of lessons is long (> 7 items) */
    .mega-menu-subject-group ul:has(> :nth-child(8)) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 16px;
        row-gap: 2px;
    }
    
    .mega-menu-subject-group ul li a {
        display: block;
        font-size: 0.92rem;
        font-weight: 700;
        color: #475569;
        padding: 5px 8px;
        border-radius: var(--radius-md);
        transition: all 0.2s ease;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mega-menu-subject-group ul li a:hover {
        color: var(--col-color, var(--color-primary)) !important;
        background-color: var(--col-bg, rgba(255, 107, 53, 0.05)) !important;
        transform: translateX(4px);
        box-shadow: inset 0 0 0 1.5px var(--col-border, rgba(255, 107, 53, 0.12));
    }
    
    /* Right side Promotion / Featured Card */
    .mega-panel-promo {
        width: 250px;
        flex-shrink: 0;
        display: flex;
        align-items: stretch;
    }
    
    .promo-card {
        border-radius: var(--radius-xl);
        border: 2.5px solid rgba(0, 0, 0, 0.06);
        border-bottom-width: 6px;
        padding: 24px 20px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        height: 100%;
        width: 100%;
        position: relative;
        overflow: hidden;
        transition: all 0.25s ease;
    }
    
    .promo-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }
    
    /* Class customized promo background gradients */
    .tth-bg { background: linear-gradient(135deg, #FFF5F2, #FFFBEB); border-color: #FFD4C0; border-bottom-color: var(--color-primary); }
    .l1-bg { background: linear-gradient(135deg, #F5F3FF, #FFF0F3); border-color: #DDD6FE; border-bottom-color: #8B5CF6; }
    .l2-bg { background: linear-gradient(135deg, #ECFDF5, #EFF6FF); border-color: #A7F3D0; border-bottom-color: #06B6D4; }
    .l3-bg { background: linear-gradient(135deg, #FFF1F2, #FFFBEB); border-color: #FECDD3; border-bottom-color: #EC4899; }
    .l4-bg { background: linear-gradient(135deg, #ECFDF5, #F5F3FF); border-color: #A7F3D0; border-bottom-color: #10B981; }
    .l5-bg { background: linear-gradient(135deg, #EFF6FF, #FFFBEB); border-color: #BFDBFE; border-bottom-color: #3B82F6; }
    
    .promo-mascot-wrapper {
        width: 76px;
        height: 76px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: white;
        border-radius: 50%;
        border: 2.5px solid rgba(0, 0, 0, 0.05);
        box-shadow: var(--shadow-sm);
        margin-bottom: 2px;
        animation: promoMascotFloat 4s ease-in-out infinite;
    }
    
    @keyframes promoMascotFloat {
        0%, 100% { transform: translateY(0) rotate(0deg); }
        50% { transform: translateY(-5px) rotate(3deg); }
    }
    
    .promo-mascot {
        width: 52px;
        height: 52px;
        object-fit: contain;
    }
    
    .promo-text h6 {
        font-size: 0.95rem;
        font-weight: 850;
        color: var(--color-text);
        margin-bottom: 6px;
    }
    
    .promo-text p {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--color-text-light);
        line-height: 1.4;
        margin-bottom: 14px;
        padding: 0 8px;
    }
    
    .btn-promo-cta {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 18px;
        font-size: 0.78rem;
        font-weight: 800;
        color: white !important;
        background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
        border-radius: var(--radius-full);
        border: none;
        box-shadow: 0 4px 10px rgba(255, 107, 53, 0.25);
        transition: all 0.2s ease;
    }
    
    .btn-promo-cta:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 15px rgba(255, 107, 53, 0.35);
    }
}

/* ============================================================
   HERO BANNER / CAROUSEL
   ============================================================ */
.hero-banner {
    background: linear-gradient(170deg, var(--color-bg-cream) 0%, var(--color-bg-warm) 50%, #FFF3E0 100%);
    padding: 60px 0 100px;
    position: relative;
}

/* Hero decorative elements */
.hero-banner::before {
    content: '';
    position: absolute;
    top: 60px;
    right: 5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 143, 171, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatSlow 8s ease-in-out infinite;
    pointer-events: none;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: 120px;
    left: 3%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatSlow 10s ease-in-out infinite 2s;
    pointer-events: none;
}

.carousel-container {
    position: relative;
    border: none;
    border-radius: var(--radius-2xl);
    background: var(--color-bg-white);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    height: 480px;
}

.carousel-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    padding: 50px 60px;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.slide-content {
    flex: 1.1;
    max-width: 55%;
    z-index: 3;
}

.slide-badge {
    display: inline-block;
    padding: 6px 18px;
    background: linear-gradient(135deg, var(--color-accent-yellow), #F59E0B);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: var(--color-text);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.slide-title {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: 18px;
}

.slide-title span {
    color: var(--color-primary);
    position: relative;
}

.slide-desc {
    font-size: 1.05rem;
    margin-bottom: 32px;
    color: var(--color-text-light);
    max-width: 90%;
    line-height: 1.8;
}

.slide-image-wrapper {
    flex: 0.9;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.custom-vector-scene {
    width: 100%;
    height: 350px;
    border: none;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--color-bg-warm), var(--color-bg-pink));
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Network illustration (slide 1) */
.network-illustration {
    position: relative;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--color-bg-warm), var(--color-bg-pink));
    overflow: hidden;
}

.network-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 3px solid var(--color-primary);
    background: var(--color-bg-white);
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.25);
}

.network-center img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.network-node {
    position: absolute;
    width: 55px; height: 55px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: var(--color-bg-white);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    z-index: 5;
    transition: transform var(--transition-base);
}

.network-node:hover {
    transform: scale(1.15);
}

.network-node img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.node-1 { top: 18%; left: 18%; }
.node-2 { top: 12%; right: 20%; }
.node-3 { bottom: 18%; left: 13%; }
.node-4 { bottom: 12%; right: 18%; }
.node-5 { top: 46%; right: 8%; }
.node-6 { top: 48%; left: 6%; }

.network-label {
    position: absolute;
    background: var(--color-primary);
    color: var(--color-text-white);
    border: none;
    border-radius: var(--radius-full);
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}
.label-1 { top: 36%; left: 14%; }
.label-2 { top: 30%; right: 21%; }
.label-3 { bottom: 36%; left: 10%; }
.label-4 { bottom: 30%; right: 16%; }

.network-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
}

.network-svg line {
    stroke: var(--color-primary);
    stroke-width: 2;
    stroke-dasharray: 6 6;
    opacity: 0.3;
}

/* Carousel Navigation */
.carousel-nav {
    position: absolute;
    bottom: 28px;
    left: 60px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.carousel-indicator {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.carousel-indicator.active {
    background: var(--color-primary);
    width: 32px;
    border-radius: var(--radius-full);
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--color-bg-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    color: var(--color-text);
}

.carousel-arrow:hover {
    background: var(--color-primary);
    color: var(--color-text-white);
    box-shadow: var(--shadow-lg);
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

.carousel-progress-bar {
    position: absolute;
    bottom: 0; left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent-yellow));
    width: 0%;
    z-index: 10;
    transition: width 5s linear;
    border-radius: 0 var(--radius-sm) 0 0;
}

/* ============================================================
   CERTIFICATES / EXAMS SECTION
   ============================================================ */
.certificates-section {
    background: linear-gradient(180deg, var(--color-bg-sky) 0%, var(--color-bg-lavender) 100%);
    position: relative;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 20px;
}

.cert-card {
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-xl);
    padding: 28px 18px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.cert-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.cert-svg-icon {
    width: 70px; height: 70px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-warm), var(--color-bg-pink));
    border-radius: var(--radius-lg);
    padding: 12px;
}

.cert-svg-icon svg {
    width: 100%;
    height: 100%;
}

.cert-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--color-text);
}

.cert-text {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 500;
}

/* ============================================================
   FUNNEL / CONSULTATION SECTION
   ============================================================ */
.funnel-section {
    background: linear-gradient(170deg, var(--color-bg-warm) 0%, #FFECD2 100%);
    position: relative;
}

.funnel-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.funnel-info {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.funnel-info-badge {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-text-white);
    border: none;
    border-radius: var(--radius-full);
    padding: 6px 18px;
    font-weight: 700;
    align-self: flex-start;
    margin-bottom: 20px;
    font-size: 0.9rem;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.3);
}

.funnel-info h2 {
    font-size: 2.2rem;
    line-height: 1.3;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 18px;
}

.funnel-info h2 span {
    color: var(--color-primary);
}

.funnel-info p {
    font-size: 1.05rem;
    color: var(--color-text-light);
    margin-bottom: 28px;
    line-height: 1.8;
}

.funnel-illustration {
    border: none;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    max-width: 95%;
    aspect-ratio: 16 / 9;
    max-height: 360px;
    background: #FFF7E6;
}

.funnel-illustration img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.funnel-form-card {
    flex: 0.9;
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    align-self: flex-start;
}

.form-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-text-white);
    border-bottom: none;
    padding: 28px 30px;
    text-align: center;
}

.form-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
}

.form-body {
    padding: 30px;
}

.consult-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text);
}

.form-group label i {
    color: var(--color-primary);
    font-size: 0.85rem;
}

.form-input {
    padding: 12px 18px;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-bg-cream);
    outline: none;
    font-weight: 500;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--color-primary);
    background: var(--color-bg-white);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-row {
    display: flex;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ============================================================
   COURSES SECTION
   ============================================================ */
.courses-section {
    background: linear-gradient(180deg, var(--color-bg-cream) 0%, var(--color-bg-warm) 100%);
    position: relative;
}

.filter-container {
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-xl);
    padding: 24px 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

.filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-label {
    min-width: 100px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 2px solid #E2E8F0;
    background: var(--color-bg-white);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-text-white);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.course-card {
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base);
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.course-header {
    padding: 24px 20px;
    color: var(--color-text);
    border-bottom: none;
    position: relative;
    font-weight: 700;
}

.header-grade-1 { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.header-grade-2 { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); }
.header-grade-3 { background: linear-gradient(135deg, #FCE7F3, #FBCFE8); }
.header-grade-4 { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.header-grade-5 { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: var(--color-text-white); }

.course-header-tag {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--color-text);
    font-size: 0.75rem;
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-weight: 700;
}

.course-header-icon {
    width: 46px; height: 46px;
    margin-bottom: 10px;
}

.course-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
}

.course-body {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.course-features li {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.course-features li i {
    color: var(--color-accent-teal);
    font-size: 1rem;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #F1F5F9;
    padding-top: 16px;
}

.course-price-box {
    display: flex;
    flex-direction: column;
}

.course-price-label {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-weight: 600;
}

.course-price-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary);
}

.course-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.course-detail-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-light);
}

.course-detail-link:hover {
    color: var(--color-primary);
}

.course-arrow-btn {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-text-white);
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
    transition: all var(--transition-fast);
}

.course-arrow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

.no-courses-message {
    grid-column: 1 / -1;
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-xl);
    padding: 50px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-light);
    box-shadow: var(--shadow-md);
}

/* ============================================================
   STEPS SECTION
   ============================================================ */
.steps-section {
    background: linear-gradient(180deg, var(--color-bg-mint) 0%, #ECFDF5 100%);
    position: relative;
}

.steps-circle-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 50px;
    position: relative;
}

.step-card {
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.step-card:hover .step-circle {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.step-circle-1 { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: var(--color-text-white); }
.step-circle-2 { background: linear-gradient(135deg, var(--color-accent-yellow), #F59E0B); color: var(--color-text); }
.step-circle-3 { background: linear-gradient(135deg, var(--color-secondary), #6D28D9); color: var(--color-text-white); }
.step-circle-4 { background: linear-gradient(135deg, var(--color-accent-teal), #14B8A6); color: var(--color-text-white); }

.step-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--color-text);
}

.step-desc {
    font-size: 0.88rem;
    color: var(--color-text-light);
    max-width: 90%;
    margin: 0 auto;
    font-weight: 500;
}

/* Connector line */
.steps-circle-row::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 12%;
    right: 12%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent-teal));
    z-index: 1;
    border-radius: var(--radius-full);
    opacity: 0.3;
}

/* Classroom modes */
.classroom-modes-box {
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    overflow: hidden;
}

.modes-sidebar {
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
    border-right: none;
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modes-sidebar-text {
    writing-mode: vertical-rl;
    text-transform: uppercase;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-text-white);
    letter-spacing: 4px;
    transform: rotate(180deg);
}

.modes-content {
    flex: 1;
    padding: 40px;
}

.modes-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 28px;
    color: var(--color-primary);
    text-align: center;
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.mode-item {
    background: linear-gradient(135deg, var(--color-bg-cream), var(--color-bg-warm));
    border: none;
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.mode-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.mode-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.mode-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--color-text);
}

.mode-desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.modes-action-row {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* ============================================================
   TEACHERS SECTION
   ============================================================ */
.teachers-section {
    background: linear-gradient(180deg, var(--color-bg-lavender) 0%, var(--color-bg-pink) 100%);
    position: relative;
}

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

.teacher-card {
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-2xl);
    padding: 40px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.teacher-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.teacher-avatar-circle {
    width: 120px; height: 120px;
    border-radius: 50%;
    border: 3px solid var(--color-primary);
    overflow: hidden;
    margin: 0 auto 20px;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.2);
    transition: all var(--transition-base);
}

.teacher-card:hover .teacher-avatar-circle {
    border-color: var(--color-secondary);
    box-shadow: 0 4px 25px rgba(124, 58, 237, 0.25);
}

.teacher-avatar-circle img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.teacher-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--color-text);
}

.teacher-desc-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 18px;
}

.teacher-bubble {
    background: linear-gradient(135deg, var(--color-bg-cream), var(--color-bg-warm));
    border: none;
    border-radius: var(--radius-lg);
    padding: 16px;
    font-size: 0.88rem;
    position: relative;
    font-weight: 500;
    color: var(--color-text-light);
    font-style: italic;
}

.teacher-bubble::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--color-bg-cream);
}

.teacher-bubble::after {
    display: none;
}

/* ============================================================
   ACHIEVEMENTS SECTION
   ============================================================ */
.achievements-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 50%, #C2410C 100%);
    overflow: hidden;
    position: relative;
}

/* Decorative floating math symbols */
.math-watermark {
    position: absolute;
    color: rgba(255, 255, 255, 0.08);
    font-weight: 800;
    pointer-events: none;
}
.wm-1 { top: 10%; left: 8%; font-size: 5rem; }
.wm-2 { top: 25%; right: 10%; font-size: 7rem; }
.wm-3 { bottom: 15%; left: 12%; font-size: 6rem; }
.wm-4 { bottom: 20%; right: 15%; font-size: 5rem; }
.wm-5 { top: 50%; left: 45%; font-size: 6rem; }

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

.achieve-card {
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-2xl);
    padding: 36px 24px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: all var(--transition-base);
}

.achieve-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.achieve-crown {
    position: absolute;
    top: 16px; right: 20px;
    font-size: 1.6rem;
}

.achieve-avatar-wrapper {
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 3px solid var(--color-accent-yellow);
    margin: 0 auto 18px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.achieve-avatar-wrapper img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.achieve-student-name {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--color-text);
}

.achieve-student-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 14px;
    font-weight: 600;
}

.achieve-student-prize {
    background: linear-gradient(135deg, var(--color-accent-yellow), #F59E0B);
    border: none;
    border-radius: var(--radius-full);
    padding: 6px 18px;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-block;
    color: var(--color-text);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

/* ============================================================
   TESTIMONIALS SECTION
   ============================================================ */
.testimonials-section {
    background: linear-gradient(180deg, var(--color-bg-pink) 0%, var(--color-bg-cream) 100%);
    position: relative;
}

.testimonials-row {
    display: flex;
    gap: 40px;
    align-items: center;
}

.testimonials-graphic {
    flex: 0.8;
    border: none;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.testimonials-content {
    flex: 1.2;
}

.reviews-slider {
    position: relative;
    min-height: 250px;
}

.review-slide {
    display: none;
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.review-slide.active {
    display: block;
    animation: slideInUp 0.5s ease-out;
}

.review-bubble-text {
    font-size: 1.05rem;
    font-style: italic;
    font-weight: 500;
    line-height: 1.8;
    margin-bottom: 24px;
    color: var(--color-text);
    position: relative;
}

.review-bubble-text::before {
    content: '"';
    font-size: 4rem;
    color: var(--color-primary);
    opacity: 0.2;
    position: absolute;
    top: -20px;
    left: -5px;
    font-family: Georgia, serif;
    line-height: 1;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid #F1F5F9;
    padding-top: 18px;
}

.review-avatar {
    width: 55px; height: 55px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    overflow: hidden;
}

.review-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.review-author-info h4 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text);
}

.review-author-info p {
    font-size: 0.82rem;
    color: var(--color-text-light);
    font-weight: 600;
}

.review-stars {
    margin-left: auto;
    color: var(--color-accent-yellow);
    font-size: 1rem;
}

.reviews-nav {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.review-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.12);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.review-dot.active {
    background: var(--color-primary);
    width: 28px;
    border-radius: var(--radius-full);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--color-bg-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 80px 0 24px;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--color-text-white);
    position: relative;
    display: inline-block;
}

.footer-col h3::after {
    content: '';
    display: block;
    width: 30px;
    height: 3px;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-full);
    margin-top: 8px;
}

.footer-about-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-logo-box {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--color-text-white);
    font-weight: 800;
}

.footer-logo-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-text-white);
}

.footer-col p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.7;
}

.footer-socials {
    display: flex;
    gap: 10px;
}

.footer-social-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
}

.footer-social-btn:hover {
    background: var(--color-primary);
    color: var(--color-text-white);
    transform: translateY(-2px);
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-primary);
    padding-left: 4px;
}

.footer-contact li {
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.footer-contact i {
    color: var(--color-primary);
    font-size: 1rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--color-bg-white);
    border: none;
    border-radius: var(--radius-2xl);
    padding: 48px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 36px; height: 36px;
    background: var(--color-bg-cream);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--color-text-light);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-primary);
    color: var(--color-text-white);
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 10px;
}

.modal-desc {
    margin-bottom: 24px;
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

.modal-btn {
    font-family: var(--font-primary);
}

/* ============================================================
   BACKGROUND UTILITY CLASSES (Legacy compat – now using gradients)
   ============================================================ */
.bg-grid-yellow-light,
.bg-dot-blue,
.bg-diary-orange,
.bg-dot-yellow,
.bg-notebook-lined,
.bg-dot-green,
.bg-achievements-red-grid,
.bg-dot-pink,
.bg-footer-grid {
    /* Override old animated background patterns - now handled by section-specific backgrounds */
    background-image: none !important;
    animation: none !important;
}

.bg-notebook-lined::before {
    display: none;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (min-width: 1025px) and (max-width: 1280px) {
    .nav-link {
        padding: 6px 10px;
        font-size: 0.92rem;
    }
    .nav-cta-btn {
        padding: 8px 18px;
        font-size: 0.84rem;
    }
    .nav-contact-link {
        padding: 6px 8px;
        font-size: 0.82rem;
    }
    .navbar {
        gap: 8px;
    }
    .logo-container {
        gap: 8px;
    }
    .logo-text {
        font-size: 1.3rem;
    }
    .logo-tagline {
        display: none;
    }
}

@media (max-width: 1024px) {
    .topbar {
        display: none;
    }

    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .section-padding {
        padding: 70px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .carousel-container {
        height: auto;
        min-height: 420px;
    }

    .carousel-slide {
        flex-direction: column-reverse;
        padding: 30px;
        text-align: center;
    }

    .slide-content {
        max-width: 100%;
        margin-top: 20px;
    }

    .slide-desc {
        max-width: 100%;
    }

    .slide-image-wrapper {
        width: 100%;
        max-height: 220px;
    }

    .carousel-nav {
        left: 50%;
        transform: translateX(-50%);
        bottom: 15px;
    }

    .carousel-arrow {
        display: none;
    }

    .funnel-container {
        flex-direction: column;
    }

    .funnel-illustration {
        max-width: 100%;
        margin-top: 20px;
    }

    .classroom-modes-box {
        flex-direction: column;
    }

    .modes-sidebar {
        width: 100%;
        height: 50px;
        border-right: none;
    }

    .modes-sidebar-text {
        writing-mode: horizontal-tb;
        transform: rotate(0deg);
        font-size: 1.1rem;
    }

    .modes-grid {
        grid-template-columns: 1fr;
    }

    .testimonials-row {
        flex-direction: column;
    }

    .testimonials-graphic {
        max-width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.7rem;
    }

    .section-padding {
        padding: 60px 0;
    }

    .slide-title {
        font-size: 1.8rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .steps-circle-row {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .steps-circle-row::before {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .cert-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .achieve-grid {
        grid-template-columns: 1fr;
    }

    .hero-banner {
        padding: 40px 0 80px;
    }

    .section-divider svg {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .slide-title {
        font-size: 1.5rem;
    }

    .carousel-slide {
        padding: 24px 20px;
    }

    .cert-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .cert-card {
        padding: 20px 12px;
    }

    .steps-circle-row {
        grid-template-columns: 1fr;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .filter-container {
        padding: 16px;
    }

    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ============================================================
   SCROLL REVEAL ANIMATION
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animations */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.4s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.5s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.6s; }
.reveal-stagger.visible > *:nth-child(n+7) { transition-delay: 0.6s; }

/* ============================================================
   DOCUMENTS PAGE — TÀI LIỆU
   ============================================================ */

/* ---- Hero ---- */
.docs-hero {
    background: linear-gradient(170deg, #FFFBEB 0%, #FFF3E0 50%, #FFE4C4 100%);
    padding: 70px 0 100px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.docs-hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 14px;
    line-height: 1.2;
}

.docs-hero-title span {
    color: var(--color-primary);
}

.docs-hero-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-light);
    max-width: 520px;
    margin: 0 auto 36px;
}

/* ---- Search Bar ---- */
.docs-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.docs-search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--color-bg-white);
    border-radius: var(--radius-full);
    padding: 14px 24px;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.docs-search-input-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.15);
}

.docs-search-input-wrapper i {
    color: var(--color-text-light);
    margin-right: 12px;
    font-size: 1rem;
}

.docs-search-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
}

.docs-search-input-wrapper input::placeholder {
    color: var(--color-text-light);
    font-weight: 400;
}

.docs-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(0, 0, 0, 0.08);
    background: var(--color-bg-white);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--color-text);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.docs-filter-btn:hover,
.docs-filter-btn.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(255, 107, 53, 0.04);
}

.docs-filter-btn i {
    font-size: 0.85rem;
}

/* ---- Filter Panel ---- */
.docs-filters {
    background: var(--color-bg-white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 24px 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.docs-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.docs-filter-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docs-filter-group select {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg-white);
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23718096'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.docs-filter-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ---- Document Listing ---- */
.docs-listing {
    padding: 50px 0 80px;
    background: var(--color-bg-white);
}

.docs-listing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 18px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.docs-listing-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-text);
}

.docs-listing-title span {
    color: var(--color-primary);
    font-weight: 700;
}

.docs-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.docs-sort label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-light);
    white-space: nowrap;
}

.docs-sort select {
    padding: 8px 14px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-bg-white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23718096'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* ---- Document Grid ---- */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* ---- Document Card ---- */
.doc-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.doc-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

/* ---- Card Preview Area ---- */
.doc-card-preview {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.doc-card:nth-child(8n+1) .doc-card-preview { background: linear-gradient(135deg, #FFF7ED, #FED7AA); }
.doc-card:nth-child(8n+2) .doc-card-preview { background: linear-gradient(135deg, #EFF6FF, #BFDBFE); }
.doc-card:nth-child(8n+3) .doc-card-preview { background: linear-gradient(135deg, #F0FFF4, #A7F3D0); }
.doc-card:nth-child(8n+4) .doc-card-preview { background: linear-gradient(135deg, #FDF4FF, #E9D5FF); }
.doc-card:nth-child(8n+5) .doc-card-preview { background: linear-gradient(135deg, #FFF1F2, #FECDD3); }
.doc-card:nth-child(8n+6) .doc-card-preview { background: linear-gradient(135deg, #ECFDF5, #BBF7D0); }
.doc-card:nth-child(8n+7) .doc-card-preview { background: linear-gradient(135deg, #FFFBEB, #FDE68A); }
.doc-card:nth-child(8n+8) .doc-card-preview { background: linear-gradient(135deg, #EFF6FF, #93C5FD); }

.doc-preview-icon {
    font-size: 3.5rem;
    color: rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
}

.doc-card:hover .doc-preview-icon {
    transform: scale(1.1) rotate(-3deg);
}

/* ---- Badges ---- */
.doc-badge {
    position: absolute;
    top: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    z-index: 2;
    letter-spacing: 0.3px;
}

.doc-badge-free {
    left: 12px;
    background: linear-gradient(135deg, #2DD4BF, #14B8A6);
    color: white;
}

.doc-badge-type {
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-primary);
    border: 1px solid rgba(255, 107, 53, 0.2);
    font-weight: 800;
}

/* ---- Card Body ---- */
.doc-card-body {
    padding: 18px 18px 0;
    flex: 1;
}

.doc-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.45;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.doc-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.doc-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.doc-card-meta span i {
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.25);
}

.doc-card-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 14px;
}

.doc-file-type {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.doc-file-type i {
    color: var(--color-primary);
    font-size: 0.75rem;
}

.doc-file-size {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-light);
}

/* ---- Card Footer ---- */
.doc-card-footer {
    padding: 0 18px 18px;
}

.doc-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-accent-yellow), #F59E0B);
    color: var(--color-text) !important;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.doc-view-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.4);
}

/* ---- Pagination ---- */
.docs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 50px;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
    background: var(--color-bg-white);
    border: 2px solid rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(255, 107, 53, 0.04);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-text-white) !important;
    border-color: var(--color-primary);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-dots {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-light);
    padding: 0 4px;
}

/* ---- Docs Page Responsive ---- */
@media (max-width: 1024px) {
    .docs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .docs-hero {
        padding: 50px 0 70px;
    }
    .docs-hero-title {
        font-size: 2rem;
    }
    .docs-search-bar {
        flex-direction: column;
    }
    .docs-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .docs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .docs-listing-header {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .docs-grid {
        grid-template-columns: 1fr;
    }
    .docs-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   AUTH MODAL (ĐĂNG NHẬP / ĐĂNG KÝ)
   ============================================================ */
.auth-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    width: 500px; /* Tăng chiều rộng để giao diện đăng ký 2 cột thoáng hơn */
    max-width: 94vw;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.18);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0 32px 28px;
}

.auth-modal-overlay.active .auth-modal {
    transform: scale(1) translateY(0);
}

/* ---- Close Button ---- */
.auth-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text-light);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
    line-height: 1;
}

.auth-modal-close:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--color-primary);
}

/* ---- Header / Logo ---- */
.auth-modal-header {
    text-align: center;
    padding: 28px 0 8px;
    position: relative;
}

.auth-modal-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-modal-logo-box {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.auth-modal-logo span {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
}

.auth-modal-logo span strong {
    color: var(--color-primary);
    font-weight: 800;
}

/* ---- Tab Switcher ---- */
.auth-tabs {
    display: flex;
    position: relative;
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-full);
    padding: 4px;
    margin: 20px 0 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: var(--font-primary);
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: color 0.3s ease;
    position: relative;
    z-index: 2;
}

.auth-tab.active {
    color: var(--color-primary);
}

.auth-tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: white;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

/* ---- Form ---- */
.auth-form {
    animation: authFadeIn 0.3s ease;
}

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

@media (max-width: 540px) {
    .auth-row {
        grid-template-columns: 1fr;
    }
}

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

.auth-input-group {
    margin-bottom: 16px;
}

.auth-input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}

.auth-input-group label i {
    color: var(--color-primary);
    margin-right: 5px;
    font-size: 0.78rem;
    opacity: 0.7;
}

.auth-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--color-text);
    transition: all 0.2s ease;
    background: var(--color-bg-white);
    box-sizing: border-box;
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.auth-input-group input::placeholder {
    color: #C4C4C4;
    font-weight: 400;
}

/* ---- Password Toggle ---- */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper input {
    padding-right: 46px;
}

.auth-toggle-pw {
    position: absolute;
    right: 4px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-toggle-pw:hover {
    color: var(--color-primary);
}

/* ---- Options Row ---- */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
}

.auth-checkbox input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.auth-forgot {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: opacity 0.2s;
}

.auth-forgot:hover {
    opacity: 0.8;
}

/* ---- Submit Button ---- */
.auth-submit-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
    transition: all 0.2s ease;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.auth-submit-register {
    background: linear-gradient(135deg, var(--color-secondary), #6D28D9);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.auth-submit-register:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

/* ---- Divider ---- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 16px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
}

.auth-divider span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-light);
    white-space: nowrap;
}

/* ---- Social Login ---- */
.auth-socials {
    display: flex;
    gap: 10px;
}

.auth-social-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(0, 0, 0, 0.06);
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-social-btn:hover {
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.auth-social-google i { color: #EA4335; }
.auth-social-facebook i { color: #1877F2; }
.auth-social-zalo i { color: #0068FF; }

/* ---- Auth Modal Responsive ---- */
@media (max-width: 480px) {
    .auth-modal {
        padding: 0 20px 24px;
        border-radius: var(--radius-lg);
    }
    .auth-socials {
        flex-direction: column;
    }
}

/* ============================================================
   EXAMS PAGE — THI THỬ ĐỊNH KỲ
   ============================================================ */

/* ---- Hero ---- */
.exam-hero {
    background: linear-gradient(170deg, #FFFBEB 0%, #FFF3E0 50%, #FFE4C4 100%);
    padding: 70px 0 110px;
    position: relative;
    overflow: hidden;
}

/* ---- Stats ---- */
.exam-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 40px auto 0;
    position: relative;
    z-index: 2;
}

.exam-stat-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.exam-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.exam-stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.exam-stat-card .stat-info {
    text-align: left;
}

.exam-stat-card .stat-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: 2px;
}

.exam-stat-card .stat-info p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin: 0;
}

/* ---- Search & Controls ---- */
.exam-controls-section {
    padding: 100px 0 20px;
    background-color: var(--color-bg-white);
}

.exam-search-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.exam-search-wrapper {
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
    background: #F8FAFC;
    border-radius: var(--radius-full);
    padding: 6px 6px 6px 24px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.exam-search-wrapper.focused {
    background: var(--color-bg-white);
    border-color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.1);
}

.exam-search-wrapper .search-icon {
    color: var(--color-text-light);
    margin-right: 12px;
    font-size: 1.1rem;
}

.exam-search-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
}

.btn-search-submit {
    background: linear-gradient(135deg, #FF6B35, #E55A28);
    color: white;
    border: none;
    outline: none;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.25);
    transition: all 0.2s ease;
}

.btn-search-submit:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
}

.btn-room-code {
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: white;
    border: none;
    outline: none;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-room-code:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(124, 58, 237, 0.35);
}

/* Filters labels and pills */
.grade-filter-container, .type-filter-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text);
    min-width: 100px;
}

.grade-pills-wrapper, .type-pills-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.grade-pill, .type-pill {
    background: #F1F5F9;
    border: none;
    outline: none;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.grade-pill:hover, .type-pill:hover {
    background: #E2E8F0;
    color: var(--color-text);
}

.grade-pill.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.25);
}

.type-pill.active {
    background: var(--color-secondary);
    color: white;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.25);
}

/* ---- Listing Section ---- */
.exam-listing-section {
    padding: 60px 0 160px;
    background: linear-gradient(180deg, var(--color-bg-white) 0%, #F5F3FF 100%);
    position: relative;
    overflow: hidden;
}

.exam-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 16px;
}

.exam-listing-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-text);
    margin: 0;
}

.exam-listing-header h2 span {
    color: var(--color-primary);
}

.exam-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-sort label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.exam-sort select {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    background: white;
}

/* Exam Grid */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 28px;
    margin-bottom: 50px;
}

/* Exam Card */
.exam-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-top: 5px solid transparent;
}

.exam-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

/* Specific colors by Grade */
.exam-card[data-grade="1"] { border-top-color: #FBBF24; }
.exam-card[data-grade="2"] { border-top-color: #60A5FA; }
.exam-card[data-grade="3"] { border-top-color: #FF8FAB; }
.exam-card[data-grade="4"] { border-top-color: #2DD4BF; }
.exam-card[data-grade="5"] { border-top-color: #FF6B35; }

.exam-card-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-grade {
    background: rgba(255, 255, 255, 0.8);
    color: var(--color-text);
}

.badge-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-active {
    background: #DCFCE7;
    color: #15803D;
}

.badge-upcoming {
    background: #F3E8FF;
    color: #6D28D9;
}

.badge-practice {
    background: #E0F2FE;
    color: #0369A1;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #16A34A;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

.exam-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.exam-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.4;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.exam-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
    font-weight: 600;
}

.exam-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.exam-card-meta i {
    color: var(--color-primary-light);
}

.exam-card-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--color-text-light);
    border-top: 1px dashed rgba(0,0,0,0.08);
    padding-top: 12px;
    margin-bottom: 12px;
    font-weight: 600;
}

.exam-card-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.exam-date {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin: 0;
    font-weight: 500;
}

.exam-card-footer {
    padding: 16px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.btn-card-action {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.btn-card-active {
    background: linear-gradient(135deg, #FF6B35, #FF8F5E);
    color: white;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.2);
}

.btn-card-active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-card-disabled {
    background: #E2E8F0;
    color: #94A3B8;
    cursor: not-allowed;
}

.btn-card-practice {
    background: linear-gradient(135deg, #2DD4BF, #14B8A6);
    color: white;
    box-shadow: 0 3px 8px rgba(45, 212, 191, 0.2);
}

.btn-card-practice:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
}

.exam-detail-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
}

.exam-detail-link:hover {
    text-decoration: underline;
}

.no-exams-message {
    text-align: center;
    padding: 50px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ---- Leaderboard Section ---- */
.exam-leaderboard-section {
    padding: 80px 0 100px;
    background: linear-gradient(180deg, #FFF0F3 0%, #FFFBEB 100%);
    position: relative;
    overflow: hidden;
}

/* Podium Layout */
.leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 24px;
    max-width: 720px;
    margin: 50px auto 30px;
    padding-bottom: 20px;
}

.podium-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.podium-avatar-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--color-text-light);
    box-shadow: var(--shadow-md);
    border: 4px solid;
    transition: all 0.3s ease;
}

.medal-icon {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: white;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.medal-gold {
    background: linear-gradient(135deg, #FBBF24, #D97706);
    animation: float 4s ease-in-out infinite;
}

.medal-silver {
    background: linear-gradient(135deg, #CBD5E1, #64748B);
    animation: floatReverse 4.5s ease-in-out infinite;
}

.medal-bronze {
    background: linear-gradient(135deg, #ED8936, #C05621);
    animation: float 4.2s ease-in-out infinite;
}

.podium-user-info h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 2px;
}

.podium-user-info .grade-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.podium-step {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.rank-num {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--color-text-light);
    margin-bottom: 8px;
    line-height: 1;
}

.podium-score {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.podium-time {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 500;
}

/* Height adjustments by rank */
.rank-1 .podium-step {
    height: 180px;
    background: linear-gradient(180deg, #FEF3C7 0%, #FFFFFF 100%);
}
.rank-1 .podium-avatar {
    width: 96px;
    height: 96px;
    font-size: 2.6rem;
}
.rank-1 .rank-num {
    color: #D97706;
    font-size: 2.8rem;
}

.rank-2 .podium-step {
    height: 140px;
    background: linear-gradient(180deg, #F1F5F9 0%, #FFFFFF 100%);
}
.rank-2 .rank-num {
    color: #475569;
}

.rank-3 .podium-step {
    height: 120px;
    background: linear-gradient(180deg, #FFF7ED 0%, #FFFFFF 100%);
}
.rank-3 .rank-num {
    color: #C2410C;
}

/* Leaderboard List Table */
.leaderboard-table-container {
    max-width: 720px;
    margin: 20px auto 0;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    background-color: #F8FAFC;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text-light);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.leaderboard-table td {
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.table-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-light);
}

.leaderboard-table .user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
}

.leaderboard-table .user-cell i {
    color: #94A3B8;
}

.leaderboard-table .score-cell {
    color: var(--color-primary);
    font-weight: 700;
}

/* ---- Steps Section ---- */
.exam-steps-section {
    padding: 80px 0 100px;
    background: linear-gradient(180deg, #F0FFF4 0%, #FFFFFF 100%);
    position: relative;
    overflow: hidden;
}

.exam-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    max-width: 1000px;
    margin: 50px auto 0;
}

.exam-step-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    box-shadow: var(--shadow-md);
    position: relative;
    transition: all 0.3s ease;
}

.exam-step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.step-num-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.2);
}

.step-icon-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.exam-step-card h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
}

.exam-step-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin: 0;
    font-weight: 500;
}

/* Responsive fixes for Exam page */
@media (max-width: 768px) {
    .exam-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .leaderboard-podium {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    .podium-col {
        width: 100%;
        max-width: 280px;
    }
    .podium-step {
        border-radius: var(--radius-lg);
        height: auto !important;
        padding: 16px;
    }
    .rank-1 .podium-avatar {
        width: 80px;
        height: 80px;
        font-size: 2.2rem;
    }
    .rank-1 .rank-num {
        font-size: 2.2rem;
    }
    .exam-listing-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .exam-search-bar-row {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-room-code {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .exam-stats-grid {
        grid-template-columns: 1fr;
    }
    .exam-steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   DASHBOARD PAGES — TRANG TỔNG QUAN HỌC TẬP (BÉ AN)
   ============================================================ */

/* ---- Reset & Canvas ---- */
.db-body {
    background-color: #F0F9FF; /* Soft sky blue for child-friendliness */
    background-image: radial-gradient(circle at 15% 20%, rgba(254, 243, 199, 0.45) 0%, transparent 45%),
                      radial-gradient(circle at 85% 75%, rgba(253, 244, 255, 0.55) 0%, transparent 45%);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-primary);
    position: relative;
    overflow-x: hidden;
}

/* Playful math background decorations */
.db-bg-decors {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.db-decor-symbol {
    position: absolute;
    font-family: var(--font-primary);
    font-size: 3rem;
    font-weight: 900;
    opacity: 0.06;
    user-select: none;
    animation: dbFloatSlow 10s ease-in-out infinite alternate;
}

@keyframes dbFloatSlow {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(15deg); }
}

.db-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- Dashboard Header ---- */
.db-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 75px;
    background-color: var(--color-bg-white);
    border-bottom: 2px solid #F1F5F9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.db-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.db-sidebar-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 2px solid #E2E8F0;
    background: transparent;
    color: var(--color-text-light);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.db-sidebar-toggle:hover {
    color: var(--color-primary);
    border-color: var(--color-primary-light);
    background-color: var(--color-bg-sky);
    transform: scale(1.05);
}

.db-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.db-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.db-logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 900;
    background: linear-gradient(135deg, #3B82F6, #6366F1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
    white-space: nowrap;
    display: inline-block;
}

.db-logo-text strong {
    background: linear-gradient(135deg, #FF6B35, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Course Selector Pill */
.db-header-center {
    flex: 1;
    max-width: 420px;
    margin: 0 32px;
}

.db-course-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #EFF6FF;
    border: 2px solid #BFDBFE;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    color: #1E40AF;
    font-weight: 700;
    font-size: 0.92rem;
}

.db-course-selector select {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-primary);
    font-weight: 700;
    color: #1E40AF;
    width: 100%;
    cursor: pointer;
}

.db-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.db-header-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #E2E8F0;
    background: white;
    color: var(--color-text-light);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.db-header-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
}

.db-notif-btn .db-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #EF4444;
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Coins Display */
.db-coin-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
    border: 2px solid #FDE68A;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    color: #D97706;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}

.db-coin-display i {
    font-size: 1.1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* User Menu Account Dropdown */
.db-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 6px;
    background-color: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.db-user-menu:hover {
    background-color: #F1F5F9;
    border-color: #CBD5E1;
}

.db-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.db-user-info {
    display: flex;
    flex-direction: column;
}

.db-user-greeting {
    font-size: 0.72rem;
    color: var(--color-text-light);
    font-weight: 600;
    line-height: 1.1;
}

.db-user-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.2;
}

.db-user-arrow {
    font-size: 0.75rem;
    color: var(--color-text-light);
    transition: transform 0.2s ease;
}

.db-user-menu:hover .db-user-arrow {
    transform: translateY(1px);
}

/* Dropdown Menu */
.db-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1010;
}

.db-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.db-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    transition: all 0.15s ease;
}

.db-dropdown-item:hover {
    background-color: var(--color-bg-sky);
    color: var(--color-primary);
}

.db-dropdown-divider {
    height: 1px;
    background-color: #F1F5F9;
    margin: 6px 0;
}

.db-logout-link:hover {
    background-color: #FEF2F2;
    color: #EF4444;
}

/* ---- Layout Sidebar + Main ---- */
.db-layout {
    display: flex;
    margin-top: 75px;
    min-height: calc(100vh - 75px);
}

/* Sidebar styling */
.db-sidebar {
    width: 250px;
    background-color: white;
    border-right: 2px solid #F1F5F9;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 0;
    position: fixed;
    top: 75px;
    bottom: 0;
    left: 0;
    z-index: 990;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden; /* Prevent horizontal scrollbars */
}

.db-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scrollbars */
}

.db-sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    margin: 0 14px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.db-sidebar-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.db-sidebar-item:hover {
    background-color: var(--color-bg-sky);
    color: var(--color-text);
}

.db-sidebar-item:hover .db-sidebar-icon {
    transform: scale(1.1) rotate(-3deg);
}

.db-sidebar-item.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white !important;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.db-sidebar-item.active .db-sidebar-icon {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.db-sidebar-divider {
    height: 2px;
    background-color: #F1F5F9;
    margin: 14px 20px;
}

.db-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Sidebar Collapsed State */
.db-sidebar.collapsed {
    width: 80px;
}

.db-sidebar.collapsed .db-sidebar-text {
    display: none; /* Completely remove from flex calculation when collapsed */
}

.db-sidebar.collapsed .db-sidebar-divider {
    margin: 14px 15px;
}

.db-sidebar.collapsed .db-sidebar-item {
    justify-content: center;
    padding: 10px 0;
    margin: 0 10px;
    gap: 0; /* Remove gap so only icon is centered */
}

/* Tooltip for collapsed sidebar items */
@media (min-width: 769px) {
    .db-sidebar.collapsed .db-sidebar-item:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 70px;
        top: 50%;
        transform: translateY(-50%);
        background-color: var(--color-bg-dark);
        color: white;
        padding: 6px 12px;
        border-radius: var(--radius-sm);
        font-size: 0.8rem;
        font-weight: 600;
        z-index: 1005;
        white-space: nowrap;
        box-shadow: var(--shadow-md);
        animation: fadeIn 0.15s ease-out;
    }
}

/* Main Area styling */
.db-main {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
    background-color: transparent;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: calc(100vh - 75px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.db-main.sidebar-collapsed {
    margin-left: 80px;
}

/* ---- Welcome Greeting Row ---- */
.db-welcome-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.db-welcome-text h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-text);
}

.db-welcome-text h2 span {
    color: var(--color-primary);
}

.db-welcome-text p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-weight: 600;
}

.db-welcome-date {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 2px solid #E2E8F0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text-light);
    box-shadow: var(--shadow-sm);
}

.db-welcome-date i {
    color: var(--color-primary);
}

/* ---- Grid Layouts for Widget Cards ---- */
.db-grid-row {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.db-3-cols {
    grid-template-columns: repeat(3, 1fr);
}

.db-2-cols-unequal {
    grid-template-columns: 1.2fr 0.8fr;
}

/* Card Widget Component */
.db-card {
    background-color: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 2px solid #F1F5F9;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.db-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(255, 107, 53, 0.1);
}

.db-card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-card-title i {
    font-size: 1.15rem;
}

/* ---- Card 1: Progress Rings ---- */
.db-progress-rings {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.db-ring-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.db-ring-svg-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 8px;
}

.db-ring-svg {
    width: 100%;
    height: 100%;
}

.db-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.15rem;
    font-weight: 850;
    color: var(--color-text);
}

.db-ring-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text-light);
}

.db-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.db-stat-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background-color: #F8FAFC;
    border-radius: var(--radius-md);
    border: 1px solid #F1F5F9;
}

.db-stat-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.db-stat-detail {
    display: flex;
    flex-direction: column;
}

.db-stat-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--color-text-light);
    letter-spacing: 0.3px;
}

.db-stat-value {
    font-size: 0.88rem;
    font-weight: 850;
    color: var(--color-text);
}

/* ---- Card 2: Radar Chart (Spider) ---- */
.db-radar-container {
    position: relative;
    width: 210px;
    height: 210px;
    margin: 0 auto 10px;
}

.db-radar-svg {
    width: 100%;
    height: 100%;
}

.db-radar-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.db-radar-label {
    position: absolute;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--color-text);
    white-space: nowrap;
}

.db-radar-label.label-top {
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.db-radar-label.label-top-right {
    top: 26%;
    right: -10px;
}

.db-radar-label.label-bottom-right {
    bottom: 26%;
    right: -10px;
}

.db-radar-label.label-bottom {
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.db-radar-label.label-bottom-left {
    bottom: 26%;
    left: -10px;
}

.db-radar-label.label-top-left {
    top: 26%;
    left: -10px;
}

/* ---- Card 2: Next Study Step ---- */
.db-next-step-content {
    min-height: 210px;
    display: flex;
    align-items: stretch;
}

.db-next-step-empty,
.db-next-step-summary {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #F5F3FF 0%, #EFF6FF 100%);
    border: 2px solid #EDE9FE;
}

.db-next-step-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    background-color: white;
    box-shadow: var(--shadow-sm);
    font-size: 1.25rem;
}

.db-next-step-empty h4,
.db-next-step-summary h4 {
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.35;
    color: var(--color-text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.db-next-step-empty p,
.db-next-step-summary p {
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.55;
    color: var(--color-text-light);
}

.db-next-step-badge {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background-color: white;
    color: var(--color-secondary);
    font-weight: 850;
    font-size: 0.82rem;
    box-shadow: var(--shadow-sm);
}

.db-next-step-bar-wrap {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.db-next-step-bar {
    height: 100%;
    min-width: 0;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent-blue));
}

.db-next-step-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background-color: var(--color-secondary);
    color: white;
    font-weight: 850;
    font-size: 0.88rem;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.18);
}

.db-next-step-btn:hover {
    background-color: #6D28D9;
    transform: translateY(-1px);
}

/* ---- Card 3: Activity Feed ---- */
.db-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.db-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #F1F5F9;
}

.db-activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.db-activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.db-activity-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.db-activity-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.3;
}

.db-activity-desc {
    font-size: 0.72rem;
    color: var(--color-text-light);
    font-weight: 600;
    margin-top: 1px;
}

.db-activity-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    background-color: #F1F5F9;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* ---- Card 4: Learning List ---- */
.db-learning-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.db-learning-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.db-learning-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.db-learning-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-learning-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 850;
    color: white;
}

.db-learning-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text);
}

.db-learning-pct {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--color-text-light);
}

.db-learning-bar-wrap {
    width: 100%;
    height: 10px;
    background-color: #F1F5F9;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.db-learning-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease-in-out;
}

/* ---- Card 5: Class Leaderboard ---- */
.db-rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.db-rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background-color: #F8FAFC;
    border: 2px solid transparent;
}

.db-rank-pos {
    font-size: 1rem;
    font-weight: 850;
    width: 22px;
    text-align: center;
}

.db-rank-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.db-rank-name-box {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.db-rank-name {
    font-size: 0.85rem;
    font-weight: 750;
    color: var(--color-text);
}

.db-rank-level {
    font-size: 0.68rem;
    color: var(--color-text-light);
    font-weight: 600;
}

.db-rank-score {
    font-size: 0.85rem;
    font-weight: 850;
    color: var(--color-primary);
}

/* Podiums styling within small leaderboard list */
.db-rank-gold {
    background-color: #FFFDF5;
    border-color: #FDE68A;
}

.db-rank-silver {
    background-color: #F8FAFC;
    border-color: #E2E8F0;
}

.db-rank-bronze {
    background-color: #FFF7ED;
    border-color: #FED7AA;
}

.db-rank-current {
    background-color: #FFF5F2;
    border-color: var(--color-primary-light);
}

.db-rank-current .db-rank-score {
    color: var(--color-primary);
}

.db-exam-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.db-exam-summary > div {
    padding: 12px;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-sky);
    border: 1px solid #DBEAFE;
}

.db-exam-summary-label {
    display: block;
    margin-bottom: 4px;
    color: var(--color-text-light);
    font-size: 0.72rem;
    font-weight: 800;
}

.db-exam-summary strong {
    display: block;
    color: var(--color-text);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.2;
}

/* ---- Motivation Banner ---- */
.db-motivation-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #FFF5F5 0%, #FFF0F3 100%);
    border: 2px dashed var(--color-accent-pink);
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.db-motivation-emoji {
    font-size: 2.8rem;
    animation: wiggle 2.5s infinite;
}

.db-motivation-text {
    flex: 1;
}

.db-motivation-text h4 {
    font-size: 1.05rem;
    font-weight: 850;
    color: var(--color-text);
    margin-bottom: 2px;
}

.db-motivation-text p {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.db-motivation-stars {
    font-size: 1.15rem;
    color: var(--color-accent-yellow);
    letter-spacing: 2px;
    animation: starPulse 1.8s infinite alternate;
}

@keyframes starPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.05); opacity: 1; }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(8deg); }
    75% { transform: rotate(-8deg); }
}

/* ---- Card 6: Weekly Bar Chart ---- */
.db-chart-card h3 span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.db-barchart {
    display: grid;
    grid-template-columns: 40px 1fr;
    height: 180px;
    margin-top: 15px;
}

.db-barchart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-light);
    height: calc(100% - 25px);
    text-align: right;
    padding-right: 10px;
}

.db-barchart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    border-left: 2px solid #E2E8F0;
    border-bottom: 2px solid #E2E8F0;
    height: calc(100% - 25px);
    padding: 0 10px;
}

.db-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 50px;
    position: relative;
}

.db-bar-wrapper {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.db-bar {
    width: 24px;
    background: linear-gradient(180deg, var(--color-accent-teal) 0%, #14B8A6 100%);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.db-bar:hover {
    transform: scaleX(1.1);
    filter: brightness(1.05);
}

/* Tooltip for Bars */
.db-bar-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: var(--color-bg-dark);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.db-bar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--color-bg-dark);
}

.db-bar:hover .db-bar-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.db-bar-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-light);
    margin-top: 6px;
    position: absolute;
    top: 100%;
}

/* ---- Dashboard Footer ---- */
.db-footer {
    border-top: 2px solid #EDF2F7;
    padding: 24px 0;
    margin-top: 40px;
    text-align: center;
}

.db-footer p {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
}


/* ============================================================
   RESPONSIVE DESIGN FOR DASHBOARD
   ============================================================ */
@media (max-width: 1024px) {
    .db-3-cols {
        grid-template-columns: 1fr 1fr;
    }
    .db-card.db-activity-card {
        grid-column: span 2;
    }
    .db-header-center {
        margin: 0 16px;
    }
}

@media (max-width: 768px) {
    /* Header modifications */
    .db-header {
        padding: 0 12px;
    }
    .db-header-center {
        display: none; /* Hide course selector on mobile headers */
    }
    
    /* Layout shifts */
    .db-sidebar {
        width: 80px; /* Force collapse on tablet/mobile */
    }
    .db-sidebar .db-sidebar-text {
        display: none;
    }
    .db-sidebar .db-sidebar-divider {
        margin: 14px 15px;
    }
    .db-sidebar .db-sidebar-item {
        justify-content: center;
        padding: 10px 0;
        margin: 0 10px;
    }
    
    .db-main {
        margin-left: 80px;
        padding: 16px;
    }
    .db-main.sidebar-collapsed {
        margin-left: 80px; /* Keep same on mobile */
    }
    
    /* Grid system collapses */
    .db-3-cols {
        grid-template-columns: 1fr;
    }
    .db-card.db-activity-card {
        grid-column: span 1;
    }
    
    .db-2-cols-unequal {
        grid-template-columns: 1fr;
    }
    
    .db-welcome-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .db-sidebar {
        display: none; /* Hide sidebar completely on very small screens, or toggles overlay */
    }
    .db-sidebar.active-mobile {
        display: flex;
        width: 240px;
        position: fixed;
        left: 0;
        top: 75px;
        bottom: 0;
        box-shadow: var(--shadow-xl);
    }
    .db-sidebar.active-mobile .db-sidebar-text {
        display: inline;
        opacity: 1;
        visibility: visible;
        width: auto;
    }
    .db-sidebar.active-mobile .db-sidebar-item {
        justify-content: flex-start;
        padding: 10px 18px;
        margin: 0 14px;
    }
    
    .db-main {
        margin-left: 0 !important;
        padding: 12px;
    }
    
    .db-progress-rings {
        flex-direction: column;
        gap: 20px;
    }
    
    .db-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .db-welcome-text h2 {
        font-size: 1.4rem;
    }
    
    .db-motivation-banner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

/* Mascot details & styles */
.db-motivation-mascot {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: white;
    border: 3px solid var(--color-accent-pink);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: wiggle 3s infinite;
}

.db-motivation-mascot img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

/* ============================================================
   MY COURSES PAGE — KHÓA HỌC CỦA CON
   ============================================================ */

/* Controls (Filter + Search) */
.db-courses-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.db-course-status-wrapper {
    position: relative;
}

.db-course-status-select {
    background-color: #FEF3C7;
    border: 2.5px solid #FDE68A;
    border-radius: var(--radius-full);
    padding: 8px 18px;
    font-family: var(--font-primary);
    font-weight: 850;
    color: #D97706;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23D97706'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.db-course-status-select:hover {
    background-color: #FDF4D4;
    border-color: #FBBF24;
}

.db-course-search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 2.5px solid #E2E8F0;
    border-radius: var(--radius-full);
    padding: 3px 3px 3px 16px;
    box-shadow: var(--shadow-sm);
    width: 280px;
    transition: all 0.3s ease;
}

.db-course-search-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.1);
}

.db-course-search-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--color-text);
    background: transparent;
}

.db-course-search-btn {
    background-color: #B45309; /* Deep child-themed amber/brown */
    border: none;
    outline: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.db-course-search-btn:hover {
    background-color: var(--color-primary-dark);
    transform: scale(1.05);
}

/* Courses Card & Grid */
.db-courses-list-card {
    margin-top: 12px;
}

.db-courses-list-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #7C2D12;
    margin-bottom: 24px;
    border-bottom: 2.5px dashed #FED7AA;
    padding-bottom: 12px;
}

.db-my-courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.db-dashboard-exam-grid,
.db-dashboard-wrong-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.db-dashboard-exam-card,
.db-dashboard-wrong-card,
.db-dashboard-history-card {
    background: #FFFFFF;
    border: 2px solid #F1F5F9;
    border-bottom-width: 6px;
    border-radius: var(--radius-xl);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.db-dashboard-exam-card h4,
.db-dashboard-wrong-card h4,
.db-dashboard-history-card h4 {
    margin: 10px 0;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 850;
}

.db-dashboard-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 850;
}

.db-dashboard-status.ready {
    background: #ECFDF5;
    color: #15803D;
}

.db-dashboard-status.progress {
    background: #FFF7ED;
    color: #C2410C;
}

.db-dashboard-status.waiting {
    background: #FFFBEB;
    color: #A16207;
}

.db-dashboard-status.done {
    background: #EFF6FF;
    color: #1D4ED8;
}

.db-dashboard-exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.db-dashboard-exam-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-radius: var(--radius-full);
    background: #F8FAFC;
    color: var(--color-text-light);
    font-size: 0.78rem;
    font-weight: 800;
}

.db-dashboard-exam-meta i {
    color: var(--color-primary);
}

.db-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.db-dashboard-retry-btn {
    border: none;
    border-radius: var(--radius-full);
    padding: 10px 16px;
    background: #FFF7ED;
    color: var(--color-primary);
    font-weight: 850;
    cursor: pointer;
}

.db-dashboard-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 680px;
    overflow: auto;
}

.db-dashboard-history-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.db-dashboard-history-card p,
.db-dashboard-wrong-card p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.85rem;
    font-weight: 700;
}

.db-dashboard-history-score {
    min-width: 86px;
    text-align: right;
}

.db-dashboard-history-score strong,
.db-dashboard-wrong-card strong {
    display: block;
    color: var(--color-primary);
    font-weight: 900;
}

.db-dashboard-history-score a {
    display: inline-flex;
    margin-top: 6px;
    color: var(--color-accent-blue);
    font-size: 0.8rem;
    font-weight: 850;
}

.db-dashboard-wrong-card span {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    background: #FFF7ED;
    color: #C2410C;
    font-size: 0.76rem;
    font-weight: 850;
}

.db-dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 260px;
    padding: 34px;
    border: 3px dashed #E2E8F0;
    border-radius: var(--radius-xl);
    background: #F8FAFC;
    text-align: center;
}

.db-dashboard-empty i {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: #FFF7ED;
    color: var(--color-primary);
    font-size: 2rem;
}

.db-dashboard-empty h4 {
    margin: 0;
    color: var(--color-text);
    font-size: 1.25rem;
    font-weight: 900;
}

.db-dashboard-empty p {
    max-width: 440px;
    margin: 0;
    color: var(--color-text-light);
    line-height: 1.6;
    font-weight: 700;
}

.db-progress-course-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.db-progress-course-card {
    padding: 18px;
    border: 2px solid #F1F5F9;
    border-bottom-width: 6px;
    border-radius: var(--radius-xl);
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.db-progress-course-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.db-progress-course-head h4 {
    margin: 10px 0 6px;
    color: var(--color-text);
    font-size: 1.15rem;
    font-weight: 900;
}

.db-progress-course-head p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-weight: 750;
}

.db-progress-line {
    height: 13px;
    margin: 16px 0;
    border-radius: var(--radius-full);
    background: #FFE4D6;
    overflow: hidden;
}

.db-progress-line span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent-yellow));
}

.db-progress-current {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
}

.db-progress-current i {
    color: var(--color-primary);
    margin-top: 3px;
}

.db-progress-current strong,
.db-progress-exam-item strong,
.db-progress-timeline-item strong {
    display: block;
    color: var(--color-text);
    font-weight: 900;
}

.db-progress-current span,
.db-progress-exam-item span,
.db-progress-timeline-item p,
.db-progress-timeline-item small {
    color: var(--color-text-light);
    font-size: 0.82rem;
    font-weight: 750;
}

.db-progress-exam-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.db-progress-exam-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: #FFF7ED;
}

.db-progress-exam-item a {
    color: var(--color-primary);
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
}

.db-progress-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.db-progress-timeline-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
}

.db-progress-dot {
    width: 15px;
    height: 15px;
    margin-top: 4px;
    border-radius: var(--radius-full);
    background: var(--color-accent-yellow);
    box-shadow: 0 0 0 5px #FEF3C7;
    flex-shrink: 0;
}

.db-progress-dot.done {
    background: var(--color-accent-teal);
    box-shadow: 0 0 0 5px #CCFBF1;
}

@media (max-width: 640px) {
    .db-progress-course-head,
    .db-progress-exam-item {
        flex-direction: column;
        align-items: stretch;
    }
}

.db-profile-summary-card {
    align-self: start;
}

.db-profile-avatar-large {
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 4px solid #FFE4D6;
    border-bottom-width: 7px;
    border-radius: 28px;
    background: #FFF7ED;
    color: var(--color-primary);
    font-size: 2.6rem;
    font-weight: 900;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.db-profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.db-profile-summary-card h3 {
    margin: 10px 0 0;
    color: var(--color-text);
    font-size: 1.45rem;
    font-weight: 900;
}

.db-profile-summary-card p {
    margin: 6px 0 0;
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.db-profile-summary-wide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.db-profile-summary-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.db-profile-summary-text {
    min-width: 0;
}

.db-profile-quick-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    text-align: left;
}

.db-profile-quick-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid #EEF2F7;
    border-radius: 16px;
    background: #F8FAFC;
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 850;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.db-profile-quick-list-inline {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 0;
}

.db-profile-quick-list-inline a {
    min-width: 156px;
}

.db-profile-quick-list a:hover {
    transform: translateY(-2px);
    border-color: #FED7AA;
    background: #FFF7ED;
}

.db-profile-quick-list i {
    color: var(--color-primary);
}

.db-profile-panels {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.db-profile-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.db-profile-panel,
.db-profile-danger-panel {
    padding: 32px;
}

.db-profile-section-header {
    display: block;
    padding: 0 0 18px;
    margin: 0 0 6px;
    background: transparent;
    border-bottom: 2px solid #F1F5F9;
}

.db-profile-panel h2,
.db-profile-danger-panel h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 1.35rem;
    font-weight: 900;
}

.db-profile-panel header p,
.db-profile-danger-panel header p {
    margin-top: 6px;
    color: var(--color-text-light);
    font-weight: 750;
    line-height: 1.7;
    background: transparent;
}

.db-profile-panel form label,
.db-profile-danger-panel form label {
    color: var(--color-text);
    font-weight: 900;
}

.db-profile-panel form,
.db-profile-danger-panel form {
    background: transparent;
}

.db-profile-panel input[type="text"],
.db-profile-panel input[type="email"],
.db-profile-panel input[type="password"],
.db-profile-panel textarea,
.db-profile-danger-panel input[type="password"] {
    width: 100%;
    border: 2px solid #E2E8F0;
    border-radius: 18px;
    background: #F8FAFC;
    color: var(--color-text);
    font-weight: 750;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.db-profile-panel input[type="text"]:focus,
.db-profile-panel input[type="email"]:focus,
.db-profile-panel input[type="password"]:focus,
.db-profile-panel textarea:focus,
.db-profile-danger-panel input[type="password"]:focus {
    border-color: var(--color-primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.13);
}

.db-profile-danger-panel {
    border-color: #FECACA;
    background: linear-gradient(180deg, #FFF7F7 0%, #FEF2F2 100%);
    color: #B91C1C;
}

.db-profile-error {
    margin: 8px 0 0;
    color: #DC2626;
    font-size: 0.85rem;
    font-weight: 900;
}

.db-profile-danger-panel {
    background: #FEF2F2;
}

@media (max-width: 900px) {
    .db-profile-summary-wide {
        align-items: flex-start;
        flex-direction: column;
    }

    .db-profile-quick-list-inline {
        justify-content: flex-start;
    }

    .db-profile-form-grid {
        grid-template-columns: 1fr;
    }

    .db-profile-panel,
    .db-profile-danger-panel {
        padding: 24px;
    }
}

.db-my-course-card {
    background: white;
    border: 2.5px solid #FED7AA;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-sm);
    z-index: 1;
}

.db-my-course-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-card-hover);
}

.db-my-course-banner {
    height: 155px;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid #F1F5F9;
    background-color: #FFF7ED;
}

.db-my-course-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.db-my-course-card:hover .db-my-course-banner img {
    transform: scale(1.04);
}

.db-my-course-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.db-my-course-title {
    font-size: 1.05rem;
    font-weight: 850;
    color: var(--color-text);
    margin-bottom: 12px;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.db-my-course-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-light);
    margin-bottom: 6px;
}

.db-my-course-pct {
    color: var(--color-primary);
    font-weight: 850;
    font-size: 0.9rem;
}

.db-my-course-bar-wrap {
    width: 100%;
    height: 12px;
    background-color: #F1F5F9;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1.5px solid #E2E8F0;
    margin-bottom: 16px;
}

.db-my-course-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
}

.db-my-course-lesson {
    display: flex;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text-light);
    margin-bottom: 14px;
    min-height: 2.8em;
    line-height: 1.4;
    align-items: flex-start;
}

.db-my-course-lesson i {
    color: var(--color-accent-teal);
    font-size: 0.95rem;
    margin-top: 2px;
    flex-shrink: 0;
    animation: bounce 2.5s infinite;
}

.db-my-course-expire {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 18px;
    border-top: 1px dashed #E2E8F0;
    padding-top: 10px;
}

.db-my-course-footer {
    margin-top: auto;
}

/* Green 3D Study button (kid-friendly) */
.db-course-study-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #8AE336;
    border: 3px solid #6BAA27;
    border-bottom-width: 6px;
    color: white !important;
    border-radius: 16px;
    font-weight: 850;
    font-size: 1.05rem;
    padding: 10px;
    text-shadow: 0 1.5px 2px rgba(0,0,0,0.15);
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
    transition: all 0.1s ease;
    cursor: pointer;
}

.db-course-study-btn:hover {
    background-color: #97F141;
    transform: translateY(1px);
    border-bottom-width: 4px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.db-course-study-btn:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Responsive for Courses List */
@media (max-width: 1024px) {
    .db-my-courses-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .db-courses-controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }
    .db-course-search-wrapper {
        width: 100%;
    }
    .db-my-courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ============================================================
   INTERACTIVE STUDY PAGE – hoc-tap.html
   Upgraded Premium Playful 3D & Kid-friendly Aesthetics
   Resolves overflow, border sticking, and tab squishing bugs
   ============================================================ */

.learn-body {
    background-color: #FFF9E6; /* Sweet cream yellow background */
    font-family: var(--font-primary);
    color: var(--color-text);
    overflow: hidden; /* Prevent body scroll, layout uses absolute sizing */
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background floating math shapes and colors */
.learn-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 5% 15%, rgba(255, 107, 53, 0.04) 0%, transparent 25%),
        radial-gradient(circle at 85% 25%, rgba(124, 58, 237, 0.04) 0%, transparent 30%),
        radial-gradient(circle at 45% 85%, rgba(45, 212, 191, 0.05) 0%, transparent 35%);
    z-index: -2;
    pointer-events: none;
}

/* Learn Header - Chunky Kid Style */
.learn-header {
    background-color: #FFF8D6;
    border-bottom: 6px solid #E9D084;
    padding: 12px 24px;
    height: 76px; /* Fixed height for calculations */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 6px 16px rgba(233, 208, 132, 0.12);
}

.learn-header-left {
    display: flex;
    align-items: center;
}

/* Back Button 3D Green */
.learn-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #8AE336;
    border: 3px solid #6BAA27;
    border-bottom-width: 7px;
    color: white !important;
    font-weight: 800;
    font-size: 0.94rem;
    padding: 8px 20px;
    border-radius: 999px; /* Rounded pill */
    text-shadow: none;
    box-shadow: 0 5px 0 rgba(77, 124, 15, 0.25), 0 8px 15px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.learn-back-btn:hover {
    background-color: #97F141;
    transform: translateY(1px);
    border-bottom-width: 6px;
    box-shadow: 0 4px 0 rgba(77, 124, 15, 0.25), 0 6px 12px rgba(0, 0, 0, 0.06);
}

.learn-back-btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
    box-shadow: 0 1px 0 rgba(77, 124, 15, 0.25), 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Header Title Banner 3D Orange */
.learn-header-title-box {
    background-color: var(--color-primary);
    border: 3.5px solid #E55A28;
    border-bottom-width: 6.5px;
    border-radius: 30px;
    padding: 8px 28px;
    color: white;
    font-weight: 800;
    font-size: 1.05rem;
    text-align: center;
    margin-left: 20px;
    text-shadow: none;
    box-shadow: 0 5px 0 rgba(194, 65, 12, 0.25), 0 8px 20px rgba(255, 107, 53, 0.15);
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.learn-header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Badge 3D White */
.learn-header-badge {
    background-color: white;
    border: 3px solid #CBD5E1;
    border-bottom-width: 5.5px;
    border-radius: 24px;
    padding: 6px 16px;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 0 rgba(203, 213, 225, 0.25), 0 6px 12px rgba(0,0,0,0.03);
}

.learn-header-badge i.fa-coins {
    color: #FBBF24;
    font-size: 1.25rem;
    animation: wiggle 2s infinite ease-in-out;
}

.learn-header-badge i.fa-fire {
    color: #EF4444;
    font-size: 1.25rem;
    animation: bounce 1.5s infinite ease-in-out;
}

/* User Greeting Pill */
.learn-user-greeting {
    background-color: white;
    border: 3px solid #CBD5E1;
    border-bottom-width: 5.5px;
    border-radius: 24px;
    padding: 5px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--color-text);
    box-shadow: 0 4px 0 rgba(203, 213, 225, 0.25), 0 6px 12px rgba(0,0,0,0.03);
}

.learn-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(124, 58, 237, 0.12);
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 2px solid var(--color-secondary-light);
}

/* Learn Layout - Separated Floating Cards with gap */
.learn-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding: 20px 24px 24px 24px; /* Space all around so cards don't stick to screen edges */
    gap: 24px; /* Space between Main Area and Sidebar */
    box-sizing: border-box;
}

/* Learn Main Content Panel - Standalone 3D Card */
.learn-main {
    flex: 1;
    background-color: white;
    border: 4.5px solid #F3E09D;
    border-bottom-width: 9.5px;
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(229, 213, 164, 0.15);
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent scrolling the entire card, keep player fixed */
    position: relative;
}

.learn-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-shrink: 0; /* Never shrink the title row */
}

.learn-title-row h2 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--color-text);
    position: relative;
    padding-left: 18px;
    line-height: 1.35;
}

.learn-title-row h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    width: 8px;
    height: 80%;
    background-color: var(--color-primary);
    border-radius: 99px;
}

/* Practice Button 3D Coral */
.learn-practice-btn {
    background-color: #FF6B35;
    border: 3px solid #E55A28;
    border-bottom-width: 7px;
    color: white !important;
    font-weight: 800;
    font-size: 0.96rem;
    padding: 10px 24px;
    border-radius: 999px;
    text-shadow: none;
    box-shadow: 0 5px 0 rgba(194, 65, 12, 0.25), 0 8px 16px rgba(255, 107, 53, 0.1);
    cursor: pointer;
    transition: all 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.learn-practice-btn:hover {
    background-color: #FF8F5E;
    transform: translateY(1px);
    border-bottom-width: 6px;
    box-shadow: 0 4px 0 rgba(194, 65, 12, 0.25), 0 6px 12px rgba(255, 107, 53, 0.1);
}

.learn-practice-btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
    box-shadow: 0 1px 0 rgba(194, 65, 12, 0.25), 0 2px 4px rgba(255, 107, 53, 0.1);
}

/* Viewport for media/quiz content - Autofits inside the parent flex container without overflow */
.learn-viewport-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 60px; /* Generous space for navigation arrows */
    min-height: 0; /* CRITICAL: Allows flexbox child to shrink smaller than content */
    overflow: hidden; /* Avoid any overflow leakage */
}

/* Toy Tablet Style Wrapper - Auto-scaling with aspect ratio */
.learn-media-wrap {
    width: 100%;
    height: 100%;
    max-height: 100%; /* Constraints to prevent screen overflow */
    max-width: 100%;
    background-color: white;
    border: 10px solid #FBBF24; /* Yellow frame */
    border-bottom-width: 18px; /* Extra thick 3D bottom border */
    border-radius: 36px;
    box-shadow: 0 15px 35px rgba(217, 119, 6, 0.12);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9; /* Keep video ratio */
    display: flex;
    flex-direction: column;
    flex-shrink: 1; /* Allow shrinking if space is low */
}

/* Video Player container */
.learn-video-player {
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
    border-radius: 26px; /* Smooth inside corners */
}

.learn-video-player iframe,
.learn-video-player video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Document content view */
.learn-doc-viewer {
    width: 100%;
    height: 100%;
    background-color: #FFFDF9;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.learn-doc-card {
    background-color: white;
    border: 3px solid #F3E8C6;
    border-bottom-width: 7px;
    border-radius: 24px;
    padding: 24px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.02);
}

.learn-doc-card h3 {
    color: var(--color-primary);
    font-size: 1.45rem;
    font-weight: 900;
    margin-bottom: 12px;
    text-align: center;
}

.learn-doc-card p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--color-text);
    margin-bottom: 14px;
}

.learn-doc-illustration {
    background-color: #FFFBEB;
    border: 3px dashed #F59E0B;
    border-radius: 20px;
    padding: 16px;
    margin: 18px 0;
    text-align: center;
}

.learn-doc-illustration img {
    max-height: 180px;
    margin: 0 auto 10px;
    border-radius: 12px;
}

.learn-doc-illustration span {
    font-size: 0.9rem;
    font-weight: 800;
    color: #D97706;
}

/* Quiz Box container */
.learn-quiz-box {
    width: 100%;
    height: 100%;
    background-color: #FFFDF9;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.learn-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px dashed #EADBB6;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.learn-quiz-qnum {
    background-color: #7C3AED;
    border: 2.5px solid #5B21B6;
    border-bottom-width: 4.5px;
    color: white;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 14px;
    box-shadow: 0 3px 0 rgba(91, 33, 182, 0.2);
}

.learn-quiz-score {
    color: #B45309;
    font-weight: 850;
    font-size: 0.9rem;
}

.learn-quiz-question {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--color-text);
    margin-bottom: 18px;
    line-height: 1.5;
}

.learn-quiz-image-wrap {
    text-align: center;
    margin-bottom: 18px;
}

.learn-quiz-image {
    max-height: 130px;
    margin: 0 auto;
    border-radius: 16px;
    border: 4px solid #E2E8F0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.03);
}

.learn-quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

/* Interactive chunky 3D quiz options */
.learn-quiz-option {
    background-color: white;
    border: 3px solid #E2E8F0;
    border-bottom-width: 7px;
    border-radius: 20px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-text);
    transition: all 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.learn-quiz-option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #F1F5F9;
    border: 2px solid #CBD5E1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    color: #64748B;
    transition: all 0.1s ease;
}

/* Distinct pastel styles for options */
.learn-quiz-option:nth-child(1) { border-color: #93C5FD; border-bottom-color: #3B82F6; }
.learn-quiz-option:nth-child(1) .learn-quiz-option-letter { background-color: #EFF6FF; border-color: #93C5FD; color: #1D4ED8; }

.learn-quiz-option:nth-child(2) { border-color: #FBCFE8; border-bottom-color: #EC4899; }
.learn-quiz-option:nth-child(2) .learn-quiz-option-letter { background-color: #FDF2F8; border-color: #FBCFE8; color: #BE185D; }

.learn-quiz-option:nth-child(3) { border-color: #99F6E4; border-bottom-color: #0D9488; }
.learn-quiz-option:nth-child(3) .learn-quiz-option-letter { background-color: #F0FDFA; border-color: #99F6E4; color: #0F766E; }

.learn-quiz-option:nth-child(4) { border-color: #FDE68A; border-bottom-color: #D97706; }
.learn-quiz-option:nth-child(4) .learn-quiz-option-letter { background-color: #FEF3C7; border-color: #FDE68A; color: #B45309; }

.learn-quiz-option:hover {
    transform: translateY(-3px);
    border-bottom-width: 10px;
    filter: brightness(1.02);
}

.learn-quiz-option.selected {
    background-color: #FFF7ED !important;
    border-color: #F97316 !important;
    border-bottom-width: 4px !important;
    transform: translateY(3px) !important;
    box-shadow: none !important;
    color: #EA580C;
}

.learn-quiz-option.selected .learn-quiz-option-letter {
    background-color: #FFEDD5 !important;
    border-color: #F97316 !important;
    color: #EA580C !important;
}

.learn-quiz-actions {
    display: flex;
    justify-content: center;
}

/* Quiz submit button 3D Green */
.learn-quiz-submit-btn {
    background-color: #8AE336;
    border: 3px solid #6BAA27;
    border-bottom-width: 7px;
    color: white !important;
    font-weight: 900;
    font-size: 1.1rem;
    padding: 10px 32px;
    border-radius: 999px;
    text-shadow: 0 1.5px 2px rgba(0,0,0,0.15);
    box-shadow: 0 5px 0 rgba(77, 124, 15, 0.25), 0 8px 16px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.1s ease;
}

.learn-quiz-submit-btn:hover {
    background-color: #97F141;
    transform: translateY(1px);
    border-bottom-width: 6px;
}

.learn-quiz-submit-btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
}

/* Feedback Overlay Popup */
.learn-feedback-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.learn-feedback-mascot {
    width: 120px;
    height: 120px;
    margin-bottom: 16px;
    animation: bounce 1.2s infinite ease-in-out;
}

.learn-feedback-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.learn-feedback-title.correct { color: #16A34A; }
.learn-feedback-title.incorrect { color: #DC2626; }

.learn-feedback-desc {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-text-light);
    margin-bottom: 24px;
    max-width: 465px;
    line-height: 1.55;
}

.learn-feedback-btn {
    background-color: #7C3AED;
    border: 3px solid #6D28D9;
    border-bottom-width: 7px;
    color: white !important;
    font-weight: 900;
    font-size: 1.05rem;
    padding: 10px 30px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(109, 40, 217, 0.25);
    transition: all 0.1s ease;
}

.learn-feedback-btn:hover {
    background-color: #8B5CF6;
    border-bottom-width: 6px;
    transform: translateY(1px);
}

.learn-feedback-btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
}

/* Nav arrows 3D Yellow */
.learn-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    border: 4px solid #FBBF24;
    border-bottom-width: 7.5px;
    color: #D97706;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(217, 119, 6, 0.2), 0 8px 20px rgba(0,0,0,0.06);
    transition: all 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
}

.learn-nav-arrow:hover {
    background-color: #FEF3C7;
    transform: translateY(-50%) translateY(-2px);
    border-bottom-width: 9px;
}

.learn-nav-arrow:active {
    transform: translateY(-50%) translateY(4px);
    border-bottom-width: 2px;
}

.learn-nav-arrow.arrow-prev { left: 4px; }
.learn-nav-arrow.arrow-next { right: 4px; }

/* Learn Sidebar - Standalone 3D Card */
.learn-sidebar {
    width: 350px;
    flex-shrink: 0; /* Prevent sidebar from shrinking on desktop screens */
    background-color: #FFFBF0;
    border: 4.5px solid #F3E09D;
    border-bottom-width: 9.5px;
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(229, 213, 164, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Crop internal contents */
    z-index: 80;
}

/* 3 Folder Tabs (Thụt lề hai bên rộng hơn để tránh bị bo tròn của sidebar cắt góc) */
.learn-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 24px 0 24px; /* Increased padding from 12px to 24px to pull tabs away from sidebar's 28px border-radius */
    background-color: #FFF8DF;
    border-bottom: 5px solid #E5D5A4;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    overflow: visible; /* Ensure active tab overlapping works */
}

.learn-tab-btn {
    flex: 1;
    border: 3px solid #CBD5E1;
    border-bottom: none;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 8px 2px 6px; /* Compact padding to fit within the new 24px sidebar padding */
    font-weight: 700;
    font-size: 0.82rem; /* Adjusted font size for perfect fit without overflow */
    line-height: 1.25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    position: relative;
    top: 5px; /* Sits slightly lower when inactive */
    box-sizing: border-box;
}

/* Folder Colors (Inactive States) */
.learn-tab-btn[data-tab="lessons"] {
    background-color: #FEF3C7;
    border-color: #F59E0B;
    color: #92400E;
}

.learn-tab-btn[data-tab="exams"] {
    background-color: #DBEAFE;
    border-color: #3B82F6;
    color: #1E40AF;
}

.learn-tab-btn[data-tab="docs"] {
    background-color: #FEE2E2;
    border-color: #EF4444;
    color: #991B1B;
}

.learn-tab-btn:hover {
    top: 1px;
    padding-bottom: 10px;
}

/* Tab Active State (Covering container bottom border) */
.learn-tab-btn.active {
    top: 0px; /* Stands taller */
    z-index: 10; /* Make sure active tab sits on top of others and border */
    margin-bottom: -5px; /* Overlap exactly with .learn-tabs bottom border */
    padding-bottom: 11px; /* Compensate for the vertical overlap */
    background-color: white !important; /* Uniform active white background */
    box-shadow: 0 -3px 8px rgba(0,0,0,0.03);
    border-bottom: none !important; /* Remove bottom border to make it open folder style */
}

/* Pseudo-element to cover the gold border-bottom of the container and create a seamless transition */
.learn-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px; /* Sit right over the container's 5px border-bottom */
    left: -3px; /* Stretch to cover left border at the base */
    right: -3px; /* Stretch to cover right border at the base */
    height: 6px;
    background-color: white; /* Same white background as active tab */
    z-index: 15; /* High z-index to sit on top of everything at the container border level */
    border-radius: 0;
}

.learn-tab-btn[data-tab="lessons"].active {
    border-top-color: #F59E0B !important;
    border-left-color: #F59E0B !important;
    border-right-color: #F59E0B !important;
    border-bottom-color: transparent !important;
    color: #92400E !important;
}

.learn-tab-btn[data-tab="exams"].active {
    border-top-color: #3B82F6 !important;
    border-left-color: #3B82F6 !important;
    border-right-color: #3B82F6 !important;
    border-bottom-color: transparent !important;
    color: #1E40AF !important;
}

.learn-tab-btn[data-tab="docs"].active {
    border-top-color: #EF4444 !important;
    border-left-color: #EF4444 !important;
    border-right-color: #EF4444 !important;
    border-bottom-color: transparent !important;
    color: #991B1B !important;
}

.learn-tab-btn i {
    font-size: 1.15rem;
}

/* Scrollable Inner Pane */
.learn-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.learn-pane {
    display: none;
}

.learn-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* Accordion Chapter 3D Green */
.learn-accordion-item {
    margin-bottom: 12px;
    border-radius: 20px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border: 3px solid #E2E8F0;
    transition: border-color 0.2s ease;
}

.learn-accordion-item.active {
    border-color: #84CC16;
}

.learn-accordion-header {
    background-color: #76C51A;
    border-bottom: 4px solid #4D8E0B;
    color: white;
    padding: 11px 14px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.45;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    text-shadow: none;
    transition: background-color 0.2s ease;
}

.learn-accordion-header:hover {
    background-color: #72B612;
}

.learn-accordion-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.learn-accordion-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    border: 1px solid rgba(255,255,255,0.4);
    flex: 0 0 auto;
}

.learn-accordion-arrow {
    transition: transform 0.25s ease;
    font-size: 0.95rem;
}

.learn-accordion-item.open .learn-accordion-arrow {
    transform: rotate(180deg);
}

.learn-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #FAF9F3; /* Cream inside background */
}

.learn-accordion-item.open .learn-accordion-body {
    max-height: 900px;
}

/* Sub-chapters */
.learn-subchapter {
    padding: 10px 12px;
    border-bottom: 2px dashed #E2DCCF;
}

.learn-subchapter-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: #4D7C0F;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    background-color: #ECFDF5;
    border-bottom: 2.5px solid #A7F3D0;
}

/* Lessons Card style items */
.learn-lesson-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 2px;
}

.learn-lesson-item {
    padding: 8px 12px;
    background-color: white;
    border: 2px solid #E2E8F0;
    border-bottom-width: 4.5px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.84rem;
    line-height: 1.35;
    color: var(--color-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.learn-lesson-item:hover {
    background-color: #FFFDF9;
    border-color: #FCD34D;
    transform: translateX(4px);
}

.learn-lesson-item.active {
    background-color: #FFF7ED;
    border-color: #F97316;
    border-bottom-color: #C2410C;
    border-width: 2px;
    border-bottom-width: 5px;
    color: #C2410C;
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.08);
}

/* Custom Play Icon mimicking YouTube logo */
.learn-lesson-icon.video {
    background-color: #EF4444;
    color: white;
    width: 28px;
    height: 18px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    box-shadow: 0 2px 0 #991B1B, 0 3px 6px rgba(239, 68, 68, 0.15);
    flex-shrink: 0;
}

/* Custom Doc Icon pink folder */
.learn-lesson-icon.doc {
    background-color: #EC4899;
    color: white;
    width: 24px;
    height: 18px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 0 #9D174D, 0 3px 6px rgba(236, 72, 153, 0.15);
    flex-shrink: 0;
}

/* Exam Pane items */
.learn-exam-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.learn-exam-item {
    background-color: white;
    border: 2.5px solid #E2E8F0;
    border-bottom-width: 5px;
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.02);
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.learn-exam-item:hover {
    border-color: #3B82F6;
    transform: translateY(-3px);
    border-bottom-width: 7px;
}

.learn-exam-title {
    font-weight: 900;
    font-size: 0.95rem;
    color: #1E3A8A;
    margin-bottom: 6px;
}

.learn-exam-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--color-text-light);
}

.learn-exam-meta span i {
    margin-right: 4px;
    color: #60A5FA;
}

/* Document Pane items */
.learn-doc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.learn-doc-item {
    background-color: white;
    border: 2.5px solid #FCA5A5;
    border-bottom-width: 5px;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 900;
    font-size: 0.85rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.02);
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.learn-doc-item:hover {
    background-color: #FFFDFD;
    transform: translateY(-2px);
    border-bottom-width: 7px;
}

.learn-doc-item i {
    color: #EF4444;
    font-size: 1.15rem;
}

/* Confetti animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #FBBF24;
    border-radius: 50%;
    top: -10px;
    z-index: 12;
    animation: confettiFall 2.5s infinite linear;
}

@keyframes confettiFall {
    0% {
        top: -10px;
        transform: translateX(0) rotate(0deg);
    }
    100% {
        top: 100%;
        transform: translateX(100px) rotate(360deg);
    }
}

/* Responsive learn layout */
@media (max-width: 992px) {
    .learn-layout {
        flex-direction: column-reverse;
        overflow-y: auto;
        height: auto;
    }
    .learn-body {
        overflow-y: auto;
        height: auto;
    }
    .learn-sidebar {
        width: 100%;
        height: 480px;
        border-left: none;
        border-top: 6px solid #F3E09D;
    }
    .learn-main {
        overflow-y: visible;
        padding: 18px;
    }
    .learn-viewport-container {
        padding: 0 40px;
    }
}

@media (max-width: 576px) {
    .learn-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    .learn-header-title-box {
        margin-left: 0;
        font-size: 1rem;
        padding: 6px 18px;
    }
    .learn-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .learn-practice-btn {
        width: 100%;
        justify-content: center;
    }
    .learn-quiz-options {
        grid-template-columns: 1fr;
    }
    .learn-viewport-container {
        padding: 0 10px;
    }
    .learn-nav-arrow {
        display: none; /* Hide arrows on mobile */
    }
}

/* Progress Study Page - Standalone 3D Card Board */
.progress-title-row {
    margin-bottom: 24px;
}

.progress-page-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #92400E;
    position: relative;
    padding-left: 18px;
}

.progress-page-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    width: 8px;
    height: 70%;
    background-color: #F59E0B;
    border-radius: 99px;
}

.progress-board-card {
    background-color: white;
    border: 5px solid #FF8E3C; /* Thick 3D orange border */
    border-bottom-width: 10px;
    border-radius: 28px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(229, 213, 164, 0.15);
    min-height: 480px;
}

/* Gemstone decorations at 4 corners */
.progress-gem {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15), inset 0 -3px 0 rgba(0,0,0,0.2);
    border: 2px solid white;
}

.progress-gem i {
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.gem-tl {
    top: -12px;
    left: -12px;
    background-color: #EF4444; /* Ruby Red */
}

.gem-tr {
    top: -12px;
    right: -12px;
    background-color: #3B82F6; /* Sapphire Blue */
}

.gem-bl {
    bottom: -12px;
    left: -12px;
    background-color: #10B981; /* Emerald Green */
}

.gem-br {
    bottom: -12px;
    right: -12px;
    background-color: #F59E0B; /* Topaz Yellow */
}

.progress-board-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

/* Dropdown Course Filter styling */
.progress-select-filter {
    background-color: #FFFBEB;
    border: 3.5px solid #F59E0B;
    border-bottom-width: 7.5px;
    border-radius: 18px;
    padding: 10px 20px;
    font-weight: 900;
    font-size: 0.95rem;
    color: #92400E;
    outline: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.1);
    transition: transform 0.1s ease;
}

.progress-select-filter:active {
    transform: translateY(2px);
    border-bottom-width: 5.5px;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Progress History Cards */
.progress-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    border: 3.5px solid #A3E635; /* Playful Lime green borders */
    border-bottom-width: 7.5px;
    border-radius: 24px;
    padding: 18px 24px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.01);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.progress-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: #84CC16;
    border-bottom-width: 9.5px;
    box-shadow: 0 8px 16px rgba(132, 204, 22, 0.12);
}

.progress-card-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.progress-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #FFEDD5;
    border: 3px solid #F97316;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EA580C;
    font-size: 1.4rem;
    box-shadow: inset 0 -3.5px 0 rgba(249, 115, 22, 0.2);
}

.progress-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-card-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: #166534; /* Dark green text */
}

.progress-card-badge {
    font-size: 0.8rem;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 99px;
    width: fit-content;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.05);
}

.progress-card-badge.perfect {
    background-color: #DCFCE7;
    color: #166534;
    border: 1.5px solid #86EFAC;
}

.progress-card-badge.wrong {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1.5px solid #FCA5A5;
}

.progress-card-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.progress-card-time {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #475569;
}

.progress-card-time i {
    color: #EF4444; /* Playful Alarm Clock Red */
    font-size: 1.4rem;
    animation: pulse 2s infinite;
}

.progress-time-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.progress-date {
    font-size: 0.85rem;
    font-weight: 900;
    color: #334155;
}

.progress-hours {
    font-size: 0.8rem;
    color: #64748B;
}

.progress-status-badge {
    font-size: 0.85rem;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: 99px;
    text-align: center;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.05);
}

.progress-status-badge.pending {
    background-color: #F1F5F9;
    color: #475569;
    border: 2px solid #CBD5E1;
}

.progress-status-badge.submitted {
    background-color: #E0F2FE;
    color: #0369A1;
    border: 2px solid #7DD3FC;
}

/* Responsive adjustment for study progress */
@media (max-width: 768px) {
    .progress-board-card {
        padding: 18px;
    }
    .progress-gem {
        display: none; /* Hide gemstone pins on small screens */
    }
    .progress-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .progress-card-right {
        width: 100%;
        justify-content: space-between;
        border-top: 1.5px dashed #E2E8F0;
        padding-top: 12px;
    }
}

/* ==========================================================================
   Learn Practice Workspace & Wide Quiz Layout
   ========================================================================== */
.learn-practice-workspace {
    position: relative;
    flex: 1;
    display: none; /* Toggled via JS */
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.learn-practice-workspace .learn-quiz-box {
    width: 100%;
    height: 100%;
    background-color: #FFFDF9;
    border: 5px solid #FBBF24; /* Yellow frame matching study tablet style */
    border-bottom-width: 12px; /* Extra thick 3D bottom border */
    border-radius: 32px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 12px 30px rgba(217, 119, 6, 0.08);
}

/* Close Button (Red 3D Button) */
.learn-quiz-close-btn {
    background-color: #EF4444;
    border: 3px solid #B91C1C; /* Dark red border */
    border-bottom-width: 6px;
    color: white !important;
    font-weight: 900;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.1s ease;
    box-shadow: 0 4px 0 rgba(185, 28, 28, 0.25);
    text-shadow: 0 1.5px 1.5px rgba(0,0,0,0.15);
}

.learn-quiz-close-btn:hover {
    background-color: #F87171;
    transform: translateY(1px);
    border-bottom-width: 5px;
}

.learn-quiz-close-btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
    box-shadow: none;
}

/* Wide Options Grid for Practice Workspace */
.learn-practice-workspace .learn-quiz-options {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 15px;
    margin-bottom: 24px;
}

.learn-practice-workspace .learn-quiz-option {
    padding: 16px 22px;
    font-size: 1.1rem;
    border-radius: 22px;
}

/* Wide Question Style */
.learn-practice-workspace .learn-quiz-question {
    font-size: 1.35rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Wide Image Style */
.learn-practice-workspace .learn-quiz-image {
    max-height: 200px;
}

/* Feedback popup styling in wide workspace */
.learn-practice-workspace .learn-feedback-popup {
    border-radius: 28px;
    background-color: #FFFDF9;
    border: 5px solid #FBBF24;
    border-bottom-width: 12px;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   COURSE DETAIL PAGE — TRANG GIỚI THIỆU KHÓA HỌC
   ========================================================================== */

/* ---- Hero Section ---- */
.cd-page {
    background-color: #FFFBF5;
}

.cd-page .hidden,
.cd-popup.hidden,
.cd-hero-section .hidden {
    display: none !important;
}

.cd-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.92);
    border-bottom: 2px solid #F1F5F9;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.cd-topbar-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cd-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text);
}

.cd-brand-logo {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background-color: white;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.cd-brand-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.cd-brand strong,
.cd-brand small {
    display: block;
    line-height: 1.1;
    font-weight: 900;
}

.cd-brand strong {
    font-size: 1.05rem;
}

.cd-brand small {
    color: var(--color-primary);
    font-size: 0.82rem;
}

.cd-topnav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cd-topnav a {
    padding: 9px 14px;
    border-radius: var(--radius-full);
    color: var(--color-text-light);
    font-weight: 800;
    font-size: 0.92rem;
}

.cd-topnav a:hover {
    color: var(--color-primary);
    background-color: var(--color-bg-coral);
}

.cd-topnav .cd-topnav-cta {
    color: white;
    background-color: var(--color-primary);
    box-shadow: var(--shadow-color);
}

.cd-topnav .cd-topnav-cta:hover {
    color: white;
    background-color: var(--color-primary-dark);
}

.cd-popup {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: rgba(15, 23, 42, 0.58);
}

.cd-popup-card {
    width: min(420px, 100%);
    padding: 34px;
    border-radius: 28px;
    background-color: white;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.cd-popup-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16A34A;
    background-color: #DCFCE7;
    font-size: 2.8rem;
}

.cd-popup-card h3 {
    margin-bottom: 10px;
    color: var(--color-text);
    font-size: 1.45rem;
    font-weight: 900;
}

.cd-popup-card p {
    margin-bottom: 22px;
    color: var(--color-text-light);
    font-weight: 650;
    line-height: 1.6;
}

.cd-popup-btn {
    width: 100%;
    justify-content: center;
}

.cd-hero-section {
    padding: 80px 0 110px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Color schemes based on course grade */
.cd-hero-section.bg-gradient-tth {
    background: linear-gradient(170deg, #FFFBEB 0%, #FFE0B2 60%, #FFCC80 100%);
}
.cd-hero-section.bg-gradient-l1-k1 {
    background: linear-gradient(170deg, #F5F3FF 0%, #E9D5FF 60%, #D8B4FE 100%);
}
.cd-hero-section.bg-gradient-l1-k2 {
    background: linear-gradient(170deg, #F0FDF4 0%, #CCFBF1 60%, #99F6E4 100%);
}

.cd-hero-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.cd-hero-badge {
    background-color: var(--color-bg-white);
    color: var(--color-primary);
    border: 3px solid var(--color-primary);
    border-bottom-width: 6px;
    border-radius: var(--radius-full);
    padding: 6px 20px;
    font-weight: 900;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 4px 0 rgba(255, 107, 53, 0.15);
    text-transform: uppercase;
}

.cd-hero-title {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 900;
    color: var(--color-text);
    line-height: 1.25;
    margin-bottom: 20px;
    text-shadow: 0 2px 0 #FFF, 0 4px 0 rgba(0, 0, 0, 0.05);
}

.cd-hero-title span {
    color: var(--color-primary);
}

.cd-hero-subtitle {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text-light);
    line-height: 1.8;
    margin-bottom: 36px;
    padding: 0 16px;
}

.cd-hero-stats-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cd-stat-pill {
    background: var(--color-bg-white);
    border: 3px solid #E2E8F0;
    border-bottom-width: 6px;
    border-radius: var(--radius-full);
    padding: 10px 24px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.cd-stat-pill i {
    color: var(--color-primary);
    font-size: 1.1rem;
}

.cd-stat-pill:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: 0 6px 12px rgba(255,107,53,0.1);
}

/* ---- Main Grid & Price Card ---- */
.cd-main-section {
    background-color: #FFFBF5;
    padding-top: 60px;
}

.cd-main-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: start;
}

.cd-price-card {
    border: 4px solid var(--color-text);
    border-bottom-width: 10px;
    border-radius: 28px;
    padding: 36px;
    background-color: var(--color-bg-white);
    box-shadow: var(--shadow-lg);
}

.cd-price-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.cd-original-price {
    font-size: 1.15rem;
    color: var(--color-text-light);
    text-decoration: line-through;
    font-weight: 600;
}

.cd-sale-price {
    font-size: 2.5rem;
    font-weight: 900;
    color: #EF4444;
    line-height: 1.1;
    margin-top: 4px;
}

.cd-price-badge {
    background-color: #FEF2F2;
    color: #EF4444;
    border: 2px solid #FCA5A5;
    padding: 4px 12px;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: var(--radius-full);
}

.cd-price-duration {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-light);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cd-price-duration i {
    color: var(--color-primary);
}

.cd-price-action-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.btn-study-trial {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 3px solid #5B21B6 !important;
    border-bottom-width: 8px !important;
}

.btn-buy-now {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 3px solid #9A3412 !important;
    border-bottom-width: 8px !important;
}

.cd-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    border-top: 2px dashed #E2E8F0;
    padding-top: 24px;
}

.cd-shortcut-item {
    background-color: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-bottom-width: 5px;
    border-radius: 16px;
    padding: 12px 8px;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.cd-shortcut-item i {
    font-size: 1.2rem;
    color: var(--color-secondary);
    transition: transform 0.2s ease;
}

.cd-shortcut-item:hover {
    transform: translateY(-2px);
    border-color: var(--color-secondary);
    background-color: #F5F3FF;
}

.cd-shortcut-item:hover i {
    transform: scale(1.15);
}

.cd-shortcut-item:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

/* ---- Tablet video frame mockup ---- */
.cd-video-wrapper {
    position: relative;
    width: 100%;
}

.cd-tablet-frame {
    background-color: #FBBF24;
    border: 5px solid var(--color-text);
    border-bottom-width: 14px; /* Playful 3D bottom border */
    border-radius: 36px;
    padding: 24px 24px 50px 24px; /* Padding for bottom home button area */
    position: relative;
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.cd-tablet-camera {
    width: 10px; height: 10px;
    background-color: var(--color-text);
    border-radius: 50%;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.cd-tablet-screen {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid var(--color-text);
    background-color: #000;
}

.cd-tablet-screen iframe {
    width: 100%; height: 100%;
    display: block;
}

.cd-preview-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    padding: 28px;
    background: linear-gradient(135deg, #FFFFFF, #FEF3C7);
    text-align: center;
}

.cd-preview-screen img {
    width: min(150px, 70%);
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

.cd-preview-screen strong,
.cd-preview-screen span {
    display: block;
}

.cd-preview-screen strong {
    color: var(--color-text);
    font-size: 1.2rem;
    font-weight: 900;
}

.cd-preview-screen span {
    color: var(--color-text-light);
    font-weight: 750;
    font-size: 0.9rem;
}

.cd-tablet-home-btn {
    width: 24px; height: 24px;
    border: 3px solid var(--color-text);
    border-radius: 50%;
    background-color: #FFF;
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    box-shadow: inset 0 2px 2px rgba(0,0,0,0.1);
}

.cd-tablet-shadow {
    position: absolute;
    width: 95%; height: 20px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    bottom: -15px;
    left: 2.5%;
    z-index: 1;
    filter: blur(4px);
}

/* ---- Achievements: Hộp Sticker ---- */
.cd-achievements-section {
    background-color: #FFFDF9;
}

.cd-achievements-card {
    background: var(--color-bg-white);
    border: 4px solid var(--color-text);
    border-bottom-width: 12px;
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 40px;
    align-items: center;
    position: relative;
}

/* Mascot column styling */
.cd-achieve-mascot-col {
    flex-shrink: 0;
    max-width: 220px;
    display: flex;
    justify-content: center;
}

.cd-achieve-mascot {
    width: 100%;
    height: auto;
    object-fit: contain;
    animation: float 4s ease-in-out infinite;
}

.cd-achieve-list-col {
    flex: 1;
}

.cd-achieve-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cd-achieve-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--color-text);
}

.cd-achieve-list li i {
    color: var(--color-accent-teal);
    font-size: 1.4rem;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ---- Syllabus tabs & accordion ---- */
.cd-syllabus-section {
    background-color: #F5F3FF;
}

.cd-syllabus-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 36px;
}

.cd-syllabus-tabs {
    background-color: #EDE9FE;
    padding: 8px;
    border-radius: var(--radius-full);
    border: 3px solid var(--color-text);
    border-bottom-width: 6px;
    display: inline-flex;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.cd-syllabus-tab {
    background: transparent;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cd-syllabus-tab i {
    font-size: 1.1rem;
}

.cd-syllabus-tab.active {
    background-color: var(--color-bg-white);
    color: var(--color-secondary);
    border: 2px solid var(--color-text);
    border-bottom-width: 5px;
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.15);
    transform: translateY(-1px);
}

/* Tab contents */
.cd-syllabus-panel {
    max-width: 900px;
    margin: 0 auto;
}

.cd-syllabus-tab-content {
    display: none;
}

.cd-syllabus-tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* Accordion 2 cấp bám sát mockup của người dùng */
.cd-accordion-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cd-chap-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Thanh chương chính màu xanh lá nổi bật 3D */
.cd-chap-header {
    background-color: #76C725; /* Bright playful green matching user mockup */
    border: 3px solid var(--color-text);
    border-bottom-width: 7px; /* Playful 3D bottom border */
    border-radius: 30px;
    padding: 14px 28px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.1s ease;
    box-shadow: var(--shadow-sm);
}

.cd-chap-header:hover {
    background-color: #83d931;
    transform: translateY(1px);
    border-bottom-width: 6px;
}

.cd-chap-header.active {
    background-color: #76C725;
    border-bottom-width: 3px;
    transform: translateY(4px);
}

.cd-chap-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Số chương dạng hình tròn trắng chữ xanh lá */
.cd-chap-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background-color: var(--color-bg-white);
    color: #76C725;
    font-weight: 900;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-text);
    flex-shrink: 0;
}

.cd-chap-title {
    color: var(--color-text-white);
    font-weight: 800;
    font-size: 1.15rem;
    text-shadow: 0 1.5px 0.5px rgba(0, 0, 0, 0.25);
}

.cd-chap-icon {
    color: var(--color-text-white);
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

/* Thân chương chứa các chuyên đề nét đứt */
.cd-chap-body {
    padding: 4px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cd-subchap-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Chuyên đề con nét đứt màu xanh dương / khi active nét đứt màu xanh lá */
.cd-subchap-header {
    background-color: var(--color-bg-white);
    border: 2.5px dashed #2563EB; /* Blue dashed border default */
    border-radius: 24px;
    padding: 12px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.cd-subchap-header:hover {
    background-color: #EFF6FF;
    border-color: #1D4ED8;
}

/* Trạng thái mở chuyên đề: nền xanh nhạt, nét đứt màu xanh lá */
.cd-subchap-header.active {
    background-color: #DCFCE7; /* Light green bg matching mockup */
    border-color: #22C55E; /* Green dashed border matching mockup */
}

.cd-subchap-title {
    color: var(--color-text);
    font-weight: 700;
    font-size: 1rem;
}

.cd-subchap-icon {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.cd-subchap-header.active .cd-subchap-title {
    color: #15803D; /* Green text matching mockup */
}

.cd-subchap-header.active .cd-subchap-icon {
    color: #15803D;
}

/* Thân chuyên đề chứa các bài giảng cụ thể */
.cd-subchap-body {
    padding: 0 12px;
}

/* Khung viền đứt bao quanh danh sách bài học */
.cd-lessons-list {
    background-color: #FAFDF6; /* Light cream/green matching mockup */
    border: 2.5px dashed #A3E635; /* Light green dashed border */
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
}

/* Hàng bài giảng cụ thể */
.cd-lesson-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1.5px dashed #E2E8F0;
    transition: background-color 0.2s ease;
}

.cd-lesson-row:last-child {
    border-bottom: none;
}

.cd-les-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}

.cd-les-left i {
    font-size: 1.05rem;
}

.cd-les-name {
    line-height: 1.4;
}

/* Nhãn học thử màu đỏ/cam */
.cd-les-free-badge {
    background-color: #FBBF24;
    color: var(--color-text);
    border: 1.5px solid var(--color-text);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.cd-les-right {
    display: flex;
    align-items: center;
}

/* YouTube play icon màu đỏ viền vàng tròn 3D */
.cd-les-youtube-icon {
    color: #EF4444;
    font-size: 1.5rem;
    padding: 4px;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.cd-lesson-row:hover .cd-les-youtube-icon {
    transform: scale(1.15) rotate(5deg);
}

/* PDF icon màu cam viền tròn */
.cd-les-pdf-icon {
    color: #F97316;
    font-size: 1.35rem;
    padding: 4px;
    transition: transform 0.2s ease;
}

.cd-lesson-row:hover .cd-les-pdf-icon {
    transform: scale(1.15) rotate(-5deg);
}

/* Gamepad icon màu xanh */
.cd-les-game-icon {
    color: var(--color-accent-blue);
    font-size: 1.35rem;
    padding: 4px;
    transition: transform 0.2s ease;
}

.cd-lesson-row:hover .cd-les-game-icon {
    transform: scale(1.15);
}

/* Tab: Exams & Materials style cards */
.cd-exams-list-container,
.cd-materials-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cd-exam-card,
.cd-material-card {
    background-color: var(--color-bg-white);
    border: 3px solid var(--color-text);
    border-bottom-width: 8px;
    border-radius: 20px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.cd-exam-card:hover,
.cd-material-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cd-exam-info,
.cd-mat-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cd-exam-icon-box,
.cd-mat-icon-box {
    width: 45px; height: 45px;
    border-radius: 12px;
    border: 2px solid var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.cd-exam-icon-box {
    background-color: #FEF3C7;
    color: #D97706;
}

.cd-mat-icon-box {
    background-color: #FEE2E2;
    color: #DC2626;
}

.cd-exam-info h4,
.cd-mat-info h4 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 4px;
}

.cd-exam-info p,
.cd-mat-info p {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: 600;
}

.btn-exam-start,
.btn-mat-dl {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-bottom-width: 4px !important;
    white-space: nowrap;
}

/* ---- FAQs ---- */
.cd-faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 28px;
}

.cd-faq-item {
    background-color: var(--color-bg-white);
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-base);
}

.cd-faq-item.active {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.08);
}

.cd-faq-q {
    padding: 18px 24px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--color-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    user-select: none;
}

.cd-faq-q i {
    font-size: 0.85rem;
    color: var(--color-text-light);
    transition: transform 0.2s ease;
}

.cd-faq-item.active .cd-faq-q i {
    color: var(--color-primary);
}

.cd-faq-a {
    padding: 0 24px 20px 24px;
    display: none;
    font-size: 0.92rem;
    color: var(--color-text-light);
    line-height: 1.6;
    border-top: 1.5px dashed #EDF2F7;
    padding-top: 16px;
}

.cd-loading-block,
.cd-loading-list span {
    background: rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.cd-loading-block {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px;
}

.cd-loading-block span,
.cd-loading-block strong,
.cd-loading-block p {
    display: block;
    height: 18px;
    margin: 0 auto 14px;
    border-radius: var(--radius-full);
    background-color: rgba(148, 163, 184, 0.22);
}

.cd-loading-block span {
    width: 140px;
}

.cd-loading-block strong {
    width: 72%;
    height: 44px;
}

.cd-loading-block p {
    width: 84%;
}

.cd-loading-block p:last-child {
    width: 60%;
    margin-bottom: 0;
}

.cd-loading-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cd-loading-list span {
    display: block;
    height: 72px;
}

.cd-empty-state {
    padding: 34px;
    border-radius: 24px;
    border: 2px dashed #CBD5E1;
    background-color: rgba(255, 255, 255, 0.78);
    text-align: center;
}

.cd-empty-state i {
    margin-bottom: 12px;
    color: var(--color-primary);
    font-size: 2rem;
}

.cd-empty-state h3 {
    margin-bottom: 8px;
    color: var(--color-text);
    font-size: 1.15rem;
    font-weight: 900;
}

.cd-empty-state p {
    margin-bottom: 16px;
    color: var(--color-text-light);
    font-weight: 650;
}

.cd-inline-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 2px solid #FCA5A5;
    color: #B91C1C;
    background-color: #FEF2F2;
    font-weight: 750;
}

.cd-footer {
    padding: 34px 0;
    color: white;
    background-color: var(--color-bg-dark);
}

.cd-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cd-footer strong {
    font-weight: 900;
}

.cd-footer span {
    color: #CBD5E1;
    font-weight: 650;
}



/* ==========================================================================
   RESPONSIVE CD STYLES
   ========================================================================== */
@media (max-width: 1024px) {
    .cd-hero-title {
        font-size: 2.5rem;
    }
    
    .cd-main-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .cd-video-wrapper {
        max-width: 600px;
        margin: 0 auto;
    }

    .cd-achievements-card {
        flex-direction: column;
        padding: 30px;
        text-align: center;
        gap: 24px;
    }

    .cd-achieve-mascot-col {
        max-width: 160px;
    }
    
    .cd-achieve-list li {
        text-align: left;
    }


}

@media (max-width: 768px) {
    .cd-topbar-inner {
        flex-direction: column;
        align-items: stretch;
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 10px;
    }

    .cd-topnav {
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .cd-topnav a {
        white-space: nowrap;
    }

    .cd-hero-title {
        font-size: 2rem;
    }
    
    .cd-hero-stats-row {
        gap: 10px;
    }
    
    .cd-stat-pill {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .cd-price-card {
        padding: 24px;
    }
    
    .cd-sale-price {
        font-size: 2rem;
    }
    
    .cd-syllabus-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .cd-chap-header {
        padding: 12px 20px;
    }

    .cd-chap-title {
        font-size: 1rem;
    }

    .cd-exam-card,
    .cd-material-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .btn-exam-start,
    .btn-mat-dl {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cd-hero-title {
        font-size: 1.7rem;
    }

    .cd-original-price {
        font-size: 1rem;
    }

    .cd-sale-price {
        font-size: 1.8rem;
    }

    .cd-shortcuts {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .cd-shortcut-item {
        padding: 10px 4px;
        font-size: 0.75rem;
    }
    
    .cd-syllabus-tabs {
        flex-direction: column;
        border-radius: 20px;
        padding: 8px;
        width: 100%;
    }
    
    .cd-syllabus-tab {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   NAV DROPDOWN MENU 3D PASTEL
   ============================================================ */
.nav-dropdown-trigger {
    position: relative;
}

.nav-dropdown-trigger .nav-arrow {
    font-size: 0.75rem;
    margin-left: 4px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.8;
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(12px) scale(0.95);
    background: #ffffff;
    border: 2px solid var(--color-primary-light, #FFD4C0);
    border-bottom: 5px solid var(--color-primary, #FF6B35);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    min-width: 210px;
    padding: 12px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.25);
    z-index: 999;
}

/* Cầu nối hover vô hình kết nối header với dropdown để không bị mất hover */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 0;
    width: 100%;
    height: 24px;
    background: transparent;
}

/* Hover show dropdown */
.nav-dropdown-trigger:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(4px) scale(1);
}

.nav-dropdown-trigger:hover .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown li {
    width: 100%;
    padding: 0 8px;
    margin-bottom: 2px;
}

.nav-dropdown li:last-child {
    margin-bottom: 0;
}

.nav-dropdown li a {
    display: block;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569 !important;
    text-align: left;
    border-radius: 10px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-dropdown li a:hover {
    color: var(--color-primary, #FF6B35) !important;
    background-color: #FFF5F2;
    transform: translateX(4px);
}

/* Responsive styles cho Mobile dropdown & Mega Menu */
@media (max-width: 1024px) {
    .nav-dropdown {
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        display: none; /* collapse mặc định */
        box-shadow: none !important;
        border: none !important;
        border-left: 3px solid var(--color-primary-light, #FFD4C0) !important;
        background: #FFFBF9 !important;
        padding: 6px 0 6px 12px !important;
        width: 100% !important;
        min-width: unset !important;
        border-radius: 10px !important;
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        transition: none !important;
    }
    
    .nav-dropdown::before {
        display: none !important;
    }

    .nav-dropdown-trigger.open .nav-dropdown {
        display: block;
    }

    .nav-dropdown-trigger.open .nav-arrow {
        transform: rotate(180deg);
    }
    
    .nav-dropdown li {
        padding: 0;
    }
    
    .nav-dropdown li a {
        padding: 8px 12px;
    }
    
    .nav-dropdown li a:hover {
        transform: none;
    }

    /* Mega Menu Mobile styling */
    .mega-menu {
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        display: none; /* collapse mặc định */
        box-shadow: none !important;
        border: none !important;
        border-left: 3px solid var(--color-primary-light, #FFD4C0) !important;
        background: #FFFBF9 !important;
        padding: 6px 0 6px 12px !important;
        width: 100% !important;
        min-width: unset !important;
        border-radius: 10px !important;
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        transition: none !important;
    }

    .mega-menu-trigger.open .mega-menu {
        display: block;
    }

    .mega-menu-inner {
        padding: 10px 0 !important;
    }

    .mega-columns {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .mega-col {
        padding: 0 !important;
        border-right: none !important;
        border-bottom: 1.5px dashed rgba(0, 0, 0, 0.06) !important;
        padding-bottom: 12px !important;
    }

    .mega-col:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .mega-col-title {
        margin-bottom: 8px !important;
        display: block !important;
        width: fit-content;
    }

    .mega-row-label,
    .mega-footer,
    .mega-menu::before {
        display: none !important;
    }

    .mega-col ul li a {
        padding: 6px 12px !important;
    }

    .mega-col ul li a:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* ============================================================
   CARTOON VIBRANT BACKGROUND & MASCOT DECORATION
   ============================================================ */
.cartoon-bg-wrapper {
    background: radial-gradient(rgba(255, 255, 255, 0.15) 15%, transparent 16%) 0 0 / 20px 20px,
                linear-gradient(135deg, #FFA000 0%, #FF6B35 30%, #1E40AF 75%, #0B3C9B 100%);
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Make sure hero-banner has transparent background so it shows the wrapper's bg */
.hero-banner {
    background: transparent !important;
}

/* Floating mascots styling */
.decor-mascot {
    position: absolute;
    bottom: -10px;
    z-index: 10;
    pointer-events: none;
    transition: all 0.3s ease;
}

.decor-mascot img {
    height: 380px;
    width: auto;
    object-fit: contain;
}

.mascot-left {
    left: -60px;
}

.mascot-right {
    right: -60px;
}

/* Float animations */
.float-anim {
    animation: mascotFloat 5s ease-in-out infinite;
}

.float-anim-reverse {
    animation: mascotFloatReverse 6s ease-in-out infinite;
}

@keyframes mascotFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes mascotFloatReverse {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(-2deg); }
}

/* Responsive Hide for Mascots under 1150px to prevent overlaying content */
@media (max-width: 1150px) {
    .decor-mascot img {
        height: 280px;
    }
    .mascot-left {
        left: -80px;
    }
    .mascot-right {
        right: -80px;
    }
}

@media (max-width: 1024px) {
    .decor-mascot {
        display: none !important;
    }
}

/* Stretch the navigation menu on desktop viewports */
@media (min-width: 1025px) {
    .logo-container {
        flex: 0 0 auto;
        gap: 8px;
    }
    .logo-text {
        font-size: 1.45rem;
    }
    .logo-tagline {
        font-size: 0.88rem;
    }
    .nav-actions {
        flex: 0 0 auto;
    }
    .nav-cta-btn {
        padding: 8px 18px;
        font-size: 0.85rem;
    }
    .nav-menu {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        gap: 8px;
    }
    .nav-link {
        padding: 8px 8px;
        font-size: 0.90rem;
        gap: 4px;
    }
    .nav-link i.nav-icon {
        font-size: 0.96rem;
    }
}

/* ==========================================================================
   Upgraded Exam Selection Screen & Accordion Layout
   ========================================================================== */
.exam-select-container {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #FAF8F5; /* Warm light background */
}

/* Scrollbar customization */
.exam-select-container::-webkit-scrollbar {
    width: 8px;
}
.exam-select-container::-webkit-scrollbar-track {
    background: transparent;
}
.exam-select-container::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 99px;
}

.exam-filter-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}

.exam-filter-btn {
    font-family: var(--font-primary);
    padding: 8px 20px;
    border-radius: 99px;
    background-color: white;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* Specific button styles for inactive states */
.exam-filter-btn.filter-all {
    border: 2.5px solid #CBD5E1;
    color: #64748B;
    box-shadow: 0 3px 0 #CBD5E1;
}
.exam-filter-btn.filter-all:hover {
    transform: translateY(-2px);
    border-color: #FBBF24;
    color: #D97706;
}
.exam-filter-btn.filter-all.active {
    background-color: #FBBF24;
    color: #78350F;
    border-color: #D97706;
    box-shadow: 0 4px 0 #B45309;
    transform: translateY(-2px);
}

.exam-filter-btn.filter-completed {
    border: 2.5px solid #86EFAC; /* Light green border */
    color: #16A34A; /* Green text */
    box-shadow: 0 3px 0 #86EFAC;
}
.exam-filter-btn.filter-completed:hover {
    transform: translateY(-2px);
    background-color: #F0FDF4;
}
.exam-filter-btn.filter-completed.active {
    background-color: #22C55E;
    color: white;
    border-color: #16A34A;
    box-shadow: 0 4px 0 #15803D;
    transform: translateY(-2px);
}

.exam-filter-btn.filter-in-progress {
    border: 2.5px solid #FCD34D; /* Light orange border */
    color: #D97706; /* Orange text */
    box-shadow: 0 3px 0 #FCD34D;
}
.exam-filter-btn.filter-in-progress:hover {
    transform: translateY(-2px);
    background-color: #FEFCE8;
}
.exam-filter-btn.filter-in-progress.active {
    background-color: #FBBF24;
    color: #78350F;
    border-color: #D97706;
    box-shadow: 0 4px 0 #B45309;
    transform: translateY(-2px);
}

.exam-filter-btn.filter-not-started {
    border: 2.5px solid #93C5FD; /* Light blue border */
    color: #1D4ED8; /* Blue text */
    box-shadow: 0 3px 0 #93C5FD;
}
.exam-filter-btn.filter-not-started:hover {
    transform: translateY(-2px);
    background-color: #EFF6FF;
}
.exam-filter-btn.filter-not-started.active {
    background-color: #3B82F6;
    color: white;
    border-color: #2563EB;
    box-shadow: 0 4px 0 #1D4ED8;
    transform: translateY(-2px);
}

.exam-filter-btn.filter-ended {
    border: 2.5px solid #FCA5A5; /* Light red border */
    color: #EF4444; /* Red text */
    box-shadow: 0 3px 0 #FCA5A5;
}
.exam-filter-btn.filter-ended:hover {
    transform: translateY(-2px);
    background-color: #FEF2F2;
}
.exam-filter-btn.filter-ended.active {
    background-color: #EF4444;
    color: white;
    border-color: #DC2626;
    box-shadow: 0 4px 0 #991B1B;
    transform: translateY(-2px);
}

.exam-filter-btn.active:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 currentColor;
}

/* Green Accordions */
.exam-accordion-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.exam-accordion-item {
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.exam-category-header {
    background-color: #22C55E;
    color: white;
    border: 4px solid #16A34A;
    border-bottom-width: 8px;
    padding: 14px 24px;
    border-radius: 20px;
    font-size: 1.15rem;
    font-weight: 900;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    user-select: none;
}

.exam-category-header:hover {
    background-color: #4ADE80;
    transform: translateY(-2px);
    border-color: #15803D;
    box-shadow: 0 5px 12px rgba(22, 163, 74, 0.15);
}

.exam-category-header:active {
    transform: translateY(2px);
    border-bottom-width: 4px;
}

.exam-category-num {
    background-color: #15803D;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 900;
    margin-right: 12px;
    border: 2px solid white;
}

.exam-category-arrow {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.exam-accordion-item.open .exam-category-arrow {
    transform: rotate(180deg);
}

.exam-category-body {
    display: none;
    padding: 18px 8px 8px;
    animation: slideDown 0.3s ease-out;
}

.exam-accordion-item.open .exam-category-body {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Exam Grid and Cards */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .exam-grid {
        grid-template-columns: 1fr;
    }
}

.exam-card-item {
    background-color: white;
    border: 3px solid #E2E8F0;
    border-bottom-width: 6px;
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    position: relative;
    display: flex;
    gap: 14px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.exam-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.exam-card-item:active {
    transform: translateY(2px);
    border-bottom-width: 3px;
}

.exam-card-icon-wrap {
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
}

.exam-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.exam-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #334155;
    line-height: 1.45;
}

.exam-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: #64748B;
    font-weight: 700;
}

.exam-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.exam-card-meta i {
    color: #94A3B8;
}

/* Card Statuses */
.exam-card-item.not-started {
    background-color: #EFF6FF; /* Light blue glow */
    border-color: #93C5FD;
    border-bottom-color: #3B82F6;
}
.exam-card-item.not-started:hover {
    border-color: #60A5FA;
}
.exam-card-item.not-started .exam-card-icon-wrap {
    color: #2563EB;
}

.exam-card-item.in-progress {
    background-color: #FEFCE8; /* Golden/yellow glow */
    border-color: #FCD34D;
    border-bottom-color: #F59E0B;
}
.exam-card-item.in-progress .exam-card-icon-wrap {
    color: #D97706;
}

.exam-card-item.completed {
    background-color: #F0FDF4; /* Light green glow */
    border-color: #86EFAC;
    border-bottom-color: #22C55E;
}
.exam-card-item.completed .exam-card-icon-wrap {
    color: #16A34A;
}

.exam-card-item.ended {
    background-color: #FEF2F2; /* Light red glow */
    border-color: #FCA5A5;
    border-bottom-color: #EF4444;
    opacity: 0.9;
}
.exam-card-item.ended .exam-card-icon-wrap {
    color: #EF4444;
}

.exam-badge-status {
    font-size: 0.7rem;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    box-shadow: inset 0 -1.5px 0 rgba(0,0,0,0.1);
}

.exam-badge-status.history {
    background-color: #F97316;
    color: white;
    border: 1px solid #EA580C;
}

.exam-badge-status.done {
    background-color: #10B981;
    color: white;
    border: 1px solid #059669;
}

.exam-badge-status.not-started {
    background-color: #3B82F6;
    color: white;
    border: 1px solid #2563EB;
}

.exam-badge-status.ended {
    background-color: #EF4444;
    color: white;
    border: 1px solid #DC2626;
}

/* ==========================================================================
   Cartoon Confirmation Modal with Gemstones decoration
   ========================================================================== */
.cartoon-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.cartoon-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.cartoon-modal-card {
    background-color: white;
    border: 8px solid #F97316;
    border-bottom-width: 14px;
    border-radius: 32px;
    width: 90%;
    max-width: 500px;
    padding: 38px 28px 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.cartoon-modal-overlay.show .cartoon-modal-card {
    transform: scale(1);
}

/* Gems at 4 corners */
.cartoon-modal-card .progress-gem {
    width: 22px;
    height: 22px;
    z-index: 50;
    border: 2px solid white;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15), inset 0 -3px 0 rgba(0,0,0,0.2);
}

.cartoon-modal-title {
    font-size: 1.7rem;
    font-weight: 900;
    color: #F97316;
    margin-bottom: 22px;
    font-family: var(--font-primary);
    letter-spacing: -0.5px;
}

.cartoon-modal-body {
    font-size: 1.15rem;
    color: #475569;
    line-height: 1.6;
    font-weight: 700;
    margin-bottom: 32px;
    padding: 0 10px;
}

.cartoon-modal-body strong {
    color: #0F172A;
    display: block;
    margin-top: 8px;
    font-size: 1.25rem;
    font-weight: 900;
}

.cartoon-modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.cartoon-modal-btn {
    font-family: var(--font-primary);
    padding: 10px 26px;
    font-size: 0.95rem;
    font-weight: 900;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

.cartoon-modal-btn.cancel {
    background-color: #F1F5F9;
    border: 3px solid #CBD5E1;
    border-bottom-width: 6px;
    color: #64748B;
}

.cartoon-modal-btn.cancel:hover {
    background-color: #E2E8F0;
    transform: translateY(-2px);
}

.cartoon-modal-btn.confirm {
    background-color: #FBBF24;
    border: 3px solid #D97706;
    border-bottom-width: 6px;
    color: #78350F;
}

.cartoon-modal-btn.confirm:hover {
    background-color: #FCD34D;
    transform: translateY(-2px);
}

.cartoon-modal-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

/* Playful Wood Close Button */
.cartoon-modal-close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #D97706; /* Wood orange */
    border: 3px solid #FCD34D;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15), inset 0 -3px 0 rgba(0,0,0,0.25);
    color: white;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.cartoon-modal-close:hover {
    transform: scale(1.1) rotate(95deg);
    background-color: #B45309;
}

.cd-owned-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(20, 184, 166, 0.02));
    border: 1px solid rgba(20, 184, 166, 0.25);
    border-radius: 16px;
    padding: 20px 24px;
    flex-wrap: wrap;
}

.cd-owned-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: var(--color-accent-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.cd-owned-text {
    flex: 1;
    min-width: 180px;
}

.cd-owned-text h4 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
}

.cd-owned-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.btn-resume {
    background-color: var(--color-accent-teal);
    border-color: var(--color-accent-teal);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .cd-owned-card {
        flex-direction: column;
        text-align: center;
    }
    .btn-resume {
        width: 100%;
    }
}

.db-next-step-content {
    margin-top: 0.5rem;
    min-width: 0;
}

/* ===== Khi có khóa học tiếp theo ===== */
.db-next-item {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    min-width: 0;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--color-bg-lavender), rgba(124, 58, 237, 0.04));
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.db-next-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(124, 58, 237, 0.25);
}

.db-next-thumb-wrap {
    position: relative;
    flex-shrink: 0;
}

.db-next-thumb {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.db-next-grade-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: var(--color-secondary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    border: 2px solid #fff;
    white-space: nowrap;
}

.db-next-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-next-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.db-next-title {
    margin: 2px 0 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.db-next-subject {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: rgba(124, 58, 237, 0.08);
    padding: 2px 8px;
    border-radius: 999px;
    width: fit-content;
}

.db-next-action {
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

/* ===== Khi chưa có khóa học ===== */
.db-next-empty {
    text-align: center;
    padding: 2rem 1rem;
    border: 1.5px dashed rgba(124, 58, 237, 0.18);
    border-radius: 1.1rem;
    background: rgba(124, 58, 237, 0.03);
}

.db-next-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: var(--color-bg-lavender);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-text-light);
}

.db-next-empty-text {
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 1rem;
}

.db-next-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===== Responsive: mobile xếp dọc ===== */
@media (max-width: 480px) {
    .db-next-item {
        flex-wrap: wrap;
    }

    .db-next-info {
        order: 1;
        flex-basis: calc(100% - 80px);
    }

    .db-next-action {
        order: 2;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
}
