/* style/header.css */

/* Define CSS variables for easier color management */
:root {
    --primary-red: #D32F2F; /* A lighter, more vibrant red */
    --primary-red-hover: #C62828; /* Slightly darker for hover states */
    --light-red: #FFCDD2; /* Very light red, suitable for backgrounds or subtle accents */
    --light-red-hover: #EF9A9A; /* Slightly darker light red for hover */

    --white: #FFFFFF;
    --light-gray-bg: #F8F8F8;
    --dark-gray-text: #333333;
    --medium-gray-text: #666666;
    --light-border: #E0E0E0;
    --lighter-gray-track: #F0F0F0;
    --sale-badge-yellow: #FFC107;
    --star-gold: #FFD700;

    /* RGB values for transparent shadows/overlays, derived from --primary-red */
    --primary-red-rgb: 211, 47, 47; 
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-gray-bg); /* Use variable */
    overflow-x: hidden;
    color: var(--dark-gray-text); /* Ensure default text color uses variable */
}

/* Professional Red and White Palette */
.bg-primary-red {
    background-color: var(--primary-red); /* Use variable */
}

.text-primary-red {
    color: var(--primary-red); /* Use variable */
}

/* This was named 'secondary-white' in previous header.php/css, assuming it's just 'white' now based on :root variables */
.bg-secondary-white {
    background-color: var(--white); /* Use variable */
}

.text-secondary-white {
    color: var(--white); /* Use variable */
}

.text-dark-gray {
    color: var(--dark-gray-text); /* Use variable */
}

.text-medium-gray {
    color: var(--medium-gray-text); /* Use variable */
}

.border-light-gray {
    border-color: var(--light-border); /* Use variable */
}

/* --- Loading Overlay Styles --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-red); /* Use variable */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Loading Spinner */
.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid var(--white); /* Use variable */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- Enhanced Animations --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 0.8s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    animation: scaleIn 0.6s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card-entry-animation {
    opacity: 0;
    transform: translateY(50px);
    animation: cardFadeInUp 1s ease-out forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes cardFadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.text-glow {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
        0 0 15px rgba(255, 255, 255, 0.6),
        0 0 20px rgba(255, 255, 255, 0.4);
}

/* --- Classroom Background Image (subtle effect) --- */
#classroom-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/circuit-board.png');
    background-size: 200px 200px;
    background-position: center;
    opacity: 0.05;
    z-index: -2;
}

/* --- Custom scrollbar --- */
body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: var(--lighter-gray-track); /* Use variable */
    border-radius: 10px;
}

body::-webkit-scrollbar-thumb {
    background-color: var(--primary-red); /* Use variable */
    border-radius: 10px;
    border: 2px solid var(--lighter-gray-track); /* Use variable */
}

body::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-red-hover); /* Use variable */
}

/* --- General Layout & Components --- */
.hero-section {
    background-image: none;
    background-color: var(--primary-red); /* Use variable */
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--white); /* Use variable */
    position: relative;
    z-index: 10;
    overflow: hidden;
}

/* New Canvas for Hero Background */
#hero-physics-bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.hero-content {
    z-index: 10;
    padding-left: 10%;
    max-width: 800px;
}

.feature-card {
    background-color: var(--white); /* Use variable */
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
    text-align: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--primary-red-rgb), 0.05); /* Use RGB for transparency */
    transform: scale(0);
    border-radius: 12px;
    transition: transform 0.3s ease-in-out;
    z-index: 0;
}

.feature-card:hover::before {
    transform: scale(1);
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-red); /* Use variable */
    border-radius: 50%;
    transition: background-color 0.3s ease-in-out;
}

.feature-card:hover .feature-icon {
    background-color: var(--light-red-hover); /* Use variable */
}

.feature-icon svg {
    color: var(--primary-red); /* Use variable */
    width: 60%;
    height: 60%;
}

/* Topic Button Style */
.topic-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white); /* Use variable */
    border: 2px solid var(--primary-red); /* Use variable */
    color: var(--dark-gray-text); /* Use variable */
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
    margin: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    min-width: 180px;
    text-align: center;
}

.topic-button:hover {
    background-color: var(--primary-red); /* Use variable */
    color: var(--white); /* Use variable */
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(var(--primary-red-rgb), 0.3); /* Use RGB for transparency */
    border-color: var(--primary-red-hover); /* Use variable */
}

.course-card {
    background-color: var(--white); /* Use variable */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    position: relative;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.sale-off-badge {
    background-color: var(--sale-badge-yellow); /* Use variable */
    color: var(--dark-gray-text); /* Use variable */
    padding: 6px 12px;
    border-top-left-radius: 12px;
    border-bottom-right-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.course-card img {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.course-card .price-old {
    color: #999999;
}

.course-card .price-new {
    color: var(--primary-red); /* Use variable */
    font-size: 1.5rem;
}

.course-card .monthly-payment {
    color: var(--medium-gray-text); /* Use variable */
    font-size: 0.85rem;
}

.course-card .star-rating {
    color: var(--star-gold); /* Use variable */
}

/* --- Navigation Bar Adjustments (Header Specific) --- */
nav {
    border-bottom: 1px solid var(--lighter-gray-track); /* Use variable */
}

/* Active Link Styles for Desktop Navigation */
.nav-link-animated.active-link {
    color: var(--primary-red);
    font-weight: 600; /* Make active links bolder */
    position: relative;
}
.nav-link-animated.active-link::after {
    content: '';
    position: absolute;
    bottom: -4px; /* Adjust as needed */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-red);
    transform: scaleX(1);
    transition: transform 0.3s ease-in-out;
}

/* Animations for Desktop Navigation Links */
.nav-link-animated {
    position: relative;
    transition: color 0.3s ease-in-out, transform 0.2s ease-out;
    padding-bottom: 5px; /* Space for underline effect */
}
.nav-link-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-red);
    transition: width 0.3s ease-out, left 0.3s ease-out;
}
.nav-link-animated:hover::after {
    width: 100%;
    left: 0;
}
/* Ensure dropdown parent also triggers hover effect on the button */
.group:hover .nav-link-animated::after {
    width: 100%;
    left: 0;
}
/* For active links, always show the underline (redundant with active-link::after but good for explicit override) */
.active-link.nav-link-animated::after {
    width: 100%;
    left: 0;
}

/* Auth Buttons Animations */
.auth-button-animation {
    transition: all 0.3s ease-in-out;
}
.auth-button-animation:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Desktop Dropdown specific styles (Notes, Courses, Profile) */
/* This will override some Tailwind `invisible` behavior for smoother animation */
.group .absolute {
    opacity: 0;
    visibility: hidden; /* Start hidden */
    transform: translateY(5px); /* Start slightly below final position */
    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s ease-out;
    pointer-events: none; /* Prevent interaction when hidden */
    z-index: 40; /* Ensure it's above other content */
    min-width: 160px; /* Give dropdowns a fixed width */
}

.group:hover .absolute {
    opacity: 1;
    visibility: visible; /* Become visible */
    transform: translateY(0); /* Move to final position */
    pointer-events: auto; /* Enable interaction when visible */
}


/* General nav hover for text colors */
nav a:hover {
    color: var(--primary-red); /* Use variable */
    transform: translateY(-2px); /* Already exists, keeping it */
}

nav button.border-primary-red {
    border-color: var(--primary-red); /* Use variable */
    color: var(--primary-red); /* Use variable */
}

nav button.border-primary-red:hover {
    background-color: var(--light-red); /* Use variable */
}

nav button.bg-primary-red {
    background-color: var(--primary-red); /* Use variable */
}

nav button.bg-primary-red:hover {
    background-color: var(--primary-red-hover); /* Use variable */
}

nav .fa-shopping-cart:hover {
    transform: scale(1.1);
    color: var(--primary-red); /* Use variable */
}


/* --- Section Headings --- */
h2,
h3 {
    color: var(--dark-gray-text); /* Use variable */
}

.underline-yellow {
    background-color: var(--sale-badge-yellow); /* Use variable */
}

.underline-blue {
    background-color: var(--primary-red); /* Use variable */
}

/* --- Statistics Section Styles --- */
.stats-card {
    background-color: var(--white); /* Use variable */
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
    text-align: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.stats-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-red); /* Use variable */
    border-radius: 50%;
}

.stats-icon svg {
    color: var(--primary-red); /* Use variable */
    width: 50%;
    height: 50%;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-red); /* Use variable */
    line-height: 1;
    display: inline-block;
    min-width: 50px;
}

.stats-label {
    font-size: 1rem;
    color: var(--medium-gray-text); /* Use variable */
    margin-top: 0.5rem;
}

/* --- Testimonial Section Styles --- */
.testimonial-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    background-color: #FDFDFD;
    background-image: url('https://www.transparenttextures.com/patterns/clean-gray-paper.png');
    background-size: 100px 100px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.testimonial-card {
    background-color: var(--white); /* Use variable */
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.testimonial-quote {
    font-size: 1.1rem;
    color: var(--dark-gray-text); /* Use variable */
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-style: italic;
    position: relative;
    padding-left: 20px;
}

.testimonial-quote::before {
    content: "\201C";
    font-family: serif;
    font-size: 4em;
    color: var(--primary-red); /* Use variable */
    position: absolute;
    left: -10px;
    top: -20px;
    opacity: 0.2;
    z-index: 0;
}

.testimonial-author {
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    border: 3px solid var(--primary-red); /* Use variable */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.author-name {
    font-weight: 700;
    color: var(--dark-gray-text); /* Use variable */
}

.author-title {
    font-size: 0.95rem;
    color: var(--medium-gray-text); /* Use variable */
}

/* --- FAQ Section Styles --- */
.faq-item {
    background-color: var(--white); /* Use variable */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dark-gray-text); /* Use variable */
    cursor: pointer;
    background-color: var(--white); /* Use variable */
    border-bottom: 1px solid var(--lighter-gray-track); /* Use variable */
    transition: background-color 0.3s ease-in-out;
}

.faq-question:hover {
    background-color: var(--light-red); /* Use variable */
}

.faq-question.active {
    background-color: var(--primary-red); /* Use variable */
    color: var(--white); /* Use variable */
    border-bottom-color: var(--primary-red); /* Use variable */
}

.faq-question .icon {
    transition: transform 0.3s ease-in-out;
}

.faq-question.active .icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    color: var(--medium-gray-text); /* Use variable */
    line-height: 1.6;
}

.faq-answer.open {
    max-height: 200px; /* Adjust as needed based on content */
    padding: 1.5rem 2rem;
}

/* FAQ Illustration */
.faq-illustration {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* --- Mobile Navigation Specific Styles (Enhanced) --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Slightly darker overlay for more contrast */
    z-index: 999;
    display: none; /* Controlled by JavaScript to toggle visibility */
    opacity: 0;
    transition: opacity 0.4s ease-in-out; /* Slower, smoother fade for overlay */
}

.mobile-menu-overlay.open {
    display: block; /* Make it visible when 'open' class is added */
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    /* Changed from 'left' to 'transform' for smoother animation */
    transform: translateX(-100%); /* Initial offset to hide completely on the left */
    width: 300px; /* Consistent width */
    max-width: 80%; /* Adjust for smaller screens */
    height: 100%;
    background-color: var(--white);
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.4); /* Stronger, more defined shadow for left slide-in */
    z-index: 1000;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Faster, more responsive slide-in from left */
    padding: 2rem 1.5rem; /* Increased vertical padding */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto; /* Enable scrolling for long menus */
}

.mobile-menu.open {
    transform: translateX(0); /* Slides into view from the left */
}

.mobile-menu-close {
    align-self: flex-end; /* Keeps the close button to the right within the left-aligned menu */
    font-size: 2.2rem; /* Slightly larger icon */
    color: var(--medium-gray-text); /* Softer initial color */
    cursor: pointer;
    margin-bottom: 2rem; /* More space below close button */
    transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
    padding: 5px; /* Add some padding for easier clicking */
}

.mobile-menu-close:hover {
    color: var(--primary-red);
    transform: rotate(90deg) scale(1.1); /* Rotate and slightly grow on hover */
}

.mobile-nav-link,
.mobile-nav-button {
    display: block;
    width: 100%;
    padding: 1rem 1.2rem; /* Increased padding for better touch targets */
    text-align: left;
    font-size: 1.15rem; /* Slightly larger font size */
    color: var(--dark-gray-text);
    text-decoration: none;
    transition: background-color 0.3s ease-out, color 0.3s ease-out, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smoother transition */
    border-radius: 10px; /* Slightly more rounded corners */
    margin-bottom: 0.6rem; /* Slightly more space between items */
    font-weight: 500; /* Medium font weight */
}

.mobile-nav-link:hover,
.mobile-nav-button:hover {
    background-color: var(--light-red);
    color: var(--primary-red);
    transform: translateX(8px); /* More pronounced slide effect */
}

/* Specific button styles for login/signup */
.mobile-nav-button.login {
    border: 2px solid var(--primary-red); /* Thicker border */
    color: var(--primary-red);
    background-color: transparent;
    margin-top: 1.5rem; /* More space above login button */
    text-align: center;
    font-weight: 600; /* Bolder text */
    padding: 0.9rem 1.2rem; /* Adjusted padding for buttons */
}

.mobile-nav-button.login:hover {
    background-color: var(--primary-red); /* Fill with red on hover */
    color: var(--white); /* White text on hover */
    transform: translateX(0); /* No slide for buttons on hover to feel more like a primary action */
}

.mobile-nav-button.signup {
    background-color: var(--primary-red);
    color: var(--white);
    margin-top: 0.8rem; /* Space between login and signup */
    text-align: center;
    font-weight: 600;
    padding: 0.9rem 1.2rem; /* Adjusted padding for buttons */
}

.mobile-nav-button.signup:hover {
    background-color: var(--primary-red-hover);
    transform: translateX(0); /* No slide for buttons on hover */
}

/* Active link styling for mobile menu */
.mobile-nav-link.active-link {
    background-color: var(--primary-red);
    color: var(--white);
    font-weight: 700; /* Make active link bolder */
    transform: translateX(0); /* No slide for active link */
}

.mobile-nav-link.active-link:hover {
    background-color: var(--primary-red-hover); /* Slightly darker on hover for active link */
}

/* Mobile dropdowns within the menu */
.mobile-dropdown-content {
    margin-left: 1rem; /* Adjust if needed */
    padding-left: 0.75rem; /* Indent sub-items */
    border-left: 2px solid var(--primary-red); /* Visual indicator for sub-items */
    overflow: hidden; /* Hide overflow for slide-down animation */
    max-height: 0; /* Start collapsed */
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out; /* Smooth slide down/up */
}
.mobile-dropdown-content.open-dropdown {
    /* Max-height will be set dynamically by JS to scrollHeight */
    padding-top: 0.5rem; /* Add some padding when open */
    padding-bottom: 0.5rem;
}
.mobile-dropdown-trigger i {
    transition: transform 0.2s ease; /* Smooth rotation for icon */
}

/* --- Affiliations Carousel Styles (Updated) --- */
.affiliations-carousel-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 3rem 0;
    background-color: #FDFDFD;
    background-image: url('https://www.transparenttextures.com/patterns/circuit-board.png');
    background-size: 200px 200px;
    opacity: 0.85;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.05), inset 0 -5px 15px rgba(0, 0, 0, 0.05);
}

.affiliations-carousel {
    display: flex;
    animation: scroll-left 40s linear infinite;
    white-space: nowrap;
    will-change: transform;
}

.affiliations-carousel-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 250px;
    height: 120px;
    margin: 0 2.5rem;
    opacity: 0.7;
    transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out, border-color 0.3s ease-in-out, transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 3px solid transparent;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    background-color: var(--white); /* Use variable */
}

.affiliations-carousel-item:hover {
    opacity: 1;
    border-color: var(--primary-red); /* Use variable */
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(var(--primary-red-rgb), 0.3); /* Use RGB for transparency */
}

.affiliations-carousel-item img {
    max-width: 80%;
    max-height: 80%;
    filter: grayscale(80%);
    transition: filter 0.3s ease-in-out;
}

.affiliations-carousel-item:hover img {
    filter: grayscale(0%);
}

@keyframes scroll-left {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* To duplicate items for seamless loop */
.affiliations-carousel.duplicated {
    animation: scroll-left 40s linear infinite;
}

/* Pause animation on hover */
.affiliations-carousel-container:hover .affiliations-carousel {
    animation-play-state: paused;
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
    .affiliations-carousel-item {
        width: 180px;
        height: 100px;
        margin: 0 1.5rem;
    }
    .affiliations-carousel {
        animation-duration: 25s;
    }
}

/* --- Course Section Styles (New Design) --- */
.course-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    background-color: var(--lighter-gray-track); /* Use variable */
    border-radius: 10px;
    padding: 0.5rem;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.course-tab-button {
    padding: 0.8rem 2rem;
    font-weight: 600;
    color: var(--medium-gray-text); /* Use variable */
    background-color: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    flex-grow: 1;
    text-align: center;
}

.course-tab-button.active {
    background-color: var(--primary-red); /* Use variable */
    color: var(--white); /* Use variable */
    box-shadow: 0 3px 10px rgba(var(--primary-red-rgb), 0.2); /* Use RGB for transparency */
}

.course-tab-button:hover:not(.active) {
    color: var(--primary-red); /* Use variable */
    background-color: var(--light-red); /* Use variable */
}

.course-content-wrapper {
    position: relative;
    overflow: hidden;
    padding-bottom: 2rem;
}

.course-grid {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 2rem;
}

.course-card-new {
    flex: 0 0 33.33%;
    max-width: 33.33%;
    background-color: var(--white); /* Use variable */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, opacity 0.5s ease-in-out;
    position: relative;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
}

.course-card-new.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .course-card-new {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .course-card-new {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.course-card-new:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.course-card-new img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.course-card-new-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-card-new-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-gray-text); /* Use variable */
    margin-bottom: 0.5rem;
}

.course-card-new-description {
    font-size: 0.95rem;
    color: var(--medium-gray-text); /* Use variable */
    margin-bottom: 1rem;
}

.course-card-new-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-red); /* Use variable */
    margin-top: auto;
}

.course-card-new-button {
    background-color: var(--primary-red); /* Use variable */
    color: var(--white); /* Use variable */
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease-in-out;
    margin-top: 1rem;
    display: block;
}

.course-card-new-button:hover {
    background-color: var(--primary-red-hover); /* Use variable */
}

.carousel-navigation {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 1rem;
}

.carousel-button {
    background-color: var(--primary-red); /* Use variable */
    color: var(--white); /* Use variable */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.carousel-button:hover {
    background-color: var(--primary-red-hover); /* Use variable */
    transform: scale(1.05);
}

.carousel-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* This rule was isolated, integrating it into the nav-link-animated.active-link above */
/* .active-link {
    border-bottom: 2px solid var(--primary-red);
    color: var(--primary-red);
} */