/* --- Global Styles & Variables --- */
:root {
    --primary-color: #4A90E2; /* A nice, friendly blue */
    --secondary-color: #50E3C2; /* A modern teal/mint */
--accent-color-1: #D4AF37; /* A professional gold */
    --accent-color-2: #6F42C1; /* A toned-down purple */
    --accent-color-3: #4CAF50; /* Green */
    --dark-color: #333;
    --light-color: #f4f4f4;
    --white-color: #fff;
    --font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--white-color);
    color: var(--dark-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; }
a { text-decoration: none; color: var(--primary-color); }
ul { list-style: none; }

/* --- Header & Navigation --- */
header {
    background-color: var(--white-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

header ul { display: flex; }
header ul li { margin-left: 1.5rem; }
header ul a { color: var(--dark-color); font-weight: 600; transition: color 0.3s ease; }
header ul a:hover { color: var(--primary-color); }

/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(74, 144, 226, 0.8), rgba(74, 144, 226, 0.8)), url('https://source.unsplash.com/random/1600x900/?math,geometry') no-repeat center center/cover;
    color: var(--white-color);
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-content { max-width: 800px; }
.hero p { font-size: 1.2rem; margin-bottom: 2rem; }
.cta-button {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    font-weight: 700;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cta-button:hover { transform: translateY(-3px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }

/* --- Courses Section --- */
.courses-section { padding: 4rem 0; background-color: var(--light-color); }
.courses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.course-card {
    background-color: var(--white-color);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.course-card:hover { transform: translateY(-10px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.course-card h3 { font-size: 1.8rem; margin-bottom: 1rem; }
.course-card > p { margin-top: 1rem; }
.card-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 0.6rem 1.5rem;
    border-radius: 5px;
    margin-top: auto; /* Pushes button to the bottom */
    transition: background-color 0.3s ease;
}
.card-button:hover { background-color: #357ABD; }

.course-card.level-1 { border-top: 5px solid var(--accent-color-1); }
.course-card.level-2 { border-top: 5px solid var(--accent-color-2); }
.course-card.level-3 { border-top: 5px solid var(--accent-color-3); }

/* --- Topic Buttons on Homepage --- */
.topic-buttons {
    margin: 1rem 0 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.topic-button {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.topic-button:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}


/* --- About Section --- */
.about-section { padding: 4rem 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; text-align: center; }
.feature h4 { font-size: 1.3rem; color: var(--primary-color); }

/* --- Footer --- */
footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 2rem 0;
    text-align: center;
}

footer .container { display: flex; justify-content: space-between; align-items: center; }
footer a { color: var(--secondary-color); margin: 0 0.5rem; }

/* --- Question Bank & Course Page Styles --- */
.page-header {
    background-color: var(--light-color);
    padding: 2.5rem 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
}
/* NEW: Course Navigation Buttons */
.course-nav {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.course-nav-button {
    background-color: var(--primary-color);
    color: var(--white-color);
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: 5px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.course-nav-button:hover {
    background-color: #357ABD;
    transform: translateY(-2px);
}

.question-bank {
    padding: 4rem 0;
    max-width: 800px; /* For better readability */
    margin: 0 auto;
}
.question-box, .practice-questions {
    background-color: var(--white-color);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.question-box p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}
.toggle-answer-btn {
    background-color: var(--dark-color);
    color: var(--white-color);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    transition: background-color 0.3s ease;
display: block;
margin-left: auto;
margin-right: auto;
}
.toggle-answer-btn:hover {
    background-color: #555;
}
.model-answer {
    display: none; /* Hidden by default */
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-left: 4px solid var(--secondary-color);
}
.model-answer p { font-size: 1rem; }

/* NEW: Course Content Styles */
.course-content {
    padding: 3rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.contents-box {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}
.contents-box h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}
.contents-box ol {
    list-style-type: decimal;
    list-style-position: inside;
    padding-left: 1rem;
}
.contents-box li {
    margin-bottom: 0.75rem;
}
.contents-box a {
    font-weight: 600;
}
.contents-box a:hover {
    text-decoration: underline;
}

.subtopic-section {
    padding-top: 2rem; /* Provides space for in-page links */
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
}
.subtopic-section h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
}
.example-box {
    background-color: #fdf9e3; /* Light yellow */
    border-left: 4px solid var(--accent-color-1);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 5px 5px 0;
}
.example-box p {
    margin-bottom: 0.5rem;
}


/* --- Responsiveness --- */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero { height: 50vh; }
    header .container { flex-direction: column; gap: 0.5rem; }
    footer .container { flex-direction: column; gap: 1rem; }
    .question-bank, .course-content { padding: 2rem 1rem; }
}
/* --- REVISED: Difficulty Indicator Styles --- */
.difficulty-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.difficulty-label {
    font-weight: 600;
    margin-right: 1rem;
}

.difficulty-bar-container {
    flex-grow: 1;
    max-width: 150px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 50px;
    overflow: hidden;
}

.difficulty-bar-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 0.5s ease-in-out;
}

/* --- Color Rules --- */
/* Any class containing "achieved" gets green */
[class*="achieved"] .difficulty-label { color: #28a745; }
[class*="achieved"] .difficulty-bar-fill { background-color: #28a745; }

/* Any class containing "merit" gets orange */
[class*="merit"] .difficulty-label { color: #fd7e14; }
[class*="merit"] .difficulty-bar-fill { background-color: #fd7e14; }

/* Any class containing "excellence" gets red */
[class*="excellence"] .difficulty-label { color: #dc3545; }
[class*="excellence"] .difficulty-bar-fill { background-color: #dc3545; }

/* --- Width Rules for 9 Precision Levels --- */
.achieved-low .difficulty-bar-fill    { width: 20%; }
.achieved-mid .difficulty-bar-fill    { width: 33%; }
.achieved-high .difficulty-bar-fill   { width: 45%; }

.merit-low .difficulty-bar-fill       { width: 55%; }
.merit-mid .difficulty-bar-fill       { width: 66%; }
.merit-high .difficulty-bar-fill      { width: 78%; }

.excellence-low .difficulty-bar-fill  { width: 85%; }
.excellence-mid .difficulty-bar-fill  { width: 92%; }
.excellence-high .difficulty-bar-fill { width: 100%; }

/* --- NEW: Subtopic Filter Styles --- */
.subtopic-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid #dbe9f9;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #e9f2fc;
    border-color: #a8cbf1;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

/* --- For Hiding/Showing Questions --- */
.question-box {
    /* Existing styles... */
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.question-box.hidden {
    opacity: 0;
    transform: scale(0.95);
    display: none;
}
/* --- NEW: Styled Rules List for Explanations --- */
.rules-list {
    list-style: none;
    padding-left: 0;
    margin-top: 1.5rem;
}

.rules-list li {
    background-color: #f8f9fa; /* A very light grey */
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    border-radius: 5px;
}
/* --- REVISED: Kinematics Flowchart Styles --- */
.kinematics-flow {
    background-color: #f8f9fa; /* Light grey background */
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2.5rem 1.5rem; /* Increased padding for vertical space */
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-item {
    background-color: var(--white-color);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1.2rem;
    border-radius: 5px;
    text-align: center;
    position: relative;
    z-index: 2; /* Ensures it sits above the arrow lines */
}

.flow-arrow-dual {
    position: relative; /* This is key for placing the arrows */
    width: 140px; /* Adjust space between items */
    height: 2px;
    background-color: #ccc;
    margin: 0 -5px; /* Slight overlap to connect lines smoothly */
    z-index: 1;
}

.flow-arrow-dual::before {
    content: 'Differentiate →';
    position: absolute;
    top: -25px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.flow-arrow-dual::after {
    content: '← Integrate';
    position: absolute;
    bottom: -25px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}
/* --- NEW: Page Header Color Themes --- */
.level-1-page .page-header {
    background-color: var(--accent-color-1); /* Orange */
    color: var(--white-color);
    border-bottom: none;
}

.level-2-page .page-header {
    background-color: var(--accent-color-2); /* Purple */
    color: var(--white-color);
    border-bottom: none;
}

.level-3-page .page-header {
    background-color: var(--accent-color-3); /* Green */
    color: var(--white-color);
    border-bottom: none;
}

/* Make the course nav buttons stand out on the new background */
.level-1-page .page-header .course-nav-button,
.level-2-page .page-header .course-nav-button,
.level-3-page .page-header .course-nav-button {
    background-color: var(--white-color);
    color: var(--dark-color);
}
/* --- NEW: Themed Filter Buttons --- */
/* On a Level 1 page, make the active button gold */
.level-1-page .filter-btn.active {
    background-color: var(--accent-color-1);
    border-color: var(--accent-color-1);
    color: white; /* <--- ADD THIS LINE */
}

/* On a Level 2 page, make the active button purple */
.level-2-page .filter-btn.active {
    background-color: var(--accent-color-2);
    border-color: var(--accent-color-2);
    color: white; /* <--- ADD THIS LINE */
}

/* On a Level 3 page, make the active button green */
.level-3-page .filter-btn.active {
    background-color: var(--accent-color-3);
    border-color: var(--accent-color-3);
    color: white; /* <--- ADD THIS LINE */
}
/* --- NEW: Themed Inactive Filter Buttons for Level 2 --- */

/* Default state for buttons on a Level 2 page */
.level-2-page .filter-btn {
    color: var(--accent-color-2); /* Purple text */
    border-color: #dcd4f0; /* Light purple border */
    background-color: transparent;
}


/* Hover state for inactive buttons on a Level 2 page */
.level-2-page .filter-btn:not(.active):hover {
    background-color: #f0ebf9; /* Very light purple background on hover */
    border-color: var(--accent-color-2); /* Full purple border on hover */
}
/* --- NEW: Themed Inactive Filter Buttons for Level 1 --- */

/* Default state for buttons on a Level 1 page */
.level-1-page .filter-btn {
    color: #b08d2f; /* Dark gold text */
    border-color: #f5eecf; /* Light gold border */
    background-color: transparent;
}

/* Hover state for inactive buttons on a Level 1 page */
.level-1-page .filter-btn:not(.active):hover {
    background-color: #fdfaf0; /* Very light gold/cream background on hover */
    border-color: var(--accent-color-1); /* Full gold border on hover */
}
/* --- REVISED: Past Papers Page Styles --- */
.papers-list {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.year-card {
    background-color: var(--white-color);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px S10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.year-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.year-heading {
    font-size: 2rem;
    color: var(--dark-color);
    margin: 0 0 1rem 0; /* Add margin to bottom */
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee; /* Add a separator line */
}

/* NEW: Styles for the list of subjects within a card */
.subject-papers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subject-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subject-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.year-card-links {
    display: flex;
    gap: 1rem;
}

.paper-link-btn {
    display: inline-block;
    background-color: var(--light-color);
    color: var(--dark-color);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0; /* Prevents buttons from shrinking */
}

.paper-link-btn:hover {
    background-color: var(--white-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.disclaimer {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-top: 3rem;
}

/* --- REVISED: Responsiveness for Past Papers --- */
@media (max-width: 768px) {
    .subject-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .year-card-links {
        width: 100%;
        flex-direction: column;
    }
    .paper-link-btn {
        text-align: center;
    }
}
/* --- Navigation Buttons --- */
.nav-button {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.nav-button.outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.nav-button.outline:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* --- Paywall Styles --- */

/* 1. Hide premium questions by default */
.question-box.premium {
 /*   display: none; */v
}

/* 2. Style the upgrade box */
.upgrade-box {
    background-color: #f0f8ff; /* A light blue */
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin: 3rem 0;
}

.upgrade-box h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.upgrade-box p {
    margin-bottom: 1.5rem;
}
/* --- NEW: Per-Part Difficulty Tags --- */
.part-difficulty {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    color: #fff; /* White text for all tags */
}

.part-difficulty.achieved {
    background-color: #28a745; /* Green */
}

.part-difficulty.merit {
    background-color: #fd7e14; /* Orange */
}

.part-difficulty.excellence {
    background-color: #dc3545; /* Red */
}