:root {
    --bg-color: #12181b;
    --bg-gradient-start: #181e21;
    --bg-gradient-end: #2a3136;
    --text-color: #EAEAEA;
    --primary-color: #28a745;
    --secondary-color: #B8860B;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.2);
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.6;
}

/* =========== Hero Section =========== */
.hero-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #0a0b1e 0%, #1a1b3a 20%, #2d1b3d 40%, #1e2a4a 60%, #0f1628 80%, #000814 100%);
}

/* Arabian Desert Night Sky Background */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Moon */
        radial-gradient(circle at 85% 20%, rgba(255, 248, 220, 0.6) 0%, rgba(255, 248, 220, 0.3) 2%, transparent 4%),
        /* Moon glow */
        radial-gradient(circle at 85% 20%, rgba(255, 248, 220, 0.1) 0%, transparent 8%),
        /* Desert dunes silhouette */
        radial-gradient(ellipse at bottom, rgba(139, 69, 19, 0.2) 0%, transparent 30%),
        /* Atmospheric layers */
        linear-gradient(180deg, transparent 70%, rgba(139, 69, 19, 0.05) 85%, rgba(160, 82, 45, 0.08) 100%);
    background-size: 100% 100%;
    animation: desertAtmosphere 25s ease-in-out infinite;
    z-index: 1;
}

/* Twinkling Stars Layer */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Large stars */
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.8) 0%, transparent 1px),
        radial-gradient(circle at 60% 15%, rgba(255, 248, 220, 0.6) 0%, transparent 1px),
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.7) 0%, transparent 1px),
        radial-gradient(circle at 75% 30%, rgba(173, 216, 230, 0.5) 0%, transparent 1px),
        radial-gradient(circle at 15% 40%, rgba(255, 248, 220, 0.6) 0%, transparent 1px),
        radial-gradient(circle at 90% 45%, rgba(255, 255, 255, 0.8) 0%, transparent 1px),
        radial-gradient(circle at 45% 8%, rgba(173, 216, 230, 0.7) 0%, transparent 1px),
        radial-gradient(circle at 25% 60%, rgba(255, 248, 220, 0.5) 0%, transparent 1px),
        radial-gradient(circle at 70% 12%, rgba(255, 255, 255, 0.6) 0%, transparent 1px),
        radial-gradient(circle at 55% 35%, rgba(173, 216, 230, 0.8) 0%, transparent 1px),
        /* Small twinkling stars */
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 0.5px),
        radial-gradient(circle at 30% 5%, rgba(255, 248, 220, 0.5) 0%, transparent 0.5px),
        radial-gradient(circle at 50% 18%, rgba(173, 216, 230, 0.4) 0%, transparent 0.5px),
        radial-gradient(circle at 80% 8%, rgba(255, 255, 255, 0.6) 0%, transparent 0.5px),
        radial-gradient(circle at 5% 35%, rgba(255, 248, 220, 0.4) 0%, transparent 0.5px),
        radial-gradient(circle at 95% 25%, rgba(173, 216, 230, 0.5) 0%, transparent 0.5px),
        radial-gradient(circle at 40% 45%, rgba(255, 255, 255, 0.4) 0%, transparent 0.5px),
        radial-gradient(circle at 85% 55%, rgba(255, 248, 220, 0.5) 0%, transparent 0.5px);
    background-size: 100% 100%;
    animation: starsTwinkle 8s ease-in-out infinite;
    z-index: 2;
}

@keyframes desertAtmosphere {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        opacity: 0.8;
    }
    25% { 
        transform: translateY(-5px) scale(1.01);
        opacity: 0.9;
    }
    50% { 
        transform: translateY(3px) scale(0.99);
        opacity: 0.85;
    }
    75% { 
        transform: translateY(-2px) scale(1.005);
        opacity: 0.95;
    }
}

@keyframes starsTwinkle {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    25% { 
        opacity: 0.7;
        transform: scale(1.1);
    }
    50% { 
        opacity: 1;
        transform: scale(0.9);
    }
    75% { 
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Desert Night Floating Elements */
.floating-element {
    position: absolute;
    border-radius: 50%;
    animation: desertWindFloat 12s ease-in-out infinite;
}

.floating-element:nth-child(1) {
    top: 15%;
    left: 10%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 248, 220, 0.15) 0%, rgba(255, 223, 0, 0.1) 30%, transparent 70%);
    animation-delay: -3s;
}

.floating-element:nth-child(2) {
    top: 70%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.1) 0%, rgba(160, 82, 45, 0.08) 40%, transparent 70%);
    animation-delay: -6s;
}

.floating-element:nth-child(3) {
    top: 30%;
    right: 25%;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(173, 216, 230, 0.12) 0%, rgba(135, 206, 235, 0.08) 30%, transparent 70%);
    animation-delay: -9s;
}

@keyframes desertWindFloat {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg) scale(1);
        opacity: 0.6;
    }
    25% { 
        transform: translateY(-15px) translateX(5px) rotate(90deg) scale(1.1);
        opacity: 0.8;
    }
    50% { 
        transform: translateY(-8px) translateX(-3px) rotate(180deg) scale(0.9);
        opacity: 0.4;
    }
    75% { 
        transform: translateY(-20px) translateX(8px) rotate(270deg) scale(1.05);
        opacity: 0.7;
    }
}

.hero-content-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    width: 100%;
    max-width: 1400px;
    padding: 80px 50px;
}

.hero-text-content {
    flex: 1;
    max-width: 650px;
    z-index: 15;
}

.course-badge {
    display: inline-block;
    background: linear-gradient(45deg, rgba(184, 134, 11, 0.2), rgba(255, 215, 0, 0.2));
    border: 1px solid rgba(184, 134, 11, 0.3);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    color: #FFD700;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
    animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.4), 0 0 40px rgba(184, 134, 11, 0.2); }
}

.main-headline {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 4.5rem);
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 50%, #e6e6fa 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 25px 0;
    line-height: 1.1;
    animation: titleShimmer 4s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 20px 0;
    line-height: 1.6;
    font-weight: 400;
}

.course-highlight {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    padding: 15px 0;
    border-left: 3px solid var(--secondary-color);
    padding-left: 20px;
    background: rgba(184, 134, 11, 0.05);
    border-radius: 0 10px 10px 0;
}

.highlight-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, var(--secondary-color), #FFD700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    font-size: 0.8rem;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.highlight-text {
    font-size: 1rem;
    color: #FFD700;
    font-weight: 600;
}

.hero-image-container {
    flex: 0 0 450px;
    position: relative;
    z-index: 12;
}

.image-wrapper {
    position: relative;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(25px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 10px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 35px 70px rgba(0, 0, 0, 0.5),
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.hero-image-container img {
    width: 100%;
    border-radius: 15px;
    display: block;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.hero-image-container:hover img {
    transform: scale(1.01);
}

.cta-button {
    background: linear-gradient(45deg, var(--secondary-color), #FFD700);
    color: #111;
    text-decoration: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: inline-block;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.4);
}

/* =========== Main Content Wrapper =========== */
.main-content-wrapper {
    background: linear-gradient(180deg, var(--bg-gradient-start), var(--bg-gradient-end));
}

/* =========== General Section Styling =========== */
.key-info-section, .subjects-section, .video-intro-section, .course-preview-section {
    padding: 80px 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0 0 60px 0;
    text-align: center;
}

/* =========== Key Info Section =========== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.info-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
}

.info-card h4 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin: 0 0 20px 0;
    color: var(--primary-color);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    display: inline-block;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card li {
    margin-bottom: 10px;
    font-size: 1rem;
}

/* =========== Course Content Preview Section =========== */
.chapter-preview-accordion {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
}

.chapter-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chapter-preview-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chapter-preview-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin: 0;
    flex: 1;
    color: var(--text-color);
}

.chapter-preview-count {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 20px;
}

.accordion-preview-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.chapter-preview-content {
    padding: 0 30px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
}

.chapter-preview-accordion.active .chapter-preview-content {
    max-height: 1000px; /* Adjust if content is taller */
    padding: 20px 30px;
}

.chapter-preview-accordion.active .accordion-preview-icon {
    transform: rotate(180deg);
}

.video-preview-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.video-preview-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 15px;
}

.video-preview-item:not(:last-child) {
    border-bottom: 1px solid var(--glass-border);
}

.video-preview-icon {
    background-color: rgba(40, 167, 69, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.video-preview-icon svg {
    width: 18px;
    height: 18px;
    fill: var(--primary-color);
}

.video-preview-details {
    flex: 1;
}

.video-preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: var(--text-color);
}

.video-preview-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}


/* =========== Subjects & CTA Section =========== */
.subjects-section {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: stretch;
    gap: 60px;
    border-top: 1px solid var(--glass-border);
}

.subjects-list-container {
    /* No specific styles needed here now */
}

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

.subject-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 18px;
    border-radius: 8px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.subject-item::before {
    content: '\2714'; /* Checkmark character */
    color: #fff;
    background-color: var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.subjects-cta-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--glass-bg);
    padding: 50px;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    gap: 25px;
}

.cta-image {
    width: 75%;
    max-width: 300px;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.subjects-cta-container p {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    max-width: 280px;
    text-align: center;
}

/* =========== Authentication Styles =========== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0b1e 0%, #1a1b3a 20%, #2d1b3d 40%, #1e2a4a 60%, #0f1628 80%, #000814 100%);
    position: relative;
}

/* Desert Night Sky Background for Auth */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 85% 20%, rgba(255, 248, 220, 0.6) 0%, rgba(255, 248, 220, 0.3) 2%, transparent 4%),
        radial-gradient(circle at 85% 20%, rgba(255, 248, 220, 0.1) 0%, transparent 8%),
        radial-gradient(ellipse at bottom, rgba(139, 69, 19, 0.2) 0%, transparent 30%),
        linear-gradient(180deg, transparent 70%, rgba(139, 69, 19, 0.05) 85%, rgba(160, 82, 45, 0.08) 100%);
    background-size: 100% 100%;
    animation: desertAtmosphere 25s ease-in-out infinite;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    text-align: center;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 10px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 400px;
    width: 90%;
    z-index: 10;
    position: relative;
}

.auth-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 50%, #e6e6fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.google-sign-in-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    color: #333333;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 280px;
}

.google-sign-in-btn:hover {
    background: #f8f8f8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.google-sign-in-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* User Section Styles */
.user-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
}

.user-details h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.user-details p {
    margin: 5px 0 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.sign-out-btn {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.sign-out-btn:hover {
    background: linear-gradient(45deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

/* Success Message */
.auth-success {
    background: linear-gradient(45deg, var(--primary-color), #20c997);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* =========== Footer =========== */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
    background-color: #12181b;
}

/* =========== Video Grid Styling =========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.video-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.video-item iframe {
    width: 100%;
    height: 315px;
    display: block;
    border: none;
}

/* Video Thumbnail Styling */
.video-thumbnail {
    position: relative;
    width: 100%;
    height: 315px;
    cursor: pointer;
    overflow: hidden;
    border-radius: 0;
    background: #000;
    transition: transform 0.3s ease;
}

.video-thumbnail:hover {
    transform: scale(1.02);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: brightness 0.3s ease;
}

.video-thumbnail:hover img {
    brightness: 0.8;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    opacity: 0.9;
}

.video-thumbnail:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.play-button svg {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

/* Full Screen Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.video-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: 90vw;
    max-width: 1300px;
    height: 80vh;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.modal-video {
    width: 100%;
    height: 100%;
    border: none;
}

.close-modal {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.close-modal:hover {
    color: #ff4444;
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 1002;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-indicator p {
    margin: 0;
    font-size: 1.2rem;
}

.video-item .video-title {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--text-color);
    padding: 15px;
    margin: 0;
    text-align: center;
}

/* =========== Chapter Accordion Styling =========== */
.chapter-accordion {
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease;
}

.chapter-header:hover {
    background: rgba(255, 255, 255, 0.15);
}

.chapter-header .section-title {
    margin: 0; /* Override default section-title margin */
    font-size: 1.8rem;
    color: var(--primary-color);
    text-align: left;
}

.accordion-icon {
    font-size: 1.5rem;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.chapter-content {
    padding: 20px 30px;
    display: none; /* Hidden by default */
    border-top: 1px solid var(--glass-border);
}

.chapter-content p {
    color: rgba(255, 255, 255, 0.8);
}

/* Ensure video grid within accordion is styled correctly */
.chapter-content .video-grid {
    margin-top: 0; /* Remove extra top margin if inside accordion */
}

/* =========== Scroll Animation =========== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Desktop styles */
@media (min-width: 993px) {
    .hero-content-wrapper {
        flex-direction: row;
        text-align: left;
        position: relative;
        padding: 60px;
        border-radius: 25px;
    }
    
    .hero-content-wrapper::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: conic-gradient(
            from 0deg,
            transparent 0deg,
            rgba(255, 248, 220, 0.7) 90deg,
            rgba(173, 216, 230, 0.6) 180deg,
            rgba(255, 215, 0, 0.5) 270deg,
            transparent 360deg
        );
        border-radius: 27px;
        z-index: -1;
        mask: 
            linear-gradient(#fff 0 0) content-box, 
            linear-gradient(#fff 0 0);
        mask-composite: xor;
        -webkit-mask: 
            linear-gradient(#fff 0 0) content-box, 
            linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        padding: 2px;
    }
    
    .hero-text-content {
        order: 1;
        text-align: left;
    }
    
    .hero-image-container {
        order: 2;
    }
}

/* =========== Professional Mobile Video List Styles =========== */
.video-list-mobile {
    display: none;
}

/* Video list item optimized for mobile */
.mobile-video-item {
    display: flex;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-video-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.1), transparent);
    transition: left 0.5s ease;
}

.mobile-video-item:active::before {
    left: 100%;
}

.mobile-video-item.current-playing {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.15) 0%, rgba(74, 144, 226, 0.05) 100%);
    border-color: #4a90e2;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.2);
}

.mobile-video-item.watched {
    opacity: 0.7;
}

.mobile-video-item.watched::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #28a745;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Mobile thumbnail */
.mobile-thumbnail {
    position: relative;
    width: 100px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.mobile-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-thumbnail img.loaded {
    opacity: 1;
}

.mobile-thumbnail .duration-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.mobile-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-play-overlay svg {
    width: 12px;
    height: 12px;
    fill: white;
    margin-left: 2px;
}

.mobile-video-item:active .mobile-play-overlay {
    background: #4a90e2;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Mobile video details */
.mobile-video-details {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.mobile-video-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.mobile-class-number {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.mobile-video-duration {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mobile-video-duration svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

/* Progress indicator for mobile */
.mobile-progress-ring {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
}

.mobile-progress-ring svg {
    transform: rotate(-90deg);
}

.mobile-progress-ring circle {
    fill: none;
    stroke-width: 2;
}

.mobile-progress-ring .progress-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.mobile-progress-ring .progress-fill {
    stroke: #4a90e2;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

/* Loading spinner for mobile */
.page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 20px;
}

.page-loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.page-loader p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========== Responsive Design =========== */
@media (max-width: 992px) {
    .hero-section {
        min-height: 100vh;
        padding: 20px;
    }
    
    .hero-content-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding: 60px 20px;
    }
    
    .hero-text-content {
        order: 1;
        max-width: 100%;
        text-align: center;
    }
    
    .hero-image-container {
        order: 2;
        flex-basis: auto;
        max-width: 350px;
        align-self: center;
    }
    
    .course-highlight {
        flex-direction: column;
        text-align: center;
        border-left: none;
        border-top: 3px solid var(--secondary-color);
        padding: 15px;
        border-radius: 10px;
    }
    
    .highlight-text {
        text-align: center;
    }
    
    .main-headline {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }
    
    .floating-element {
        display: none;
    }
    
    .subjects-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    .key-info-section, .subjects-section, .video-intro-section, .course-preview-section {
        padding: 60px 20px;
    }
    
    /* Hide desktop video list, show mobile */
    .video-list {
        display: none !important;
    }
    
    .video-list-mobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    /* Optimize video thumbnails on mobile */
    .video-thumbnail-small {
        width: 90px;
        height: 51px;
    }
    
    .video-list-title {
        font-size: 13px;
        line-height: 1.2;
    }
    
    .video-meta {
        font-size: 11px;
    }
    
    .chapter-header {
        padding: 15px 20px;
    }
    
    .chapter-header .section-title {
        font-size: 1.4rem;
    }
    
    .chapter-content {
        padding: 15px;
    }
    
    /* Mobile video player adjustments */
    .featured-video-section {
        padding: 30px 15px;
    }
    
    .current-video-title {
        font-size: 1.3em;
    }
    
    #progressTracker {
        padding: 15px !important;
        margin-top: 20px !important;
    }
    
    .progress-title {
        font-size: 1rem !important;
    }
    
    .progress-stats {
        font-size: 0.9rem !important;
    }
}

/* =========== Authentication Modal =========== */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.auth-card {
    position: relative;
    background: linear-gradient(135deg, rgba(18, 24, 27, 0.95), rgba(42, 49, 54, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

.close-auth-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-auth-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

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

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

.google-sign-in-btn {
    width: 100%;
    padding: 12px 20px;
    background: white;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.google-sign-in-btn:hover {
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.3);
    transform: translateY(-2px);
}

.user-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.sign-out-btn {
    padding: 10px 20px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff6b6b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sign-out-btn:hover {
    background: rgba(220, 53, 69, 0.3);
}

/* =========== Loading & Error States =========== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-error, .auth-success {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

.auth-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
}

.auth-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #51cf66;
}

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

/* =========== Landing Page Navigation Bar =========== */
.landing-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(18, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    padding: 0;
    transition: all 0.3s ease;
}

.landing-navbar .nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landing-navbar .nav-left {
    display: flex;
    align-items: center;
}

.landing-navbar .nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-navbar .nav-logo span {
    font-size: 1.5rem;
}

.landing-navbar .nav-logo h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: white;
}

.landing-navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-login-btn {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

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

.nav-enroll-btn {
    padding: 8px 24px;
    background: var(--primary-color);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-enroll-btn:hover {
    background: #229a3e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-course-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-course-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

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

.nav-user-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-user-avatar-wrapper:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.nav-user-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-dropdown-arrow {
    transition: transform 0.3s ease;
}

.nav-user-dropdown.active .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: linear-gradient(135deg, rgba(25, 32, 36, 0.98), rgba(35, 42, 48, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.nav-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu-email {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.nav-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-menu-sign-out {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(220, 53, 69, 0.1);
    border: none;
    color: #ff6b6b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-menu-sign-out:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* Adjust hero section for navbar */
.hero-section {
    padding-top: 80px;
}

/* =========== Progress Tracker (Fixed) =========== */
.progress-tracker {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.progress-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a !important; /* Black color for visibility */
}

.progress-stats {
    font-size: 1rem;
    color: #2d3436 !important; /* Dark gray for better visibility */
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(200, 200, 200, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}


/* =========== Video Introduction Section =========== */
.video-intro-section {
    text-align: center;
    padding-top: 40px;
    padding-bottom: 40px;
}

.video-intro-section .section-title {
    margin-bottom: 30px;
}

.intro-thumbnail-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 800px; /* Adjust as needed */
    margin: 0 auto;
}

.intro-thumbnail-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.intro-thumbnail-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

.play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
}

.intro-thumbnail-wrapper:hover .play-button-overlay {
    background-color: rgba(0,0,0,0.1);
}

.play-button-overlay svg {
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.intro-thumbnail-wrapper:hover .play-button-overlay svg {
    transform: scale(1.1);
}


/* =========== Video Modal =========== */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 960px;
    background-color: #000;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
}

.video-modal-close:hover {
    color: var(--secondary-color);
    transform: rotate(90deg);
}

.video-iframe-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 15px;
}

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

@media (max-width: 768px) {
    .video-modal-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
        background-color: rgba(0,0,0,0.5);
        border-radius: 50%;
        width: 35px;
        height: 35px;
        line-height: 35px;
        text-align: center;
    }
}