/* ==========================================
   CSS Variables & Design System
   ========================================== */
:root {
    /* Colors - Dark Premium Theme */
    --bg-primary: #050505;
    --bg-secondary: #0a0a0f;
    --bg-tertiary: #12121a;
    --bg-card: rgba(18, 18, 26, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* Accent Colors - Neon Purple/Blue/Pink */
    --accent-primary: #8b5cf6;
    --accent-secondary: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f43f5e 100%);
    --accent-gradient-cold: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --accent-glow: rgba(139, 92, 246, 0.5);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 5rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Other */
    --font-family: 'Outfit', sans-serif;
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: 0.3s ease;
}

img,
video {
    max-width: 100%;
    display: block;
}

/* ==========================================
   Typography
   ========================================== */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.1;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.text-accent {
    color: var(--accent-primary);
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

.glow-effect {
    position: relative;
    overflow: hidden;
}

.glow-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    animation: glow-swipe 3s infinite;
}

@keyframes glow-swipe {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* ==========================================
   Navbar
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.9), transparent);
    backdrop-filter: blur(5px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:not(.btn):hover {
    color: var(--accent-secondary);
}

@media(max-width: 768px) {
    .nav-links a:not(.btn) {
        display: none;
    }

    .desktop-text {
        display: none;
    }

    .login-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 1.5rem 4rem;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-avatar-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    mask-image: linear-gradient(to bottom, transparent, black 40%, black 70%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%, black 70%, transparent);
    filter: saturate(1.2) contrast(1.1);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-primary) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    margin-bottom: 2rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-primary);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 4rem;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media(max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.live-activity {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.avatar-stack {
    display: flex;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    border: 2px solid var(--bg-primary);
    margin-left: -10px;
    background: var(--bg-secondary);
    object-fit: cover;
}

.avatar:first-child {
    margin-left: 0;
    background: #555;
}

.avatar:nth-child(2) {
    background: #777;
}

.avatar:nth-child(3) {
    background: #999;
}

/* ==========================================
   Feed Sections
   ========================================== */
.feed-section {
    padding: 4rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    text-align: center;
}

.section-tag {
    color: var(--accent-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.5rem;
}

/* Video Carousel layout */
/* Video Grid layout */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--accent-primary);
}

.page-btn.active {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.video-card {
    width: 100%;
    /* Responsive width controlled by grid */
    background: transparent;
    /* Cleaner look */
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease;
    border: none;
    /* Remove border for cleaner YouTube vibe */
    scroll-snap-align: start;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(233, 69, 96, 0.15);
    border-color: rgba(233, 69, 96, 0.3);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

/* Gradient Overlay for text protection */
.video-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 40%);
    pointer-events: none;
}

/* Badges Container */
.card-badges {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}

.quality-tag {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

.duration-tag {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Status Badge (Premium/Free) */
.video-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.video-badge.premium {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000;
}

.video-badge.preview {
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
}

/* Play Button */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 50px;
    height: 50px;
    background: rgba(233, 69, 96, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.4);
    z-index: 5;
}

.video-play-btn span {
    font-size: 1.2rem;
    color: white;
    margin-left: 2px;
}

.video-card:hover .video-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Info Section */
.video-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Ensure consistent height */
    justify-content: space-between;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.video-category {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.video-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #ffd700;
    font-weight: 600;
}

.video-title {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Stats Row */
.video-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.8rem;
    margin-top: auto;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-icon {
    font-size: 1rem;
    opacity: 0.7;
}


/* ==========================================
   Steps Section
   ========================================== */
.steps-section {
    padding: 5rem 0;
    background: var(--bg-tertiary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step-card {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

@media(max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Pricing Section
   ========================================== */
.pricing-section {
    padding: 6rem 0;
}

.pricing-card {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.pricing-badge {
    background: var(--accent-secondary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: inline-block;
}

.price-amount {
    font-size: 4rem;
    font-weight: 800;
    display: block;
    margin: 1.5rem 0;
    color: var(--text-primary);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--bg-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-secondary);
    margin-left: 2rem;
}

@media(max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-links a {
        margin: 0 1rem;
    }
}

/* ==========================================
   Modal
   ========================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.glass-modal {
    background: #111;
    border: 1px solid #333;
    width: 100%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    line-height: 1;
    padding-bottom: 2px;
    /* Visual center adjustment */
}

.modal-close:hover {
    background: rgba(233, 69, 96, 0.9);
    color: #fff;
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(233, 69, 96, 1);
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.5);
}

.modal-video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    overflow: hidden;
}

.modal-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-info {
    padding: 1.5rem;
}

.modal-lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    text-align: center;
}

.modal-lock p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ==========================================
   Login Page Styles
   ========================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        var(--bg-primary);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: var(--spacing-2xl);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.login-header p {
    color: var(--text-muted);
}

.courses-section {
    padding: var(--spacing-3xl) 0;
    background: var(--bg-secondary);
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    /* Explicit value instead of var */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--accent-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-error {
    margin-top: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--error);
}

.login-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-footer a {
    color: var(--accent-primary);
}

/* ==========================================
   Library Page Styles
   ========================================== */
.library-header {
    padding: 100px var(--spacing-lg) var(--spacing-2xl);
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
}

.library-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.library-header p {
    color: var(--text-secondary);
}

.library-content {
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.user-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 600;
}

.user-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.user-details p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Alert Messages */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: var(--spacing-lg);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .pricing-card {
        margin: 0 var(--spacing-md);
    }
}

/* Enhanced Mobile Optimization */
@media (max-width: 480px) {
    .navbar {
        padding: 1rem 0;
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero {
        padding: 6rem 1rem 3rem;
        /* Reduced top padding */
        min-height: auto;
        /* Allow content to dictate height */
    }

    .hero-title {
        font-size: 2.2rem;
        /* Smaller title */
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .live-activity {
        flex-direction: column;
        gap: 0.5rem;
    }

    .price-amount {
        font-size: 3rem;
        /* Prevent overflow */
    }

    .glass-card {
        padding: 2rem 1.5rem;
    }

    .video-grid {
        gap: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* Responsive Modal */
@media (max-width: 768px) {

    .glass-modal,
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
        background: var(--bg-secondary);
        /* Ensuring background is solid */
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-lg);
    }

    .file-upload-box {
        padding: 2rem 1rem;
    }
}

/* Small Upload Box for Thumbnail */
.small-upload {
    padding: 1.5rem !important;
    border-style: dashed !important;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.small-upload:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
}

/* Toggle Buttons */
#thumbBtnUrl.active,
#thumbBtnFile.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Fixed Side Ad */
/* Fixed Side Ad */
.desktop-skyscraper-ad {
    position: fixed !important;
    right: 10px !important;
    top: 150px !important;
    /* Clear header definitively */
    transform: none !important;
    z-index: 90 !important;
    display: none;
    /* Hidden by default, shown via media query */
}

/* In-Feed Ad Card */
.video-card.ad-card {
    background: #000;
    justify-content: center;
    align-items: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 280px;
    /* Match typical video card height */
}

.ad-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 4px;
    z-index: 5;
    text-transform: uppercase;
}

.ad-content-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.9);
    /* Slight shrink to fit */
}

@media (min-width: 1024px) {
    .desktop-skyscraper-ad {
        display: block !important;
    }
}

.video-play-btn.small {
    width: 40px;
    height: 40px;

    /* Pre-Roll Ad Modal */
    .preroll-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.95);
        z-index: 2000;
        display: flex;
        justify-content: center;
        align-items: center;
        backdrop-filter: blur(5px);
    }

    .preroll-content {
        position: relative;
        background: #000;
        padding: 20px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .preroll-timer {
        color: #fff;
        font-family: 'Outfit', sans-serif;
        font-size: 1.1rem;
        font-weight: 500;
        margin-top: 10px;
    }

    #prerollCountdown {
        color: var(--accent-primary);
        font-weight: 700;
        font-size: 1.3rem;
    }