/* Maestro SaaS Stylings */
:root {
    --maestro-gold: #e3b341;
    --maestro-blue: #0a192f;
    --maestro-green: #00c851;
    --deep-dark: #020c1b;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--deep-dark);
    color: #FFFFFF;
    padding-top: 104px; /* Default for mobile Header (64px) + User Bar (40px) */
}

@media (min-width: 768px) {
    body {
        padding-top: 0px;
    }
}

section {
    scroll-margin-top: 104px; /* Optimized for mobile header + user bar stack */
}

@media (min-width: 768px) {
    section {
        scroll-margin-top: 320px;
    }
}

@keyframes kenburns {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(-2%, -1%); }
}

@keyframes bounce-x {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.animate-bounce-x {
    animation: bounce-x 1s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.ken-burns {
    animation: kenburns 30s ease-out forwards;
}

/* Netflix Style Card Zoom & Elite Elevation */
.netflix-card {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.netflix-card:hover {
    transform: translateY(-10px) scale(1.03);
    z-index: 50;
}

.netflix-card img {
    border-radius: 12px;
}

/* Netflix-style Shelves */
.shelf-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 1.5rem;
    padding: 0.25rem 0.25rem; /* Reduced padding to collapse shelves together */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Essential for mobile momentum scroll */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.shelf-row::-webkit-scrollbar {
    height: 4px; /* Show thin scrollbar */
}

.shelf-row::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
}

.shelf-row::-webkit-scrollbar-thumb {
    background: rgba(227, 179, 65, 0.2);
    border-radius: 10px;
}

.shelf-row:hover::-webkit-scrollbar-thumb {
    background: rgba(227, 179, 65, 0.5);
}

.shelf-row::-webkit-scrollbar-thumb {
    background: rgba(227, 179, 65, 0.2);
    border-radius: 10px;
}

.shelf-row:hover::-webkit-scrollbar-thumb {
    background: rgba(227, 179, 65, 0.5);
}

.story-card {
    flex: 0 0 280px;
    position: relative;
    border-radius: 1rem;
    overflow: visible; /* Allow info below to show */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.story-card-inner {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: transform 0.5s ease;
}

.story-card:hover .story-card-inner {
    transform: scale(1.05);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}


.story-card-info {
    margin-top: 0.5rem;
    padding: 0 0.25rem;
}

/* Locked State */
.story-card.locked .story-card-inner {
    filter: grayscale(1) brightness(0.5);
}

.lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-card.locked .lock-overlay {
    opacity: 1;
}

.lock-icon {
    width: 40px;
    height: 40px;
    background: var(--maestro-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .story-card {
        flex: 0 0 240px;
    }
}
/* Glassmorphism Premium */
.glass {
    background: rgba(2, 12, 27, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Subtitle Maestro Glow */
#subtitle-text {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    text-shadow: 0 2px 20px rgba(0,0,0,0.9);
}

#subtitle-text.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Optimized Row */
.netflix-row {
    scroll-snap-type: x mandatory;
    scroll-padding: 0 40px;
}

.netflix-card {
    scroll-snap-align: start;
}

/* Skeleton Screens */
.skeleton {
    background: linear-gradient(-90deg, #1A1A1A 0%, #2A2A2A 50%, #1A1A1A 100%);
    background-size: 400% 400%;
    animation: pulse 1.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

@keyframes pulse {
    0% { background-position: 0% 0%; }
    100% { background-position: -135% 0%; }
}

/* Download State & Progress */
.download-btn-container {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.download-progress-ring {
    position: relative;
    width: 36px;
    height: 36px;
}

.download-progress-ring circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.3s;
}

.download-bg { stroke: rgba(255, 255, 255, 0.1); }
.download-fg { 
    stroke: var(--maestro-gold);
    stroke-dasharray: 100 100;
    stroke-dashoffset: 100; /* Start at 0 progress */
}

/* Transitions */
.fade-in {
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Shimmer Effect for Premium Buttons */
.shimmer {
    position: relative;
    overflow: hidden;
}
.shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 40%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 60%,
        rgba(255,255,255,0) 100%
    );
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

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

/* Hide Scrollbars */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Custom Scrollbars for Modals */
.overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}
.overflow-y-auto::-webkit-scrollbar-track {
    background: #020c1b;
}
.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
    border: 2px solid #020c1b;
}
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: var(--maestro-gold);
}

/* Base Scrollbar Support for Firefox */
.overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #333 #020c1b;
}

/* Mask for Horizontal Scroll */
.mask-fade-right {
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

/* Better Title Fit for Small Screens */
@media (max-width: 480px) {
    h1 {
        letter-spacing: -0.05em;
        line-height: 0.9;
    }
}

/* Select Dropdown Dark Mode */
select option {
    background-color: #111;
    color: white;
}

/* Coming Soon Compact State */
.story-card-soon {
    flex: 0 0 140px;
    position: relative;
    cursor: help;
    transition: all 0.3s ease;
    padding-top: 1.5rem; /* Offset to align with regular cards text baseline */
}

.soon-inner {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px dashed rgba(227, 179, 65, 0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.story-card-soon:hover {
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    #main-header {
        height: 64px;
    }
    
    #mobile-hero-carousel {
        height: auto !important;
        aspect-ratio: 16/9 !important;
        margin-bottom: 0.5rem !important;
    }

    #catalog-wrapper {
        padding-top: 5px !important; 
    }
    
    /* Quiz Mobile Scaling */
    #quiz-modal > div {
        padding: 1.5rem !important;
        border-radius: 2rem !important;
        max-width: 92% !important;
        background: #020c1b !important;
    }
    #quiz-q-text {
        font-size: 1.25rem !important;
        margin-bottom: 2rem !important;
        line-height: 1.3 !important;
    }
    #quiz-options .btn, #quiz-options > div, .quiz-opt-btn {
        padding: 1rem !important;
        font-size: 0.8rem !important;
        border-radius: 1rem !important;
    }
    #quiz-modal h2 { font-size: 1.4rem !important; }
    #quiz-progress-stars span { font-size: 1.2rem !important; }

    #categories-container, #catalog-page, #store-shelves-container {
        gap: 1.5rem !important;
    }

    /* Pricing Modal Mobile */
    #pricing-modal .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    #pricing-modal .p-8.md:p-12 { padding: 1.5rem !important; }
    #pricing-modal h2 { font-size: 1.75rem !important; margin-bottom: 1rem !important; }
    #pricing-modal p { font-size: 0.8rem !important; margin-bottom: 2rem !important; }
    #pricing-modal .gold-glow { font-size: 2.5rem !important; }
    
    /* Store Mobile Adjustments */
    .store-shelf-mobile {
         display: flex !important;
         flex-wrap: nowrap !important;
         overflow-x: auto !important;
         gap: 0.75rem !important;
         padding-bottom: 0.75rem !important;
         scroll-behavior: smooth !important;
    }
    
    .premium-btn-mobile {
        box-shadow: 0 0 10px rgba(227, 179, 65, 0.4);
        border: 1px solid rgba(255,255,255,0.2);
    }

    /* Shelf Container Adjustments */
    .shelf-container {
        gap: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    #categories-container, #catalog-page {
        gap: 1.5rem !important;
    }

    #player-text {
        font-size: 1.15rem !important;
        bottom: 1.5rem !important;
        line-height: 1.2 !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    #player-container .w-16.h-16 {
        width: 3.5rem !important;
        height: 3.5rem !important;
    }
}

/* Hero Carousel Animations */
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

@media (max-width: 768px) {
    #categories-container {
        gap: 1.5rem !important; /* Extremely tight shelving */
    }
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-fade-in {
    animation: fade-in 0.5s ease forwards;
}

