/* ============================================
   ULTRA PREMIUM CINEMATIC SCREEN ANIMATION
   Professional TV/Cinema Experience v2.0
   ============================================ */

/* Hero Section Base */
.hero {
    position: relative;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Playing Mode - Cinema Mode Active */
.hero.playing-mode {
    background: #000;
}

.hero.playing-mode .hero-bg {
    animation: cinematicDim 0.4s ease forwards;
}

@keyframes cinematicDim {
    to {
        opacity: 0;
        filter: brightness(0);
    }
}

/* Content - Cinematic Exit */
.hero.playing-mode .hero-content {
    animation: cinematicExit 0.5s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes cinematicExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(8px);
        pointer-events: none;
    }
}

/* ===== MAIN OVERLAY - PORTAL EFFECT ===== */
.hero-playing-overlay {
    background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 100%);
    overflow: hidden;
}

.hero-playing-overlay.active {
    animation: portalOpen 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes portalOpen {
    0% {
        opacity: 0;
        clip-path: circle(0% at 50% 50%);
    }
    60% {
        clip-path: circle(75% at 50% 50%);
    }
    100% {
        opacity: 1;
        clip-path: circle(150% at 50% 50%);
    }
}

/* Ambient Glow Border */
.hero-playing-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    background: linear-gradient(135deg, rgba(122, 77, 255,0.3), rgba(240, 85, 199,0.3), rgba(123,79,255,0.3)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1000;
    animation: ambientBorder 3s ease-in-out infinite;
}

@keyframes ambientBorder {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Subtle Vignette */
.hero-playing-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 998;
}

/* ===== BACK BUTTON - FLOATING PILL ===== */
.back-to-home {
    animation: floatIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50px !important;
    padding: 12px 24px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.back-to-home:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
}

/* ===== FULLSCREEN CONTENT ===== */
.playing-fullscreen {
    animation: contentReveal 0.5s ease 0.3s both !important;
    padding: 50px 30px;
}

@keyframes contentReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CHANNEL LOGO - ELECTRIC GLOW ===== */
.channel-logo-huge span {
    display: inline-block;
    animation: electricReveal 0.6s ease 0.4s both !important;
    text-shadow:
        0 0 20px currentColor,
        0 0 40px currentColor,
        0 0 60px currentColor !important;
}

@keyframes electricReveal {
    0% {
        opacity: 0;
        transform: scale(0.8);
        filter: blur(10px);
    }
    50% {
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== HEADER - SMOOTH SLIDE ===== */
.playing-fullscreen-header {
    animation: headerReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both !important;
}

@keyframes headerReveal {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LIVE INDICATOR - PULSE BEACON ===== */
.live-indicator-large {
    animation: beaconIn 0.4s ease 0.45s both !important;
}

@keyframes beaconIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.live-dot-large {
    animation: liveBeacon 1.5s ease-in-out infinite !important;
    position: relative;
}

.live-dot-large::before,
.live-dot-large::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    transform: translate(-50%, -50%);
}

.live-dot-large::before {
    animation: beaconWave 1.5s ease-out infinite;
}

.live-dot-large::after {
    animation: beaconWave 1.5s ease-out 0.3s infinite;
}

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

@keyframes beaconWave {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* ===== VIDEO PLAYER - 3D REVEAL ===== */
.video-player-large {
    animation: playerReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both !important;
    position: relative;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    overflow: hidden;
}

@keyframes playerReveal {
    0% {
        opacity: 0;
        transform: perspective(1000px) rotateX(10deg) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: perspective(1000px) rotateX(0deg) translateY(0);
    }
}

/* Glass Reflection */
.video-player-large::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
    animation: glassShine 3s ease-in-out 1s infinite;
}

@keyframes glassShine {
    0% { left: -100%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

/* ===== PLAY ICON - MAGNETIC BUTTON ===== */
.play-icon-huge {
    animation: magneticAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

@keyframes magneticAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Continuous Soft Pulse */
.play-icon-huge::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: inherit;
    background: inherit;
    opacity: 0.3;
    filter: blur(20px);
    animation: softPulse 2s ease-in-out infinite !important;
    z-index: -1;
}

@keyframes softPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

.play-icon-huge:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 30px 80px rgba(122, 77, 255, 0.6) !important;
}

.play-icon-huge:active {
    transform: scale(0.95) !important;
}

/* ===== PLAYING INFO - STAGGER REVEAL ===== */
.playing-info-large {
    animation: infoReveal 0.5s ease 0.65s both !important;
}

@keyframes infoReveal {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.playing-info-large h2 {
    animation: textSlideUp 0.4s ease 0.7s both !important;
}

.playing-info-large p {
    animation: textSlideUp 0.4s ease 0.75s both !important;
}

@keyframes textSlideUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== QUALITY TAGS - PILL ANIMATION ===== */
.quality-tag-large {
    animation: pillBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease !important;
}

.quality-tag-large:nth-child(1) { animation-delay: 0.8s !important; }
.quality-tag-large:nth-child(2) { animation-delay: 0.85s !important; }
.quality-tag-large:nth-child(3) { animation-delay: 0.9s !important; }

@keyframes pillBounce {
    0% {
        opacity: 0;
        transform: scale(0) translateY(10px);
    }
    60% {
        transform: scale(1.1) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Shimmer Effect */
.quality-tag-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: tagShimmer 2.5s ease 1.2s infinite;
}

@keyframes tagShimmer {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.quality-tag-large:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 5px 20px rgba(122, 77, 255, 0.3) !important;
}

/* ===== EXIT ANIMATION - SMOOTH CLOSE ===== */
.hero-playing-overlay:not(.active) {
    animation: portalClose 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes portalClose {
    0% {
        opacity: 1;
        clip-path: circle(150% at 50% 50%);
    }
    100% {
        opacity: 0;
        clip-path: circle(0% at 50% 50%);
    }
}

/* Channel-Specific Screen Tints */
.hero.playing-netflix .hero-playing-overlay {
    background: radial-gradient(ellipse at center, #1a0505 0%, #0a0000 100%);
}

.hero.playing-amazon .hero-playing-overlay {
    background: radial-gradient(ellipse at center, #051a1a 0%, #000a0a 100%);
}

.hero.playing-hbomax .hero-playing-overlay {
    background: radial-gradient(ellipse at center, #0f051a 0%, #050010 100%);
}

.hero.playing-disney .hero-playing-overlay {
    background: radial-gradient(ellipse at center, #05051a 0%, #000010 100%);
}

.hero.playing-espn .hero-playing-overlay {
    background: radial-gradient(ellipse at center, #1a0508 0%, #0a0000 100%);
}

.hero.playing-cnn .hero-playing-overlay {
    background: radial-gradient(ellipse at center, #1a0505 0%, #0a0000 100%);
}

.hero.playing-bbc .hero-playing-overlay {
    background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 100%);
}

/* Hero Channel Wall Background */
.hero-channel-wall {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    opacity: 0.15;
    transform: skewY(-5deg) scale(1.1);
    pointer-events: none;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0));
}

.channel-wall-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    animation: wallScroll 25s linear infinite;
    width: 200%;
    will-change: transform;
}

.channel-wall-row:nth-child(even) {
    animation-direction: reverse;
    margin-left: -100px;
}

.wall-item {
    flex: 0 0 auto;
    width: 160px;
    height: 90px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wall-item.netflix {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
    color: #E50914;
}

.wall-item.amazon {
    background: rgba(0, 168, 225, 0.1);
    border-color: rgba(0, 168, 225, 0.3);
    color: #00A8E1;
}

.wall-item.hbo {
    background: rgba(123, 79, 255, 0.1);
    border-color: rgba(123, 79, 255, 0.3);
    color: #7B4FFF;
}

.wall-item.disney {
    background: rgba(17, 60, 207, 0.1);
    border-color: rgba(17, 60, 207, 0.3);
    color: #113CCF;
}

.wall-item.espn {
    background: rgba(255, 0, 51, 0.1);
    border-color: rgba(255, 0, 51, 0.3);
    color: #FF0033;
}

.wall-item.sky {
    background: rgba(0, 114, 198, 0.1);
    border-color: rgba(0, 114, 198, 0.3);
    color: #0072C6;
}

@keyframes wallScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.hero-bg {
    background: #000;
    /* Ensure dark background behind the wall */
}
