/* Base Styles from index.html */
:root {
    --primary-color: #087f8c; /* Deep Teal */
    --primary-dark: #066a74;
    --primary-light: #e6f2f3;
    --secondary-color: #5aaa95; /* Muted Green */
    --accent-color: #f7b801; /* Gold Accent */
    --text-color: #2d3748; /* Dark Gray */
    --secondary-text: #718096; /* Medium Gray */
    --background-color: #f7fafc; /* Very Light Gray */
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --gradient-start: #e6f2f3;
    --gradient-end: #ffffff;
    --transition-speed: 0.3s;
    --animation-duration: 0.6s;
    --header-height: 70px; /* Consistent header height */
    --radius: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* Dark Theme from index.html */
body.dark-theme {
    --primary-color: #14b8a6;
    --primary-dark: #0f766e;
    --primary-light: #374151;
    --secondary-color: #5eead4;
    --accent-color: #facc15;
    --text-color: #e5e7eb;
    --secondary-text: #9ca3af;
    --background-color: #111827;
    --card-background: #1f2937;
    --border-color: #4b5563;
    --shadow-light: rgba(255, 255, 255, 0.04);
    --shadow-medium: rgba(255, 255, 255, 0.08);
    --gradient-start: #111827;
    --gradient-end: #1f2937;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background var(--transition-speed), color var(--transition-speed);
}

/* Animations from index.html */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Utilities from index.html */
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.section { padding: 80px 0; overflow: hidden; }
.section-title { text-align: center; font-size: 2.5rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 15px; /* Animation handled by JS */ }
.section-subtitle { text-align: center; font-size: 1.1rem; color: var(--secondary-text); max-width: 600px; margin: 0 auto 50px auto; /* Animation handled by JS */ }
.btn { display: inline-block; padding: 14px 30px; border-radius: var(--radius); text-decoration: none; font-weight: 600; transition: all var(--transition-speed) ease-out, transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; border: 2px solid transparent; text-align: center; box-shadow: var(--shadow); }
.btn-primary { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 25px rgba(0,0,0,0.08); }
.btn-secondary { background-color: var(--card-background); color: var(--primary-color); border-color: var(--primary-color); }
.btn-secondary:hover { background-color: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 25px rgba(0,0,0,0.08); }

/* Header from index.html */
.main-header { background-color: var(--card-background); box-shadow: 0 2px 10px var(--shadow-light); padding: 0; /* Padding handled by container */ position: fixed; /* Changed to fixed */ top: 0; left: 0; width: 100%; z-index: 101; /* Increased z-index */ transition: background-color var(--transition-speed), box-shadow var(--transition-speed), color var(--transition-speed); height: var(--header-height); display: flex; align-items: center; backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px); /* Safari compatibility */ }
.header-container { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0 5%; /* Use percentage padding */ max-width: 1200px; margin: 0 auto; }
.logo { font-size: 1.8rem; font-weight: 700; color: var(--primary-color); text-decoration: none; display: flex; align-items: center; gap: 10px; transition: transform var(--transition-speed), color var(--transition-speed); }
.logo i { font-size: 1.2em; }
.logo:hover { transform: scale(1.03); }
.header-actions { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 15px; }
.nav-link { padding: 8px 16px; border-radius: 6px; text-decoration: none; font-weight: 500; transition: all var(--transition-speed) ease-out; border: 1px solid transparent; }
.nav-link.student { background-color: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-light); }
.nav-link.student:hover { background-color: var(--primary-color); color: white; border-color: var(--primary-color); transform: translateY(-2px); }
.nav-link.instructor { background-color: transparent; color: var(--primary-color); border-color: var(--primary-color); }
.nav-link.instructor:hover { background-color: var(--primary-color); color: white; transform: translateY(-2px); }
.theme-toggle-btn { background: none; border: none; color: var(--secondary-text); font-size: 1.4rem; cursor: pointer; padding: 5px; line-height: 1; transition: color var(--transition-speed), transform var(--transition-speed); }
.theme-toggle-btn:hover { color: var(--primary-color); transform: scale(1.1) rotate(15deg); }
.theme-toggle-btn .fa-sun { display: none; }
body.dark-theme .theme-toggle-btn .fa-sun { display: inline-block; }
body.dark-theme .theme-toggle-btn .fa-moon { display: none; }

/* --- User Dropdown Menu Styles (Moved from student_dashboard.html) --- */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.user-profile {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}
.user-name {
    font-weight: 500;
    color: var(--text-color);
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px); /* Position below header */
    right: 0;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--shadow-medium);
    border: 1px solid var(--border-color);
    min-width: 200px;
    display: none; /* Initially hidden */
    z-index: 110; /* Ensure above other content */
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity var(--transition-speed) ease-out, transform var(--transition-speed) ease-out;
}
.dropdown-menu.show {
    display: block; /* Show when class is added */
    opacity: 1;
    transform: translateY(0);
}
.dropdown-item {
    padding: 12px 18px;
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    font-size: 0.95rem;
    white-space: nowrap;
}
.dropdown-item i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    color: var(--secondary-text);
    transition: color var(--transition-speed);
}
.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}
.dropdown-item:hover i {
    color: var(--primary-dark);
}
.dropdown-item.logout {
    color: #c81e1e; /* Error color */
    border-top: 1px solid var(--border-color);
}
.dropdown-item.logout:hover {
    background-color: rgba(200, 30, 30, 0.1);
}
.dropdown-item.logout i {
    color: #c81e1e;
}
/* --- End User Dropdown Menu Styles --- */

/* Hero Section from index.html */
.hero { text-align: center; padding: 100px 0; padding-top: calc(100px + var(--header-height)); /* Adjust padding top for fixed header */ position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: radial-gradient(var(--border-color) 1px, transparent 1px); background-size: 20px 20px; opacity: 0.2; z-index: -1; transition: background-image var(--transition-speed); }
body.dark-theme .hero::before { background-image: radial-gradient(var(--border-color) 0.5px, transparent 0.5px); opacity: 0.1; }
.hero-content { position: relative; z-index: 1; }
.hero h1 { font-size: 3.5rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 20px; line-height: 1.2; /* Animation handled by JS */ }
.hero h1 span { color: var(--secondary-color); }
.hero p { font-size: 1.2rem; color: var(--secondary-text); max-width: 650px; margin: 0 auto 40px auto; /* Animation handled by JS */ }
.hero .btn { /* Animation handled by JS */ padding: 16px 35px; font-size: 1.1rem; }

/* Features Section from index.html */
#features { background-color: var(--primary-light); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }
.feature-card { background-color: var(--card-background); padding: 35px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; border: 1px solid var(--border-color); transition: transform var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed), border-color var(--transition-speed); /* Animation handled by JS */ }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.feature-icon { font-size: 2.8rem; color: var(--primary-color); margin-bottom: 20px; display: inline-block; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; }
.feature-card h3 { font-size: 1.4rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 10px; transition: color var(--transition-speed); }
.feature-card p { font-size: 0.95rem; color: var(--secondary-text); line-height: 1.6; transition: color var(--transition-speed); }

/* --- NEW Scrolling Features Section (from index-test.html, modified) --- */
#scrolling-features {
    /* margin-top: var(--header-height); */ /* Removed, handled by hero padding */
    padding-top: 80px;
    padding-bottom: 80px;
    position: relative;
    overflow: visible; /* Allow potential overflows if needed, or keep hidden */
}

/* Background dimming overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Increased dimming */
    opacity: 0;
    z-index: 5; /* Below sticky container */
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Scroll content container */
.scroll-wrapper {
    /* Height calculated dynamically based on content + viewport */
    position: relative;
}

/* Sticky container for the content */
.scroll-container {
    height: calc(100vh - var(--header-height) - 40px); /* Sticky area height */
    position: sticky;
    top: calc(var(--header-height) + 20px); /* Stick below header with margin */
    /* background-color: var(--card-background); */ /* REMOVED background */
    /* border-radius: 12px; */ /* REMOVED border-radius */
    /* box-shadow: 0 8px 30px var(--shadow-medium); */ /* REMOVED shadow */
    display: flex;
    overflow: visible; /* Allow content to potentially overflow if needed */
    z-index: 10; /* Above overlay */
    width: 100%; /* Ensure it spans width */
    max-width: 1200px; /* Match container width */
    margin: 0 auto; /* Center */
    padding: 0 15px; /* Match container padding */
}

/* Progress indicator (optional visual) */
.progress-indicator {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 20; /* Above everything */
}
.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--border-color);
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}
.progress-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.3);
}
body.dark-theme .progress-dot { background-color: var(--border-color); }
body.dark-theme .progress-dot.active { background-color: var(--primary-color); }


/* Content layout columns */
.text-column {
    flex: 1;
    padding-right: 40px; /* Space between text and image */
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.visual-column {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* For absolute positioning of images */
}

/* Text section styling */
.content-text {
    /* Individual text block */
    opacity: 0; /* Controlled by JS */
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: absolute; /* Stack text blocks */
    width: 100%; /* Take full width of text-column */
}
.content-text.visible {
    opacity: 1;
    transform: translateY(0);
    position: relative; /* Allow visible block to take space */
}
.content-text h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 15px;
}
.content-text p {
    font-size: 1.1rem;
    color: var(--secondary-text);
}

/* Image section styling */
.content-image {
    max-width: 100%; /* Max width within visual-column */
    max-height: 70vh; /* Limit height */
    object-fit: contain;
    border-radius: 12px;
    /* box-shadow: 0 10px 30px var(--shadow-medium); */ /* Optional shadow on image */
    opacity: 0; /* Controlled by JS */
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: absolute; /* Stack images */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
}
.content-image.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    position: absolute; /* Keep absolute when visible */
}

/* Trigger sections (invisible elements for tracking scroll position) */
.scroll-triggers {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%; /* Cover the entire scroll-wrapper height */
     z-index: -1; /* Behind content */
}
.scroll-trigger {
    height: 100vh; /* Each trigger is viewport height */
    width: 100%;
    position: absolute; /* Positioned absolutely within scroll-triggers */
    left: 0;
    /* Top position set by JS */
}

/* --- Get Started Section from index.html --- */
.get-started-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; align-items: stretch; }
.access-card { background: linear-gradient(145deg, var(--card-background), var(--gradient-start)); padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); display: flex; flex-direction: column; justify-content: space-between; text-align: center; transition: transform var(--transition-speed), box-shadow var(--transition-speed), background var(--transition-speed), border-color var(--transition-speed); /* Animation handled by JS */ }
.access-card:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.access-card h2 { font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 15px; display: flex; align-items: center; justify-content: center; gap: 12px; transition: color var(--transition-speed); }
.access-card h2 i { color: var(--secondary-color); font-size: 1.2em; transition: color var(--transition-speed); }
.access-card p { font-size: 1rem; color: var(--secondary-text); margin-bottom: 30px; flex-grow: 1; transition: color var(--transition-speed); }
.access-card .btn { width: 100%; margin-bottom: 15px; }
.signup-prompt { font-size: 0.9rem; color: var(--secondary-text); transition: color var(--transition-speed); }
.signup-prompt a { color: var(--primary-color); font-weight: 600; text-decoration: none; transition: color var(--transition-speed); }
.signup-prompt a:hover { color: var(--primary-dark); text-decoration: underline; }

/* --- Footer from index.html --- */
.main-footer { background-color: var(--primary-light); padding: 40px 0; text-align: center; margin-top: auto; color: var(--secondary-text); font-size: 0.9rem; border-top: 1px solid var(--border-color); transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed); }

/* --- Loading Overlay from index.html --- */
.loading-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(247, 250, 252, 0.9); z-index: 1000; justify-content: center; align-items: center; transition: background-color var(--transition-speed); }
body.dark-theme .loading-overlay { background-color: rgba(17, 24, 39, 0.9); }
.loading-spinner { width: 60px; height: 60px; border: 6px solid var(--primary-light); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; transition: border-color var(--transition-speed); }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    /* Keep existing 992px styles for hero, titles etc. */
    .hero h1 { font-size: 3rem; }
    .hero p { font-size: 1.1rem; }
    .section-title { font-size: 2.2rem; }

    /* Tablet styles for scroll section (from test file) */
     .scroll-container {
        flex-direction: column;
        height: auto; /* Let content determine height */
        position: relative; /* Not sticky on tablet */
        top: 0;
        padding: 30px;
        /* Re-add background/shadow for non-sticky view */
         background-color: var(--card-background);
         border-radius: 12px;
         box-shadow: 0 8px 30px var(--shadow-medium);
    }
     .text-column { padding-right: 0; padding-bottom: 30px; }
     .visual-column { min-height: 40vh; }
     .content-text, .content-image { position: relative; transform: none; opacity: 1; } /* Show all */
     .content-image { position: relative; transform: translate(0, 0) scale(1); } /* Reset absolute positioning */
     .scroll-wrapper { height: auto !important; } /* Override JS height */
     .scroll-triggers, .progress-indicator, .overlay { display: none; } /* Hide JS elements */
     #scrolling-features { height: auto; } /* Override section height */

    .carousel-track > .card {
        flex: 0 0 auto;
        width: 100%; /* Full width to match static cards */
        max-width: none; /* Remove max-width restriction */
        min-width: none; /* Remove min-width restriction */
        margin: 0 10px;
    }
    .carousel-track {
        padding: 5px 45px; /* Adjust arrow spacing */
    }
    .carousel-pagination {
        padding: 0 50px; /* Adjust padding for smaller arrows */
    }
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Keep existing 768px styles */
    .header-container { flex-direction: column; gap: 15px; }
    .header-actions { width: 100%; justify-content: space-between; }
    .nav-links { justify-content: center; }
    .hero { padding: 80px 0; padding-top: calc(80px + var(--header-height)); }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    .section { padding: 60px 0; }
    .section-title { font-size: 2rem; }
    .section-subtitle { margin-bottom: 40px; }
    .features-grid { gap: 30px; }
    .get-started-grid { gap: 30px; }
    .access-card { padding: 30px; }

    /* Mobile styles for scroll section (from test file, adapted) */
    .scroll-container {
        flex-direction: column;
        height: auto;
        position: relative;
        top: 0;
        padding: 20px;
        background-color: transparent; /* No background */
        box-shadow: none; /* No shadow */
        border-radius: 0;
    }
    .text-column { padding-right: 0; padding-bottom: 20px; }
    .visual-column { min-height: 30vh; }
    .content-text, .content-image { position: relative; transform: none; opacity: 1; }
    .content-image { position: relative; transform: translate(0, 0) scale(1); max-width: 90%; margin: 0 auto; }
    .scroll-wrapper { height: auto !important; }
    .scroll-triggers, .progress-indicator, .overlay { display: none; }
    #scrolling-features { height: auto; padding: 60px 0; } /* Adjust padding */
    .scroll-text-item h3 { font-size: 1.5rem; }
    .scroll-text-item p { font-size: 0.95rem; }

    .carousel-track > .card {
        flex: 0 0 auto;
        width: 100%; /* Full width to match static cards */
        max-width: none; /* Remove max-width restriction */
        min-width: none; /* Remove min-width restriction */
        margin: 0 8px;    /* Slightly reduce margin */
    }
    .carousel-track {
        padding: 5px 10px; /* Less padding as cards are wider or arrows smaller */
        /* Consider enabling scroll snap for mobile if JS isn't the primary scroll mechanism */
        /* overflow-x: auto; */
        /* scroll-snap-type: x mandatory; */
    }
    .carousel-pagination {
        padding: 0 45px; /* Adjust padding for smaller arrows */
    }
    .carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    /* Keep existing 576px styles */
    body { font-size: 15px; }
    .header-actions { flex-wrap: wrap; justify-content: center; gap: 10px; }
    .nav-links { gap: 10px; flex-wrap: wrap; justify-content: center; }
    .nav-link { padding: 6px 12px; font-size: 0.9rem; }
    .hero { padding: 60px 0; padding-top: calc(60px + var(--header-height)); }
    .hero h1 { font-size: 2rem; }
    .hero p { max-width: 90%; }
    .btn { padding: 12px 25px; font-size: 0.95rem; }
    .feature-card { padding: 25px; }
    .feature-icon { font-size: 2.5rem; }
    .feature-card h3 { font-size: 1.2rem; }
    .access-card h2 { font-size: 1.5rem; }
    .main-footer { padding: 30px 0; }

    .carousel-track > .card {
        flex: 0 0 auto;
        width: 100%; /* Full width to match static cards */
        max-width: none; /* Remove max-width restriction */
        min-width: none; /* Remove min-width restriction */
        margin: 0 5px;    /* Further reduce margin */
    }
    .carousel-pagination {
        padding: 0 40px; /* Adjust padding for mobile */
    }
    .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
}


/* Add this to your main CSS file (like main.css) */

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
}

.modal-content {
    background-color: #fff;
    margin: 8% auto;
    padding: 30px;
    border: 1px solid #ccc;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

#close-popup-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

#close-popup-btn:hover {
    color: #333;
}

#popup-student-name {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    font-weight: bold;
}

#engagement-chart {
    margin-top: 20px;
}
/* --- Video Popup Modal Styles --- */
.video-popup-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1050; /* Ensure it's above other content */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling on the body */
    background-color: rgba(0, 0, 0, 0.75); /* Darker backdrop */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.video-popup-modal.active { /* Class to add via JS to show */
    display: flex;
    opacity: 1;
}

.video-popup-content {
    position: relative;
    background-color: var(--card-background, #fff); /* Use theme variable */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px; /* Adjust max width as needed */
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
}

.video-popup-modal.active .video-popup-content {
    transform: scale(1);
}

.video-popup-close-button {
    position: absolute;
    top: -10px; /* Position slightly outside */
    right: -10px; /* Position slightly outside */
    background-color: #e74c3c; /* Red close button */
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 28px; /* Center the 'x' */
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: background-color 0.2s;
    z-index: 1051; /* Above content */
}

.video-popup-close-button:hover {
    background-color: #c0392b; /* Darker red on hover */
}

.video-popup-loader {
    padding: 30px;
    font-size: 1.2rem;
    color: var(--text-color);
}

#video-popup-iframe {
    width: 100%;
    aspect-ratio: 16 / 9; /* Maintain aspect ratio */
    border: none; /* Remove iframe border */
    border-radius: 4px; /* Optional: slightly rounded corners */
    display: none; /* Hidden until loaded */
}
/* Carousel Styles */
.carousel-container {
    position: relative;
    overflow: hidden; /* Ensures content outside slots is clipped */
    width: 100%; /* Takes full width of its parent */
    padding: 0 0 20px 0; /* Reduced top padding, adjust bottom as needed */
    margin-bottom: 30px; /* Consistent with other cards */
    transition: height 0.3s ease-in-out; /* Smooth height transition */
    align-self: flex-start;
}

.carousel-track {
    display: flex;
    /* transition: transform 0.5s ease-in-out; /* For JS-driven sliding */
    /* No gap needed here, slots will manage their own width */
}

.carousel-slot {
    flex: 0 0 100%; /* Each slot takes 100% of the container's width */
    display: flex;
    justify-content: center; /* Center the card horizontally within the slot */
    align-items: flex-start; /* Align card to the top of the slot */
    padding: 20px; /* Padding around the card inside the slot */
    box-sizing: border-box; /* Ensure padding is included in the 100% width */
}

/* Styling for cards specifically within the carousel-slot */
.carousel-slot .card {
    width: 100%; /* Make carousel cards take full width like static cards */
    max-width: none; /* Remove max-width restriction */
    min-width: none; /* Remove min-width restriction */
    margin: 0; /* Slot handles spacing/centering, remove card's own margin */
    max-height: 700px; /* Set a longer max height for carousel cards */
    overflow-y: auto; /* Enable vertical scrolling when content overflows */
    /* Existing card styles (padding, borders, etc.) are inherited or should be checked */
    /* Ensure card's own padding doesn't conflict with slot padding if desired */
    /* Example: if card has padding: 30px, and slot has padding: 20px,
       the content inside card will be 20px from slot edge, then 30px from card edge.
    */
    /* align-self: stretch; /* This might not be needed if slot handles alignment */
}

.carousel-arrow {
    position: absolute;
    top: 50%; /* Center vertically with pagination items */
    transform: translateY(-50%); /* Center the arrow */
    background-color: var(--card-background);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10; /* Above track content */
    box-shadow: var(--shadow-light);
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed), transform var(--transition-speed);
    -webkit-user-select: none; /* Safari */
    user-select: none; /* Prevent text selection on click */
}

.carousel-arrow.prev {
    left: 0; /* Position at the left edge of pagination container */
}

.carousel-arrow.next {
    right: 0; /* Position at the right edge of pagination container */
}

.carousel-arrow:hover {
    background-color: var(--primary-color);
    color: var(--card-background);
    border-color: var(--primary-dark);
    transform: translateY(-50%) scale(1.05); /* Maintain centering while scaling */
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95); /* Maintain centering while scaling */
}

/* Responsive adjustments for carousel */
@media (max-width: 1200px) {
    .carousel-track > .card {
        flex: 0 0 auto;
        width: 100%; /* Full width to match static cards */
        max-width: none; /* Remove max-width restriction */
        min-width: none; /* Remove min-width restriction */
        margin: 0 10px;
    }
}

@media (max-width: 992px) {
    .carousel-track > .card {
        flex: 0 0 auto;
        width: 100%; /* Full width to match static cards */
        max-width: none; /* Remove max-width restriction */
        min-width: none; /* Remove min-width restriction */
        margin: 0 10px;
    }
    .carousel-track {
        padding: 5px 45px; /* Adjust arrow spacing */
    }
    .carousel-pagination {
        padding: 0 50px; /* Adjust padding for smaller arrows */
    }
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .carousel-track > .card {
        flex: 0 0 auto;
        width: 100%; /* Full width to match static cards */
        max-width: none; /* Remove max-width restriction */
        min-width: none; /* Remove min-width restriction */
        margin: 0 8px;    /* Slightly reduce margin */
    }
    .carousel-track {
        padding: 5px 10px; /* Less padding as cards are wider or arrows smaller */
        /* Consider enabling scroll snap for mobile if JS isn't the primary scroll mechanism */
        /* overflow-x: auto; */
        /* scroll-snap-type: x mandatory; */
    }
    /* .carousel-track > .card { scroll-snap-align: start; } */

    .carousel-pagination {
        padding: 0 45px; /* Adjust padding for smaller arrows */
    }
    .carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .carousel-track > .card {
        flex: 0 0 auto;
        width: 100%; /* Full width to match static cards */
        max-width: none; /* Remove max-width restriction */
        min-width: none; /* Remove min-width restriction */
        margin: 0 5px;    /* Further reduce margin */
    }
    .carousel-pagination {
        padding: 0 40px; /* Adjust padding for mobile */
    }
    .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
}
/* Carousel Pagination Styles - Updated to include arrows */
.carousel-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px; /* Adjusted margin */
    margin-bottom: 25px; /* Increased bottom margin */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 10px; /* Spacing between pagination items */
    position: relative; /* For absolute positioning of arrows */
    padding: 0 60px; /* Add padding to make room for arrows */
}

/* Styles for the new text-based pagination items */
.carousel-pagination-name {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed), transform var(--transition-speed);
    box-shadow: var(--shadow-light);
}

.carousel-pagination-name:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.carousel-pagination-name.active {
    background-color: var(--primary-dark);
    color: white;
    border-color: var(--primary-dark);
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transform: translateY(-1px); /* Slight lift for active state */
}

/* Lectures List Scroll Styling */
.carousel-slot .card .lectures-list {
    max-height: 500px; /* Set max height for the lectures list specifically */
    overflow-y: auto; /* Enable scrolling for the lectures list */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--primary-light) var(--card-background); /* Firefox */
}

/* Webkit scrollbar styling for lectures list */
.carousel-slot .card .lectures-list::-webkit-scrollbar {
    width: 8px;
}

.carousel-slot .card .lectures-list::-webkit-scrollbar-track {
    background: var(--card-background);
    border-radius: 4px;
}

.carousel-slot .card .lectures-list::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 4px;
    border: 1px solid var(--card-background);
}

.carousel-slot .card .lectures-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color);
}

/* Ensure lectures container takes available space */
.carousel-slot .card #lectures-container {
    min-height: 0; /* Allow shrinking */
}

/* Active Lecture Context Display - Used across all carousel cards */
.active-lecture-context {
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--primary-light);
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    display: none;
    transition: all 0.3s ease;
}

.active-lecture-context.show {
    display: block;
}

.active-lecture-context p {
    margin: 0;
    font-weight: 500;
    color: var(--primary-dark);
}

.active-lecture-context strong {
    font-weight: 600;
    color: var(--primary-darker, var(--primary-dark));
}

/* Dark theme support for active lecture context */
.dark-theme .active-lecture-context {
    background-color: var(--primary-darker, rgba(74, 144, 226, 0.1));
    border-color: var(--primary-light);
}

.dark-theme .active-lecture-context p {
    color: var(--primary-light);
}

.dark-theme .active-lecture-context strong {
    color: var(--primary-color);
}