/* css/watch.css - Style spécifique pour Penta TV (Design Netflix) */

:root {
    --penta-dark: #0a0a0a;
    --penta-darker: #050505;
    --penta-red: #e50914;
    --penta-red-hover: #b80710;
    --text-main: #e5e5e5;
    --text-muted: #808080;
}

/* =========================================
   GLOBAL - DARK MODE IMMERSIF
   ========================================= */
body.penta-tv-mode {
    background-color: var(--penta-dark) !important;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding-top: 0 !important;
    overflow-x: hidden;
}

/* Hide EVERYTHING from the main site on mobile to ensure Penta TV App mode */
@media (max-width: 768px) {
    /* Target common site-wide classes and IDs */
    .mobile-nav-bar, .pm-tab-bar, .mobile-bottom-nav, .mobile-footer, 
    .site-tab-bar, .footer, footer, #bottom-nav, nav[class*="mobile"], 
    div[class*="tab-bar"], div[class*="bottom-nav"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    body.penta-tv-mode {
        padding-bottom: 75px !important;
    }
}

/* Override ONLY colors on the existing navbar — do NOT change position/layout */
/* Dynamic Navbar effect */
body.penta-tv-mode .main-header {
    background: transparent !important;
    transition: background 0.4s ease, backdrop-filter 0.4s ease !important;
}
body.penta-tv-mode .main-header.scrolled {
    background: rgba(10, 10, 10, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}
body.penta-tv-mode .main-header .navbar {
    /* Don't touch layout, just ensure it stays as-is */
}
body.penta-tv-mode .main-nav a,
body.penta-tv-mode .main-nav .dropdown-toggle,
body.penta-tv-mode .link-text,
body.penta-tv-mode .link-app,
body.penta-tv-mode .menu-toggle {
    color: #fff !important;
}
body.penta-tv-mode .main-nav a:hover,
body.penta-tv-mode .main-nav .dropdown-toggle:hover {
    color: var(--penta-red) !important;
    background-color: rgba(255,255,255,0.1) !important;
}
body.penta-tv-mode .main-nav a.active {
    color: var(--penta-red) !important;
    background-color: rgba(229, 9, 20, 0.15) !important;
}
/* Dropdown menus stay light (better readability) */
body.penta-tv-mode .dropdown-menu {
    background: #1a1a1a !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}
body.penta-tv-mode .dropdown-menu .dropdown-item {
    color: #e5e5e5 !important;
}
body.penta-tv-mode .dropdown-menu .dropdown-item:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}
body.penta-tv-mode .dropdown-section-title {
    color: #999 !important;
}
body.penta-tv-mode .dropdown-divider {
    background: rgba(255,255,255,0.1) !important;
}
body.penta-tv-mode .dropdown-item-main {
    background: rgba(229, 9, 20, 0.15) !important;
    color: #ff6b6b !important;
}

/* =========================================
   HERO BANNER
   ========================================= */
.watch-hero {
    position: relative;
    height: 85vh;
    min-height: 550px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    padding-bottom: 5rem;
    margin-top: -100px; /* Go under the fixed header */
    overflow: hidden;
}

/* Hero video background (autoplay muted) — FULL COVER */
.hero-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
/* Force ANY child (div or iframe created by YT API) to fill the wrapper */
.hero-video-bg > * {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 177.78vh !important; /* 16:9 ratio - always wider than viewport */
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 56.25vw !important; /* inverse 16:9 - always taller than viewport */
    max-width: none !important;
    max-height: none !important;
    transform: translate(-50%, -50%) !important;
    border: none !important;
    pointer-events: none !important;
    object-fit: cover !important;
}

/* Gradients overlay on top of video */
.watch-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--penta-dark) 0%, rgba(10,10,10,0.3) 40%, transparent 70%),
                linear-gradient(to right, rgba(0,0,0,0.8) 0%, transparent 55%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: block;
    box-sizing: border-box;
    max-width: 650px;
    padding: 0 4%;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--penta-red);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 3px;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.2rem);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 1.2rem;
    max-width: 850px;
    color: #fff;
    text-shadow: 0 4px 30px rgba(0,0,0,0.8);
    letter-spacing: -2px;
    background: linear-gradient(to bottom, #ffffff 0%, #d0d0d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleAppear 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

.hero-desc {
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 650px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* About Section Styles */
.watch-about {
    padding: 5rem 4%;
    background: linear-gradient(to bottom, #0a0a0a, #050505);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.about-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-badge {
    display: inline-block;
    background: rgba(229, 9, 20, 0.1);
    color: #e50914;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(229, 9, 20, 0.2);
}

.about-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    color: #fff;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -1px;
}

.about-p {
    font-size: 1.1rem;
    color: #b3b3b3;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.about-features {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.feature-item i {
    color: #e50914;
    font-size: 1.1rem;
}

.hero-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-play {
    background-color: white;
    color: black;
    border: none;
    padding: 0.65rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-play:hover {
    background-color: rgba(255,255,255,0.75);
    transform: scale(1.05);
}

.btn-mute {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}
.btn-mute:hover {
    background: rgba(255,255,255,0.25);
    border-color: white;
}

.btn-info {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
    border: none;
    padding: 0.65rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-info:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

.btn-watchlist-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-watchlist-circle.in-list {
    background: white;
    color: black;
}

.btn-watchlist-circle:active {
    transform: scale(0.9);
}

/* =========================================
   CAROUSELS (Rows)
   ========================================= */
.watch-container {
    padding: 0 4%;
    margin-top: -4rem;
    position: relative;
    z-index: 3;
}

.video-row {
    margin-bottom: 2.5rem;
}

.row-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e5e5e5;
    margin-bottom: 0.6em;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.row-title .row-icon {
    color: var(--penta-red);
    font-size: 1rem;
}

.row-posters {
    display: flex;
    overflow-y: hidden;
    overflow-x: scroll;
    padding: 10px 0 30px 4px;
    scroll-behavior: smooth;
    gap: 10px;
}
.row-posters::-webkit-scrollbar { display: none; }
.row-posters {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.row-poster {
    width: 270px;
    min-width: 270px;
    height: 152px;
    border-radius: 6px;
    transition: transform 350ms ease, box-shadow 350ms ease;
    cursor: pointer;
    position: relative;
    background-color: #181818;
    overflow: hidden;
}

.row-poster-img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}
/* Play icon overlay on hover */
.row-poster::after {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
    text-shadow: 0 0 20px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 5;
}
.row-poster:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
}
.row-poster:hover {
    transform: scale(1.15); /* More scale like Netflix */
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 15px rgba(229, 9, 20, 0.2);
}

.poster-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    padding: 30px 10px 10px;
    opacity: 0;
    transition: opacity 0.3s;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    pointer-events: none;
}
.row-poster:hover .poster-details {
    opacity: 1;
}

.poster-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.poster-meta {
    font-size: 0.7rem;
    color: #a3a3a3;
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

/* =========================================
   AD BANNER
   ========================================= */
.watch-ad-banner {
    margin: 2rem 0;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    min-height: 90px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
}

/* Video progress bar on posters */
.poster-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 2;
}
.poster-progress-fill {
    height: 100%;
    background: #e50914; /* Netflix Red */
    transition: width 0.3s ease;
}

/* Row settings for links */
.row-poster {
    text-decoration: none !important;
}

/* ============================================
     MODAL LECTEUR VIDÉO (Now legacy, but keeping styles for potential future use or cleaning up)
     ============================================ */
.video-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.video-modal-backdrop.show {
    display: flex;
    opacity: 1;
}

.video-modal-content {
    width: 92%;
    max-width: 1100px;
    background: #181818;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    transform: scale(0.92);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.video-modal-backdrop.show .video-modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.video-player-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.video-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 1.5rem 2rem 2rem;
}
.video-info-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
}
.video-info-meta {
    font-size: 0.85rem;
    color: #46d369;
    margin-bottom: 1rem;
    font-weight: 600;
}
.video-info-desc {
    color: #d2d2d2;
    line-height: 1.65;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-watchlist {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.btn-watchlist:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
}
.btn-watchlist.in-list {
    background: white;
    color: black;
    border-color: white;
}

/* =========================================
   FOOTER OVERRIDE
   ========================================= */
body.penta-tv-mode footer,
body.penta-tv-mode .site-footer {
    background: var(--penta-darker) !important;
    border-top: 1px solid rgba(255,255,255,0.05) !important;
}

/* =========================================
   RESPONSIVE & MOBILE APP UI
   ========================================= */
@media screen and (max-width: 768px) {
    .watch-hero {
        height: 70vh;
        min-height: 450px;
        margin-top: -70px;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-desc {
        font-size: 0.95rem;
        -webkit-line-clamp: 2;
    }
    .hero-video-bg { 
        display: block !important;
        opacity: 0.7;
    }
    
    /* Dedicated Mobile Posters (Vertical like Netflix) */
    .row-poster {
        width: 140px !important;
        min-width: 140px !important;
        height: 200px !important;
    }
    .row-posters {
        padding: 10px 0 !important;
        gap: 12px !important;
    }

    .row-title {
        font-size: 1rem;
    }
    .video-modal-content {
        width: 98%;
        border-radius: 8px;
    }
    .btn-play {
        padding: 0.5rem 1.2rem;
        font-size: 0.95rem;
    }
    .btn-info {
        display: flex !important; /* Reactivate on mobile */
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    .pb-12 { padding-bottom: 90px !important; }
}

/* Mobile Header */
.watch-mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 10000;
    padding: 0 15px;
    align-items: center;
    justify-content: space-between;
}

/* Hide the standard menu in Penta TV mode */
.main-header {
    display: none !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e50914;
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-left img {
    height: 42px;
    width: 42px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 18px rgba(229, 9, 20, 0.35);
}

.header-left .penta-tv-header-logo {
    display: block;
}

.header-right {
    color: white;
    font-size: 1.4rem;
    padding: 5px;
}

.hero-category-badge {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Dedicated Mobile Tab Bar - Netflix Style */
.watch-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 50%;
    right: auto;
    width: min(100%, 360px) !important;
    max-width: 360px !important;
    transform: translateX(-50%);
    overflow: hidden;
    box-sizing: border-box;
    height: 65px;
    background: linear-gradient(to top, #000 0%, #0a0a0a 100%);
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 99999;
    padding: 0;
    align-items: center;
    justify-content: stretch;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.8);
}

@media (max-width: 768px) {
    .watch-mobile-nav {
        display: flex;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #a3a3a3;
    text-decoration: none;
    gap: 3px;
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    font-weight: 900;
}

.mobile-nav-item span {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.mobile-nav-item.active {
    color: #fff;
}

.mobile-nav-item.active i {
    color: #fff; /* Active is white on Netflix, with red glow sometimes */
}

.mobile-nav-item:active {
    transform: scale(0.92);
}

/* Specific "Return to Site" button styling */
.mobile-nav-item.exit-btn {
    color: #808080;
}
.mobile-nav-item.exit-btn i {
    color: #e50914; /* Red exit icon */
}

/* Mobile Click Area Optimization - ULTRA ROBUST */
.row-poster {
    position: relative;
    overflow: hidden;
    isolation: isolate; /* Create new stacking context */
}

.row-poster > a {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99 !important; /* Above everything inside */
    display: block !important;
    text-decoration: none !important;
    background: transparent !important;
    -webkit-tap-highlight-color: transparent;
}

/* Ensure images and details don't intercept clicks */
.row-poster img, 
.row-poster .poster-details,
.row-poster .poster-progress-container {
    pointer-events: none !important;
}

/* Specific fix for iOS where absolute links sometimes fail inside relative parents */
@media (max-width: 768px) {
    .row-poster {
        cursor: pointer;
    }
}

/* =========================================
   AMÉLIORATIONS 2026 : barre des catégories, titres visibles, flèches, « À propos » compact
   ========================================= */
.watch-categories {
    position: relative;
    z-index: 4;
    margin-top: -4rem;
    padding: 0 4% .5rem;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    overflow-x: auto;
    scrollbar-width: none;
    font-weight: 600;
    font-size: .95rem;
}
.watch-categories::-webkit-scrollbar { display: none; }
.watch-categories a,
.watch-categories button {
    color: #d1d5db;
    white-space: nowrap;
    padding: .45rem 0;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    background: none;
}
.watch-categories a:hover,
.watch-categories button:hover { color: #fff; border-bottom-color: var(--penta-red); }
.watch-categories .watch-categories-propose { margin-left: auto; }
.watch-categories + .watch-container { margin-top: 1rem; }

.row-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.row-arrows { display: flex; gap: .4rem; }
.row-arrow {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border: 0;
    cursor: pointer;
}
.row-arrow:hover { background: rgba(255, 255, 255, .18); }

/* Vignette + titre et source toujours visibles en dessous */
.poster-carte { width: 270px; min-width: 270px; }
.poster-carte .row-poster { width: 100%; min-width: 0; }
.poster-carte .row-poster:hover { transform: scale(1.04); }
.poster-legende { display: block; margin-top: .55rem; text-decoration: none; }
.poster-legende-titre {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #e5e5e5;
    font-weight: 600;
    font-size: .88rem;
    line-height: 1.3;
}
.poster-legende-meta { display: block; color: #8c8c8c; font-size: .75rem; margin-top: .2rem; }
.poster-legende:hover .poster-legende-titre { color: #fff; text-decoration: underline; }

/* « À propos » passé sous les vidéos, en version compacte */
.watch-about-compact { padding: 2.5rem 4%; border-top: 1px solid rgba(255, 255, 255, .06); border-bottom: 0; }
.watch-about-compact .about-title { font-size: 1.5rem; }
.watch-about-compact .about-p { font-size: .95rem; }

@media (max-width: 768px) {
    .row-arrows { display: none; }
    .poster-carte { width: 140px; min-width: 140px; }
    .poster-carte .row-poster { width: 100% !important; min-width: 0 !important; }
    .watch-categories { margin-top: -2.5rem; gap: 1.1rem; font-size: .9rem; }
    .watch-categories .watch-categories-propose { margin-left: 0; }
}

/* Shorts : vraiment verticaux (la largeur de .row-poster l'emportait sur celle de la vignette) */
.row-poster.row-poster-vertical { width: 160px !important; min-width: 160px !important; height: 284px !important; }
@media (max-width: 768px) {
    .row-poster.row-poster-vertical { width: 130px !important; min-width: 130px !important; height: 231px !important; }
}
