/**
 * Cinematic Hero Section Styles
 * 
 * Premium full-screen hero banner
 * Inspired by Netflix, Apple TV+, and Prime Video
 * 
 * @package StreamBox
 */

/* ============================================
   Hero Carousel Wrapper - Starts at Top
   ============================================ */

.hero-cinematic-carousel {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    /* Ensure hero starts at very top where header begins */
    margin-top: 0 !important;
}

/* ============================================
   Base Hero Section
   ============================================ */

.hero-cinematic {
    position: relative;
    width: 100%;
    height: 60vh;
    max-height: 600px;
    min-height: 400px;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* Start at top - header is overlay */
    margin-top: 0;
    padding-top: 0;
    top: 0;
    
    /* Background Image - High Quality Rendering */
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    
    /* Force maximum quality image rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: bicubic;
    
    /* Hardware acceleration for smooth display */
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: background-image;
    
    /* Sharper scaling */
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Portrait Image Handling
   Center-focus for portrait images
   ============================================ */

.hero-cinematic.hero-portrait {
    background-position: center top;
    background-size: cover;
}

/* Desktop: Portrait images get special treatment */
@media (min-width: 992px) {
    .hero-cinematic.hero-portrait {
        /* Position portrait to show face/top portion */
        background-position: 70% 15%;
    }
}

/* ============================================
   Landscape Image Handling
   Standard cover behavior
   ============================================ */

.hero-cinematic.hero-landscape {
    background-position: center 20%;
    background-size: cover;
}

/* ============================================
   Image Quality Enhancement Layer
   ============================================ */

/* Add sharpening overlay for better perceived quality */
.hero-cinematic::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Subtle contrast enhancement without affecting colors */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.01) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.02) 100%
    );
    pointer-events: none;
}

/* Hero slide inside carousel */
.hero-cinematic-carousel .hero-slide,
.hero-cinematic-carousel .hero-cinematic {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* ============================================
   Cinematic Gradient Overlay
   ============================================ */

.hero-cinematic__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    
    /* Multi-layer gradient for depth with VIBESTREAM colors */
    background: 
        /* Left to right gradient - main readability layer */
        linear-gradient(
            90deg,
            rgba(11, 11, 30, 0.95) 0%,
            rgba(27, 0, 61, 0.85) 25%,
            rgba(0, 8, 20, 0.5) 50%,
            rgba(0, 8, 20, 0.2) 70%,
            rgba(0, 0, 0, 0) 100%
        ),
        /* Bottom gradient for depth */
        linear-gradient(
            180deg,
            rgba(11, 11, 30, 0) 0%,
            rgba(27, 0, 61, 0.3) 70%,
            rgba(0, 8, 20, 0.8) 100%
        );
}

/* ============================================
   Content Container
   ============================================ */

.hero-cinematic__container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
}

.hero-cinematic__content {
    max-width: 650px;
    animation: heroContentFadeIn 1.2s ease-out;
}

@keyframes heroContentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Genre Pills (Glassmorphism)
   ============================================ */

.hero-cinematic__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
    animation: heroContentFadeIn 1.2s ease-out 0.2s both;
}

.hero-cinematic__genre-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    
    /* Solid background instead of glassmorphism */
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-cinematic__genre-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ============================================
   Movie Title (Display Font)
   ============================================ */

.hero-cinematic__title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin: 0 0 1rem;
    
    /* Modern font stack */
    font-family: Inter, Satoshi, 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Text shadow for depth */
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.3);
    animation: heroContentFadeIn 1.2s ease-out 0.3s both;
}

/* ============================================
   Meta Information (Year, Rating, Runtime)
   ============================================ */

.hero-cinematic__meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    animation: heroContentFadeIn 1.2s ease-out 0.4s both;
}

.hero-cinematic__meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
}

.hero-cinematic__star {
    color: #fbbf24;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ============================================
   Description Text
   ============================================ */

.hero-cinematic__description {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 2rem;
    max-width: 600px;
    
    /* Text shadow for readability */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    animation: heroContentFadeIn 1.2s ease-out 0.5s both;
}

/* ============================================
   CTA Buttons
   ============================================ */

.hero-cinematic__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: heroContentFadeIn 1.2s ease-out 0.6s both;
}

.hero-cinematic__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 2rem;
    font-size: 1.0625rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: none;
}

.hero-cinematic__btn-icon {
    transition: transform 0.3s ease;
}

/* Primary Button (Play Now) */
.hero-cinematic__btn--primary {
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    color: #ffffff;
    box-shadow: 
        0 4px 15px rgba(229, 9, 20, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-cinematic__btn--primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff0a16 0%, #e50914 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-cinematic__btn--primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(229, 9, 20, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.3);
}

.hero-cinematic__btn--primary:hover::before {
    opacity: 1;
}

.hero-cinematic__btn--primary:hover .hero-cinematic__btn-icon {
    transform: translateX(3px);
}

.hero-cinematic__btn--primary:active {
    transform: translateY(0) scale(0.98);
}

/* Secondary Button (Watch Trailer / More Info) */
.hero-cinematic__btn--secondary {
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-cinematic__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-cinematic__btn--secondary:hover .hero-cinematic__btn-icon {
    transform: scale(1.1);
}

.hero-cinematic__btn--secondary:active {
    transform: translateY(0);
}

/* ============================================
   Scroll Indicator
   ============================================ */

.hero-cinematic__scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: rgba(255, 255, 255, 0.6);
    animation: heroScrollBounce 2s ease-in-out infinite;
}

@keyframes heroScrollBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

.hero-cinematic__scroll-indicator svg {
    display: block;
}

/* ============================================
   Responsive Design - Landscape Banner Style
   ============================================ */

/* Tablet and below (991px) */
@media (max-width: 991px) {
    .hero-cinematic {
        min-height: 380px !important;
        max-height: 450px !important;
        height: 400px !important;
        background-position: center 30% !important;
        margin-bottom: 0 !important;
    }
    
    .hero-cinematic__overlay {
        background: 
            linear-gradient(
                90deg,
                rgba(0, 0, 0, 0.7) 0%,
                rgba(0, 0, 0, 0.4) 40%,
                rgba(0, 0, 0, 0.1) 100%
            ),
            linear-gradient(
                180deg,
                rgba(0, 0, 0, 0) 0%,
                rgba(0, 0, 0, 0.4) 100%
            ) !important;
    }
    
    .hero-cinematic__container {
        padding: 0 16px !important;
    }
    
    .hero-cinematic__content {
        max-width: 70% !important;
    }
    
    .hero-cinematic__genres {
        margin-bottom: 6px !important;
    }
    
    .hero-cinematic__genre-pill {
        font-size: 0.55rem !important;
        padding: 2px 6px !important;
    }
    
    .hero-cinematic__title {
        font-size: 1.1rem !important;
        margin-bottom: 4px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 1 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    .hero-cinematic__meta {
        gap: 6px !important;
        margin-bottom: 6px !important;
        flex-wrap: wrap !important;
    }
    
    .hero-cinematic__meta-item {
        font-size: 0.6rem !important;
    }
    
    .hero-cinematic__description {
        font-size: 0.65rem !important;
        margin-bottom: 8px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    .hero-cinematic__actions {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }
    
    .hero-cinematic__btn {
        padding: 6px 12px !important;
        font-size: 0.7rem !important;
        min-height: 32px !important;
    }
    
    .hero-cinematic__scroll-indicator {
        display: none !important;
    }
}

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .hero-cinematic {
        min-height: 350px !important;
        max-height: 420px !important;
        height: 380px !important;
        margin-bottom: 0 !important;
    }
    
    .hero-cinematic__container {
        padding: 0 14px !important;
    }
    
    .hero-cinematic__content {
        max-width: 75% !important;
    }
    
    .hero-cinematic__title {
        font-size: 1rem !important;
    }
    
    .hero-cinematic__description {
        font-size: 0.6rem !important;
    }
    
    .hero-cinematic__btn {
        padding: 5px 10px !important;
        font-size: 0.65rem !important;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .hero-cinematic {
        min-height: 320px !important;
        max-height: 380px !important;
        height: 350px !important;
        margin-bottom: 0 !important;
    }
    
    .hero-cinematic__container {
        padding: 0 12px !important;
    }
    
    .hero-cinematic__content {
        max-width: 80% !important;
        padding-bottom: 10px !important;
    }
    
    .hero-cinematic__title {
        font-size: 0.9rem !important;
        margin-bottom: 3px !important;
    }
    
    .hero-cinematic__description {
        font-size: 0.55rem !important;
        margin-bottom: 6px !important;
    }
    
    .hero-cinematic__meta {
        gap: 4px !important;
        margin-bottom: 5px !important;
    }
    
    .hero-cinematic__meta-item {
        font-size: 0.75rem;
    }
    
    .hero-cinematic__genres {
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .hero-cinematic__genre-pill {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .hero-cinematic__actions {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .hero-cinematic__btn {
        width: auto;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}

/* Large Screens (1920px and above) */
@media (min-width: 1920px) {
    .hero-cinematic {
        height: 90vh;
        max-height: 1080px;
    }
    
    .hero-cinematic__container {
        max-width: 1600px;
    }
    
    .hero-cinematic__content {
        max-width: 800px;
    }
}

/* ============================================
   Accessibility & Performance
   ============================================ */

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .hero-cinematic {
        animation: none;
    }
    
    .hero-cinematic__content,
    .hero-cinematic__genres,
    .hero-cinematic__title,
    .hero-cinematic__meta,
    .hero-cinematic__description,
    .hero-cinematic__actions {
        animation: none;
    }
    
    .hero-cinematic__scroll-indicator {
        animation: none;
    }
    
    .hero-cinematic__btn,
    .hero-cinematic__genre-pill {
        transition: none;
    }
}

/* Focus states for keyboard navigation */
.hero-cinematic__btn:focus-visible,
.hero-cinematic__genre-pill:focus-visible {
    outline: 3px solid rgba(229, 9, 20, 0.8);
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-cinematic__overlay {
        background: 
            linear-gradient(
                90deg,
                rgba(0, 0, 0, 1) 0%,
                rgba(0, 0, 0, 0.9) 40%,
                rgba(0, 0, 0, 0.6) 100%
            );
    }
    
    .hero-cinematic__genre-pill {
        border-width: 2px;
    }
    
    .hero-cinematic__btn--secondary {
        border-width: 3px;
    }
}

/* ============================================
   Small Image Handling (Sports Low-Res Posters)
   ============================================ */

.hero-backdrop-small {
    /* Scale and blur small images for better appearance */
    background-size: 120% !important;
}

.hero-backdrop-small::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: 120%;
    filter: blur(20px);
    transform: scale(1.1);
    z-index: 0;
}

.hero-backdrop-small .hero-cinematic__overlay {
    /* Stronger overlay for small images */
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.3) 100%), 
                linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.6) 100%) !important;
    z-index: 1;
}

.hero-backdrop-small .hero-cinematic__container {
    z-index: 2 !important;
}

/* ============================================
   CRITICAL: Hero Starts at Top
   Header overlays hero section
   ============================================ */

/* Ensure hero starts at very top of page */
.home .hero-cinematic-carousel,
.front-page .hero-cinematic-carousel,
.page-template-front-page .hero-cinematic-carousel,
.hero-cinematic-carousel {
    margin-top: 0 !important;
    padding-top: 0 !important;
    top: 0 !important;
}

/* Hero section starts from top - header is overlay */
.home .hero-cinematic,
.front-page .hero-cinematic,
.page-template-front-page .hero-cinematic,
body:not(.single) .hero-cinematic {
    margin-top: 0 !important;
    padding-top: 0 !important;
    top: 0 !important;
}

/* ============================================
   RESPONSIVE: Portrait & Landscape Image Scaling
   High quality rendering on all devices
   ============================================ */

/* TABLET: Portrait and Landscape adjustments */
@media (max-width: 991.98px) {
    .hero-cinematic {
        height: 50vh;
        min-height: 350px;
        max-height: 500px;
        /* Center focus for both portrait and landscape */
        background-position: center center;
        background-size: cover;
    }
    
    .hero-cinematic.hero-portrait {
        /* Portrait images - focus on upper portion (face) */
        background-position: center 15%;
    }
    
    .hero-cinematic.hero-landscape {
        /* Landscape - standard center */
        background-position: center center;
    }
}

/* MOBILE: Optimized for smaller screens */
@media (max-width: 767.98px) {
    .hero-cinematic {
        height: 45vh;
        min-height: 300px;
        max-height: 400px;
        background-position: center center;
    }
    
    .hero-cinematic.hero-portrait {
        /* Portrait on mobile - show more of the subject */
        background-position: center 10%;
        background-size: cover;
    }
    
    .hero-cinematic.hero-landscape {
        background-position: center center;
        background-size: cover;
    }
}

/* SMALL MOBILE: Compact hero */
@media (max-width: 480px) {
    .hero-cinematic {
        height: 40vh;
        min-height: 250px;
        max-height: 350px;
    }
    
    .hero-cinematic.hero-portrait {
        background-position: center 5%;
    }
}

/* ============================================
   IMAGE QUALITY PRESERVATION
   Prevent blurry scaling on all devices
   ============================================ */

/* High-DPI/Retina screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-cinematic {
        /* Enhanced rendering for high-DPI */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: high-quality;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Force high quality on all hero images */
.hero-cinematic,
.hero-cinematic.hero-portrait,
.hero-cinematic.hero-landscape {
    /* GPU acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    
    /* Prevent sub-pixel rendering issues */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Quality rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
