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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

@keyframes moveBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -30px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes moveBlob2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, 20px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}


/* --- DESIGN VARIABLES --- */
:root {
    --primary: #5D9CEC;
    --primary-dark: #4A89DC;
    --accent: #48CFAD;
    --accent-hot: #FF6B6B; /* New, more vibrant accent */
    --text-main: #2c3e50;
    --text-light: #656d78;
    --bg-body: #F8F9FD; /* Slightly bluer background */
    --white: #FFFFFF;

    /* Effects */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 8px 30px -8px rgba(93, 156, 236, 0.2);
    --shadow-intense: 0 15px 50px -10px rgba(44, 62, 80, 0.2);

    --container: 1200px;
    --radius: 20px; /* Larger radius for a softer look */
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden; /* Prevents horizontal scroll from animations */
}

h1, h2, h3 { font-family: 'Poppins', sans-serif; font-weight: 700; }
a { text-decoration: none; color: inherit; transition: 0.3s ease; }
ul { list-style: none; }

/* --- UTILITIES & ANIMATIONS --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 10px; }
.section-title p { color: var(--text-light); font-size: 1.1rem; }

/* Animation Setup */
.animated {
    opacity: 0; /* Start hidden */
    pointer-events: auto; /* Ensure elements remain clickable during animation */
}
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animated.delay-1 { animation-delay: 0.1s; }
.animated.delay-2 { animation-delay: 0.2s; }
.animated.delay-3 { animation-delay: 0.3s; }
.animated.delay-4 { animation-delay: 0.4s; }


/* --- HEADER --- */
.site-header {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    position: sticky; top: 0; z-index: 1000;
    padding: 15px 0;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: 'Lora', serif; font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); display: flex; align-items: center; gap: 12px; }
.nav-menu { display: flex; gap: 35px; }
.nav-menu a { font-weight: 600; font-size: 1rem; position: relative; }
.nav-menu a:after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}
.nav-menu a:hover:after { width: 100%; }

/* Hamburger Menu Button - Hidden by default on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* --- HERO SECTION --- */
.hero { padding: 100px 0; text-align: center; position: relative; overflow: hidden; }
.blob {
    position: absolute; width: 500px; height: 500px; border-radius: 50%; z-index: -1;
    filter: blur(100px); opacity: 0.5; will-change: transform;
}
.blob-1 { background: var(--primary); top: -200px; left: -100px; animation: moveBlob1 20s infinite alternate; }
.blob-2 { background: var(--accent); bottom: -100px; right: -200px; animation: moveBlob2 25s infinite alternate; }

.hero h1 { font-size: 4rem; margin-bottom: 20px; line-height: 1.15; }
.highlight { background: linear-gradient(45deg, var(--primary), var(--accent-hot)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.25rem; color: var(--text-light); margin-bottom: 50px; }

/* Search Bar */
.search-box {
    position: relative; max-width: 650px; margin: 0 auto;
}
.search-box input {
    width: 100%; padding: 20px 70px 20px 35px;
    border-radius: 50px; border: 1px solid transparent;
    background: var(--white);
    box-shadow: var(--shadow-soft);
    font-size: 1.1rem; outline: none; transition: 0.3s ease;
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(93, 156, 236, 0.25);
}
.search-btn {
    position: absolute; right: 8px; top: 8px; width: 50px; height: 50px;
    background: linear-gradient(45deg, var(--primary), var(--accent-hot));
    color: white; border: none; border-radius: 50%;
    cursor: pointer; display: grid; place-items: center;
    transition: 0.3s ease;
    animation: pulse 2.5s infinite;
}
.search-btn:hover { transform: scale(1.1); }

/* --- CARDS GRID --- */
.class-section { padding: 80px 0; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 35px; margin-top: 40px; }
.card {
    background: var(--white); padding: 40px; border-radius: var(--radius);
    text-align: center; border: 1px solid #EAF0F6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative; overflow: hidden;
    touch-action: manipulation; /* Prevents double-tap zoom delay */
    cursor: pointer;
}
/* Only apply hover effects on devices that support true hover */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-12px) scale(1.02);
        box-shadow: var(--shadow-intense);
    }
}
/* Active state for touch devices */
.card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}
.card-icon {
    font-size: 2.5rem; margin-bottom: 25px;
    background: linear-gradient(135deg, #eef5ff, #ffffff);
    width: 80px; height: 80px; line-height: 80px;
    border-radius: 50%; margin-inline: auto;
    box-shadow: 0 5px 15px rgba(93, 156, 236, 0.1);
}
.card h3 { margin-bottom: 15px; font-size: 1.6rem; }
.card p { color: var(--text-light); margin-bottom: 25px; font-size: 1rem; }
.card-link {
    color: var(--primary); font-weight: 600; font-size: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}
/* Only apply hover effects on devices that support true hover */
@media (hover: hover) {
    .card:hover .card-link { transform: translateX(5px); }
}

/* --- SVG Icon Colors --- */
.card-icon svg {
    /* Sizing now handled by context or intrinsic SVG size */
}
.icon-stroke-primary {
    stroke: var(--primary);
}
.icon-stroke-accent {
    stroke: var(--accent);
}
.icon-fill-accent {
    stroke: var(--primary);
    fill: var(--accent);
    fill-opacity: 0.2;
}


/* --- FEATURE STRIP --- */
.feature-section { background: white; padding: 80px 0; border-top: 1px solid #eee; }
.feature-grid { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 30px; text-align: center; }
.feature-item div:first-child { font-size: 2.5rem; margin-bottom: 15px; color: var(--primary); }
.feature-item div:first-child svg {
    width: 40px;
    height: 40px;
}
.feature-item h3 { font-size: 1.3rem; margin-bottom: 10px; }
.feature-item p { font-size: 1rem; color: var(--text-light); }

/* Clickable feature item hover effect */
a.feature-item {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    padding: 20px;
    border-radius: 12px;
    touch-action: manipulation; /* Prevents double-tap zoom delay */
}

/* Only apply hover effects on devices that support true hover */
@media (hover: hover) {
    a.feature-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(93, 156, 236, 0.15);
    }
}
/* Active state for touch devices */
a.feature-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* --- FOOTER --- */
footer { background: var(--text-main); color: #bdc3c7; padding: 70px 0 30px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; margin-bottom: 50px; }
.footer h4 { color: white; margin-bottom: 20px; font-size: 1.2rem; }
.footer p { line-height: 1.8; }
.footer ul li { margin-bottom: 12px; }
.footer ul a:hover { color: var(--accent); padding-left: 5px; }
.copyright { text-align: center; border-top: 1px solid #34495e; padding-top: 30px; font-size: 0.9rem; }
/* --- LIST VIEW (FOR SUBJECTS/CHAPTERS) --- */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 40px auto;
}

.list-item {
    background: var(--white);
    padding: 25px 35px;
    border-radius: var(--radius);
    border: 1px solid #EAF0F6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    touch-action: manipulation; /* Prevents double-tap zoom delay */
    cursor: pointer;
}

/* Only apply hover effects on devices that support true hover */
@media (hover: hover) {
    .list-item:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: var(--shadow-intense);
    }
}
/* Active state for touch devices */
.list-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.list-item-title {
    display: flex;
    align-items: center;
    gap: 25px;
}

.list-item-title h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.chapter-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    background: linear-gradient(135deg, #eef5ff, #ffffff);
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
}

.list-item-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Only apply hover effects on devices that support true hover */
@media (hover: hover) {
    .list-item:hover .list-item-link {
        transform: translateX(5px);
    }
}

.nav-menu .dropdown {
    position: relative;
}

.nav-menu .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-intense);
    padding: 15px 0;
    min-width: 200px;
    z-index: 1001;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-menu .dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 25px;
    font-weight: 500;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
    color: var(--primary);
}

.chapter-content {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    margin-top: 40px;
    line-height: 1.8;
}

.chapter-content h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

/* --- BREADCRUMB --- */
.breadcrumb {
    padding: 20px 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--primary);
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.breadcrumb span {
    color: var(--text-main);
    font-weight: 600;
}

/* --- CONTENT TYPE GRID (for chapters.php) --- */
.content-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
    margin-top: 40px;
}

.content-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid #EAF0F6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: block;
    touch-action: manipulation; /* Prevents double-tap zoom delay */
    cursor: pointer;
}

/* Only apply hover effects on devices that support true hover */
@media (hover: hover) {
    .content-card:hover {
        transform: translateY(-12px) scale(1.02);
        box-shadow: var(--shadow-intense);
    }
}
/* Active state for touch devices */
.content-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.content-card-icon {
    font-size: 2.5rem;
    margin-bottom: 25px;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-card-icon.video-icon {
    background: linear-gradient(135deg, #FF6B6B15, #ffffff);
    color: #FF6B6B;
}

.content-card-icon.qa-icon {
    background: linear-gradient(135deg, #48CFAD15, #ffffff);
    color: #48CFAD;
}

.content-card-icon.quiz-icon {
    background: linear-gradient(135deg, #5D9CEC15, #ffffff);
    color: #5D9CEC;
}

.content-count {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 15px;
    margin-bottom: 20px;
}

/* --- VIDEO PAGE --- */
.video-section {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin-bottom: 40px;
}

.video-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info {
    padding: 30px;
}

.video-info h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.video-duration {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.video-description {
    color: var(--text-light);
    line-height: 1.8;
}

.video-navigation {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-soft);
}

.video-navigation h3 {
    margin-bottom: 25px;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-list-item {
    display: flex;
    gap: 20px;
    padding: 15px;
    border-radius: 12px;
    background: #F8F9FD;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.video-list-item:hover {
    background: #EEF5FF;
    transform: translateX(5px);
}

.video-list-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.video-list-item.active h4,
.video-list-item.active .duration-badge {
    color: white;
}

.video-thumbnail {
    position: relative;
    width: 120px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.video-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-list-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.duration-badge {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* --- VIDEO SECTION --- */
.video-container {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

.video-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.video-icon {
    color: var(--primary);
    flex-shrink: 0;
}

.video-header h3 {
    color: var(--text-main);
    font-size: 1.3rem;
    margin: 0;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- PROGRESS BAR --- */
.progress-container {
    background: var(--white);
    padding: 20px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.quick-jump {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-icon:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-icon svg {
    flex-shrink: 0;
}

.jump-input {
    width: 100px;
    padding: 8px 12px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.jump-input:focus {
    outline: none;
    border-color: var(--primary);
}

.jump-input::placeholder {
    color: #999;
}

.progress-bar {
    height: 10px;
    background: #E8EDF3;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

/* --- DIFFICULTY BADGE --- */
.difficulty-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-easy {
    background: #48CFAD;
    color: white;
}

.difficulty-medium {
    background: #FFCE54;
    color: #333;
}

.difficulty-hard {
    background: #FF6B6B;
    color: white;
}

/* --- Q&A CARD --- */
.qa-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

.question-section {

    margin-bottom: 0;

}



.question-section h2, .question-section h3 {

    color: var(--primary);

    margin-bottom: 20px;

}



.question-text {

    font-size: 1.2rem;

    line-height: 1.8;

    color: var(--text-main);

}



.qa-separator {

    border: none;

    height: 1px;

    background-color: #E8EDF3;

    margin: 40px 0;

}



.answer-title {

    margin-bottom: 15px;

    font-size: 1.5rem;

    color: var(--text-main);

}

.answer-section {
    background: #F8F9FD;
    padding: 30px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
}

.answer-text {
    line-height: 1.8;
    color: var(--text-main);
}

.btn-show-answer {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 20px rgba(93, 156, 236, 0.3);
}

.btn-show-answer:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(93, 156, 236, 0.4);
}

.btn-show-answer.active {
    background: linear-gradient(45deg, var(--accent), var(--primary));
}

/* --- NAVIGATION BUTTONS --- */
.qa-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 30px;
}

/* Top navigation - more compact */
.qa-navigation-top {
    margin-bottom: 25px;
    margin-top: 10px;
    background: var(--white);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.qa-navigation-top .btn-nav {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-nav {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    min-height: 44px; /* Minimum touch target for mobile */
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-prev:hover {
    background: var(--primary);
    color: white;
}

.btn-next {
    background: var(--primary);
    color: white;
}

.btn-next:hover {
    background: var(--primary-dark);
    transform: translateX(5px);
}

.btn-back {
    background: var(--text-light);
    color: white;
}

.btn-back:hover {
    background: var(--text-main);
}

.btn-disabled {
    background: #E8EDF3;
    color: #999;
    cursor: not-allowed;
}

/* --- QUESTION GRID --- */
.question-grid {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.question-grid h3 {
    margin-bottom: 20px;
}

.question-numbers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
}

.question-number {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F9FD;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.question-number:hover {
    background: #EEF5FF;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.question-number.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(93, 156, 236, 0.4);
}

.question-number.answered-correct {
    background: #48CFAD;
    color: white;
    border-color: #48CFAD;
}

.question-number.answered-wrong {
    background: #FF6B6B;
    color: white;
    border-color: #FF6B6B;
}

/* Question Legend */
.question-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E0E0E0;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.legend-current {
    background: var(--primary);
}

.legend-correct {
    background: #48CFAD;
}

.legend-wrong {
    background: #FF6B6B;
}

.legend-unanswered {
    background: white;
    border: 2px solid #E0E0E0;
}

/* --- QUESTION NAVIGATOR MODAL --- */
.question-navigator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.navigator-content {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    position: relative;
}

.navigator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #E8EDF3;
}

.navigator-header h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0;
}

.navigator-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #F8F9FD;
    border-radius: 12px;
}

.nav-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.stat-badge {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.stat-badge-current {
    background: var(--primary);
}

.stat-badge-correct {
    background: #48CFAD;
}

.stat-badge-wrong {
    background: #FF6B6B;
}

.stat-badge-unanswered {
    background: white;
    border: 2px solid #E0E0E0;
}

.question-numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
}

.question-number-btn {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F9FD;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}

.question-number-btn:hover {
    background: #EEF5FF;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.question-number-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(93, 156, 236, 0.4);
}

.question-number-btn.answered-correct {
    background: #48CFAD;
    color: white;
    border-color: #48CFAD;
}

.question-number-btn.answered-wrong {
    background: #FF6B6B;
    color: white;
    border-color: #FF6B6B;
}

/* --- QUIZ STYLES --- */
.quiz-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.quiz-stat {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.quiz-container {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

.quiz-question h3 {
    color: var(--primary);
    margin-bottom: 20px;
}

.quiz-options {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #F8F9FD;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quiz-option:hover {
    background: #EEF5FF;
    border-color: var(--primary);
}

.quiz-option input[type="radio"] {
    display: none;
}

.quiz-option input[type="radio"]:checked + .option-label {
    background: var(--primary);
    color: white;
}

.option-label {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    font-weight: 700;
    transition: all 0.3s ease;
}

.option-text {
    flex: 1;
    font-size: 1.1rem;
}

.quiz-option.correct {
    background: #48CFAD20;
    border-color: #48CFAD;
}

.quiz-option.wrong {
    background: #FF6B6B20;
    border-color: #FF6B6B;
}

.explanation {
    background: #FFF9E6;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #FFCE54;
    margin-top: 25px;
}

.explanation h4 {
    color: #D4A017;
    margin-bottom: 10px;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.quiz-navigation-fixed {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.btn-nav.btn-disabled,
.btn-nav:disabled {
    background: #E8EDF3 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    border-color: transparent !important;
}

.btn-submit {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-3px);
}

.btn-finish {
    background: linear-gradient(45deg, #48CFAD, #37BC9B);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

/* --- QUIZ RESULTS --- */
.quiz-results {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.results-content {
    background: var(--white);
    padding: 50px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    position: relative;
}

/* Close Button */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F8F9FD;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-main);
    z-index: 10;
}

.modal-close-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.modal-close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

/* Modal Hint */
.modal-hint {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

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

.results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 0.6s ease;
}

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

.results-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.performance-message {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 30px;
}

.results-score {
    margin-bottom: 40px;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    box-shadow: 0 10px 40px rgba(93, 156, 236, 0.4);
}

.score-circle #finalScore {
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 1;
}

.score-total {
    font-size: 3rem;
    font-weight: 500;
    opacity: 1;
    margin-left: 3px;
}

.score-label {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 10px;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.result-stat {
    padding: 25px 20px;
    background: #F8F9FD;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
}

.stat-correct .stat-icon {
    background: #48CFAD;
    color: white;
}

.stat-wrong .stat-icon {
    background: #FF6B6B;
    color: white;
}

.stat-percentage .stat-icon {
    background: var(--primary);
    color: white;
}

.result-stat .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.result-stat .stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* --- NO CONTENT STATE --- */
.no-content {
    text-align: center;
    padding: 80px 20px;
}

.no-content svg {
    margin-bottom: 30px;
    opacity: 0.5;
}

.no-content h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.no-content p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr; }
    .content-type-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .section-title h2 { font-size: 2rem; }
    .cards-grid { grid-template-columns: 1fr; }

    /* Mobile Header - Compact and Clean */
    .site-header {
        padding: 12px 0;
    }

    .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        font-size: 1.3rem;
    }

    .logo img {
        width: 28px !important;
        height: 28px !important;
    }

    /* Show Hamburger on Mobile */
    .hamburger {
        display: flex;
    }

    /* Hide Nav by Default on Mobile */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        padding: 80px 30px 30px;
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }

    /* Show Nav when Active */
    .main-nav.active {
        right: 0;
    }

    /* Mobile Navigation Menu */
    .nav-menu {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .nav-menu > li {
        border-bottom: 1px solid #E8EDF3;
        padding: 0;
    }

    .nav-menu > li:last-child {
        border-bottom: none;
    }

    .nav-menu > li > a {
        display: block;
        padding: 18px 0;
        font-size: 1.1rem;
    }

    .nav-menu a:after {
        display: none;
    }

    /* Mobile Dropdown */
    .nav-menu .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        transform: none;
        box-shadow: none;
        background: #F8F9FD;
        border-radius: 0;
        padding: 0;
        margin-top: 0;
    }

    .nav-menu .dropdown:hover .dropdown-menu {
        display: none;
    }

    .nav-menu .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu li {
        border-bottom: 1px solid #E0E0E0;
    }

    .dropdown-menu li:last-child {
        border-bottom: none;
    }

    .dropdown-menu a {
        padding: 12px 20px !important;
        font-size: 0.95rem !important;
        font-weight: 500 !important;
    }

    .dropdown-menu a:hover {
        background: #EEF5FF;
    }

    /* Dropdown Toggle Arrow */
    .dropdown-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .dropdown-toggle:after {
        content: '\203A';
        font-size: 1.5rem;
        transform: rotate(90deg);
        transition: transform 0.3s ease;
    }

    .dropdown.active .dropdown-toggle:after {
        transform: rotate(-90deg);
    }

    /* Navigation on mobile - keep horizontal for better UX */
    .qa-navigation {
        gap: 10px;
        flex-wrap: wrap;
    }

    .qa-navigation .btn-nav {
        flex: 1 1 auto;
        min-width: 0;
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    /* Top navigation stays compact on mobile */
    .qa-navigation-top {
        padding: 12px;
        margin-bottom: 20px;
    }

    .qa-navigation-top .btn-nav {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    /* Back button can take full width on mobile for easier tapping */
    .qa-navigation .btn-back {
        order: 3;
        flex-basis: 100%;
    }

    /* Quiz navigation on mobile */
    .quiz-navigation {
        gap: 10px;
    }

    .quiz-navigation .btn-nav {
        flex: 1 1 auto;
        min-width: 0;
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .quiz-navigation-fixed {
        padding: 15px;
    }

    .quiz-navigation .btn-back {
        order: 3;
        flex-basis: 100%;
    }

    /* Quiz options on mobile - better touch targets */
    .quiz-option {
        padding: 15px;
        gap: 15px;
    }

    .option-label {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .option-text {
        font-size: 0.95rem;
    }

    /* Quiz container padding */
    .quiz-container {
        padding: 25px 20px;
    }

    /* Progress bar on mobile */
    .progress-container {
        padding: 15px;
    }

    .progress-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .quick-jump {
        justify-content: space-between;
    }

    .btn-icon {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .jump-input {
        width: 90px;
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    /* Navigator modal on mobile */
    .navigator-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
    }

    .navigator-header h3 {
        font-size: 1.2rem;
    }

    .navigator-stats {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .nav-stat {
        font-size: 0.85rem;
    }

    .question-numbers-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 8px;
    }

    .question-number-btn {
        height: 45px;
        font-size: 0.9rem;
    }

    .results-stats { grid-template-columns: 1fr; }
    .video-list-item { flex-direction: column; }
    .video-thumbnail { width: 100%; height: 150px; }
    .question-numbers { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
    .question-number { width: 40px; height: 40px; font-size: 0.85rem; }

    /* Modal improvements on mobile */
    .results-content {
        padding: 30px 20px;
        width: 95%;
        max-height: 95vh;
    }

    .results-content h2 {
        font-size: 1.8rem;
        margin-top: 10px; /* Space for close button */
    }

    .modal-close-btn {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }

    .results-icon {
        font-size: 3rem;
    }

    .performance-message {
        font-size: 1rem;
    }

    .score-circle {
        width: 120px;
        height: 120px;
    }

    .score-circle span {
        font-size: 2rem;
    }

    .score-total {
        font-size: 1.2rem !important;
    }

    .results-actions {
        flex-direction: column;
        gap: 10px;
    }

    .results-actions .btn-primary,
    .results-actions .btn-secondary {
        width: 100%;
        padding: 12px 30px;
        font-size: 1rem;
    }

    .modal-hint {
        font-size: 0.75rem;
        margin-top: 15px;
    }

    .result-stat {
        padding: 15px;
    }
}

/* --- STYLING FOR MARKDOWN CONTENT --- */
.answer-text p,
.answer-text ul,
.answer-text ol,
.answer-text h1,
.answer-text h2,
.answer-text h3,
.answer-text h4,
.answer-text h5,
.answer-text h6,
.answer-text blockquote,
.answer-text pre {
    margin-bottom: 1rem;
}

.answer-text ul,
.answer-text ol {
    padding-left: 2rem;
    list-style-position: outside;
}

.answer-text ul {
    list-style-type: disc;
}

.answer-text ol {
    list-style-type: decimal;
}

.answer-text li {
    margin-bottom: 0.5rem;
}

.answer-text code {
    background-color: #e8eaed;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
}

.answer-text pre {
    background-color: #e8eaed;
    padding: 1rem;
    border-radius: 6px;
    white-space: pre-wrap; /* For code blocks */
}

.answer-text pre code {
    padding: 0;
    background-color: transparent;
}

.answer-text blockquote {
    border-left: 4px solid #ccc;
    padding-left: 1rem;
    color: var(--text-light);
    font-style: italic;
}

/* To prevent a double margin, dont add margin to the last element */
.answer-text > :last-child {
    margin-bottom: 0;
}

