/* =========================================
   1. RESET & VARIABLES (PREMIUM MOVIEBOX)
   ========================================= */
:root { 
    --primary: #E50914; 
    --bg: #0b0f19; 
    --surface: #151a28; 
    --light: #ffffff; 
    --gray: #8ba0b2; 
    --whatsapp: #25D366; 
}

* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    outline: none; -webkit-tap-highlight-color: transparent; 
}

body { 
    background-color: var(--bg); 
    color: var(--light); 
    overflow-x: hidden; 
    padding-bottom: 80px; 
}

img { 
    image-rendering: -webkit-optimize-contrast; 
    object-fit: cover; 
}

/* =========================================
   2. LOADER (ÉCRAN DE CHARGEMENT)
   ========================================= */
#loader { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--bg); z-index: 99999; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    transition: opacity 0.5s; 
}
.spinner { 
    border: 4px solid #1f2937; border-top: 4px solid var(--primary); 
    border-radius: 50%; width: 50px; height: 50px; 
    animation: spin 1s linear infinite; margin-bottom: 20px; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================
   3. NAVBAR (HAUT) & RECHERCHE
   ========================================= */
.navbar { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 4%; position: fixed; width: 100%; top: 0; z-index: 5000; 
    background-color: rgba(11, 15, 25, 0.95); 
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); 
    height: 70px;
    transition: 0.3s; 
}

.logo-img { 
    height: 35px; width: auto; object-fit: contain; 
    transition: transform 0.3s; 
}
.logo-img:hover { transform: scale(1.05); }

.search-box { 
    display: flex; background: var(--surface); border-radius: 25px; 
    padding: 10px 20px; width: 100%; max-width: 350px; 
    border: 1px solid #1f2937; box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}
.search-box input { background: transparent; border: none; color: white; width: 100%; font-size: 15px; }
.search-box input::placeholder { color: #5c6b7a; }
.search-box button { background: transparent; border: none; color: var(--gray); cursor: pointer; font-size: 16px;}

.nav-links { list-style: none; display: flex; gap: 25px; }
.nav-links a { text-decoration: none; color: var(--gray); font-size: 15px; font-weight: 600; transition: 0.3s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: white; }

/* =========================================
   4. FILTRES HORIZONTAUX
   ========================================= */
.filter-tabs { 
    display: flex; gap: 25px; overflow-x: auto; 
    padding: 15px 4%; background: var(--bg); 
    position: fixed; top: 70px; left: 0; width: 100%; 
    z-index: 4500; scrollbar-width: none; 
    border-bottom: 1px solid #1f2937; 
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab { 
    background: transparent; color: var(--gray); border: none; 
    font-size: 16px; font-weight: 700; white-space: nowrap; 
    cursor: pointer; padding-bottom: 5px; transition: 0.3s; 
}
.filter-tab.active { color: white; border-bottom: 2px solid white; }

/* =========================================
   5. BARRE DU BAS (MOBILE NAVIGATION)
   ========================================= */
.bottom-nav { 
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; 
    background: rgba(17, 24, 39, 0.95); backdrop-filter: blur(10px);
    border-top: 1px solid #1f2937; z-index: 9000; 
    justify-content: space-around; align-items: center; 
    padding: 12px 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); 
}
.bottom-nav-item { 
    position: relative; display: flex; flex-direction: column; align-items: center; 
    color: #5c6b7a; text-decoration: none; font-size: 11px; gap: 5px; 
    transition: 0.3s; font-weight: 600;
}
.bottom-nav-item i { font-size: 22px; transition: transform 0.2s;}
.bottom-nav-item.active { color: var(--light); }
.bottom-nav-item.active i { color: var(--primary); transform: scale(1.15); }

.notification-badge { 
    position: absolute; top: -5px; right: 5px; background: var(--primary); color: white; 
    font-size: 10px; font-weight: 800; width: 18px; height: 18px; border-radius: 50%; 
    display: flex; justify-content: center; align-items: center; border: 2px solid #111827; 
    z-index: 10; animation: pulseBadge 2s infinite; 
}
@keyframes pulseBadge { 0% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(229, 9, 20, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0); } }

/* =========================================
   6. HERO BANNER (CAROUSEL ANIMÉ)
   ========================================= */
.hero { 
    height: 45vh; margin: 130px 4% 30px 4%; border-radius: 20px; 
    position: relative; display: flex; align-items: flex-end; 
    padding: 40px; background-size: cover; background-position: center top; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); overflow: hidden; transition: background-image 1.5s ease-in-out; 
}
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(11,15,25,1) 0%, rgba(11,15,25,0.4) 50%, transparent 100%); }
.hero-content { position: relative; z-index: 2; max-width: 600px; width: 100%; }
.hero h1 { font-size: 2.8rem; margin: 5px 0 10px 0; text-shadow: 2px 2px 6px black; font-weight: 800; line-height: 1.1;}
.hero-desc { color: #d1d5db; font-size: 15px; margin-bottom: 20px; line-height: 1.5; text-shadow: 1px 1px 3px black; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.btn { padding: 12px 25px; border-radius: 30px; border: none; font-weight: 700; cursor: pointer; margin-right: 15px; font-size: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
.btn-white { background: white; color: black; }

/* =========================================
   7. SECTIONS FILMS, AFFICHES
   ========================================= */
#main-container, #gallery-container, #music-container, #annonces-container, .dl-page-container { padding: 0 4%; }
.category-section { margin-bottom: 35px; }
.category-title { font-size: 1.3rem; margin-bottom: 15px; color: var(--light); font-weight: 700; border-left: 4px solid var(--primary); padding-left: 10px; line-height: 1; }

.movie-row { display: flex; flex-wrap: nowrap; gap: 15px; overflow-x: auto; padding-bottom: 15px; scrollbar-width: none; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.movie-row::-webkit-scrollbar { display: none; }

.movie-card, .gallery-card { 
    flex: 0 0 auto; min-width: 130px; max-width: 130px; height: 195px; 
    border-radius: 10px; overflow: hidden; cursor: pointer; position: relative; 
    box-shadow: 0 6px 12px rgba(0,0,0,0.4); transition: transform 0.3s, box-shadow 0.3s; background-color: #1f2937; 
}
.movie-card img, .gallery-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.movie-card:hover, .gallery-card:hover { transform: scale(1.05); z-index: 5; box-shadow: 0 10px 20px rgba(0,0,0,0.6); }
.movie-card::after, .gallery-card::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 50%; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); pointer-events: none; }

.card-lang { position: absolute; top: 0; right: 0; background: rgba(30, 30, 30, 0.85); color: #ccc; font-size: 10px; font-weight: 800; padding: 4px 6px; border-bottom-left-radius: 6px; z-index: 2; }
.card-rating { position: absolute; bottom: 8px; right: 8px; color: #f5af19; font-size: 15px; font-weight: 900; z-index: 2; text-shadow: 1px 1px 3px black; }
.bientot-badge { position: absolute; top: 6px; left: 6px; background: var(--primary); color: white; font-size: 10px; padding: 4px 8px; border-radius: 6px; font-weight: bold; z-index: 7; box-shadow: 0 2px 5px rgba(0,0,0,0.5); text-transform: uppercase; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 15px; padding-top: 10px;}

/* =========================================
   8. MODAL LECTEUR (MODE GOOGLE DRIVE)
   ========================================= */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg); z-index: 9999; flex-direction: column; overflow-y: auto; scroll-behavior: smooth; }
.modal-content { background: var(--bg); width: 100%; height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; }

.video-container, .modal-cover { position: sticky; top: 0; z-index: 9999; width: 100%; background: black; flex-shrink: 0; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.modal-cover { height: 40vh; background-size: cover; background-position: center; }
.modal-cover::after { content:''; position: absolute; bottom:0; left:0; width:100%; height:60%; background: linear-gradient(to top, var(--bg) 0%, transparent 100%); }
.video-container { aspect-ratio: 16/9; display: none; }
.video-container iframe { width: 100%; height: 100%; border: none; object-fit: contain; }
.video-overlay-fix { position: absolute; top: 0; right: 0; width: 60px; height: 60px; background: #000000; z-index: 10; }

.close-modal { position: absolute; top: 15px; left: 15px; font-size: 22px; color: white; background: rgba(0,0,0,0.6); width: 45px; height: 45px; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 10000; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(5px); transition: 0.2s; }
.close-modal:hover { background: var(--primary); border-color: var(--primary); }

.center-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 45px; color: white; background: rgba(0, 132, 255, 0.85); border: none; border-radius: 50%; width: 80px; height: 80px; cursor: pointer; z-index: 5; box-shadow: 0 0 25px rgba(0, 132, 255, 0.6); transition: 0.3s; }
.center-play:hover { transform: translate(-50%, -50%) scale(1.1); background: #0056b3; }

/* =========================================
   9. LECTEUR VIDÉO PREMIUM (POUR FICHIERS LOCAUX/MP4)
   ========================================= */
.premium-player-wrapper { position: relative; width: 100%; background: #000; aspect-ratio: 16/9; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.9); }
.premium-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-ui-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; justify-content: space-between; opacity: 0; transition: opacity 0.3s ease; z-index: 10; }
.premium-player-wrapper.active .player-ui-overlay, .premium-player-wrapper.paused .player-ui-overlay { opacity: 1; }

.player-top-bar { display: flex; align-items: center; padding: 15px; gap: 15px; background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent); }
.player-back-btn { background: transparent; border: none; color: white; font-size: 20px; cursor: pointer; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.player-title { color: white; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.player-center-area { display: flex; justify-content: space-between; align-items: center; flex: 1; position: relative; }
.double-tap-zone { width: 30%; height: 100%; position: absolute; top: 0; z-index: 15; }
.zone-left { left: 0; } .zone-right { right: 0; }

.player-play-btn { background: transparent; border: none; color: white; font-size: 55px; cursor: pointer; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); transition: transform 0.1s; z-index: 20; }
.player-play-btn:active { transform: scale(0.9); }

.player-bottom-bar { padding: 10px 15px 15px 15px; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); display: flex; flex-direction: column; gap: 8px; }
.player-progress-area { width: 100%; height: 12px; display: flex; align-items: center; cursor: pointer; }
.player-progress-track { width: 100%; height: 3px; background: rgba(255, 255, 255, 0.3); border-radius: 2px; position: relative; transition: height 0.2s; }
.player-progress-area:hover .player-progress-track { height: 6px; }
.player-progress-fill { height: 100%; background: var(--primary); width: 0%; border-radius: 2px; position: relative; }
.player-progress-thumb { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; background: var(--primary); border-radius: 50%; opacity: 0; transition: opacity 0.2s; }
.player-progress-area:hover .player-progress-thumb { opacity: 1; }

.player-tools { display: flex; justify-content: space-between; align-items: center; }
.player-time { color: white; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.player-actions { display: flex; gap: 20px; align-items: center; }
.player-icon-btn { background: transparent; border: none; color: white; font-size: 18px; cursor: pointer; transition: color 0.2s; }
.player-icon-btn:hover { color: var(--primary); }

.skip-indicator { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.6); color: white; padding: 10px 20px; border-radius: 30px; font-weight: bold; font-size: 14px; pointer-events: none; opacity: 0; transition: opacity 0.2s; z-index: 30; display: flex; align-items: center; gap: 8px; }
.skip-indicator.show { opacity: 1; }

/* Bouton pour forcer le PIP (Picture-in-Picture) */
.btn-pip { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.6); color: white; border: 1px solid rgba(255,255,255,0.3); padding: 8px 12px; border-radius: 5px; cursor: pointer; z-index: 20; font-size: 14px; transition: 0.3s; display:none; }
.btn-pip:hover { background: var(--primary); border-color: var(--primary); }

/* =========================================
   10. INFORMATIONS DU FILM (MODAL)
   ========================================= */
.modal-info { padding: 25px; background: var(--bg); flex: 1; overflow-y: auto; position: relative; z-index: 1; }
.modal-title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.modal-title-row h2 { font-size: 26px; line-height: 1.2; font-weight: 800; text-shadow: 1px 1px 2px black;}
.modal-meta { color: var(--gray); font-size: 14px; margin-bottom: 20px; font-weight: 600; display:flex; gap:10px; align-items:center;}

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 25px; }
.btn-action { background: var(--surface); color: white; padding: 12px; border-radius: 12px; text-align: center; text-decoration: none; font-size: 13px; font-weight: bold; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid #1f2937; cursor: pointer; transition: 0.2s; }
.btn-action:hover { background: #1f2937; transform: translateY(-2px); }
.btn-action i { font-size: 22px; }
.btn-action.play { background: var(--primary); color: white; grid-column: span 2; flex-direction: row; justify-content: center; border:none; box-shadow: 0 4px 15px rgba(229,9,20,0.4); font-size: 15px;}
.btn-action.whatsapp { background: var(--whatsapp); border:none; grid-column: span 2; flex-direction: row; justify-content: center; box-shadow: 0 4px 15px rgba(37,211,102,0.3); font-size: 15px;}

/* SÉRIES ET ÉPISODES */
.season-select { width: 100%; padding: 15px; background: var(--surface); color: white; border: 1px solid #1f2937; border-radius: 10px; margin: 20px 0; font-weight: 700; font-size: 16px; outline: none; appearance: none;}
.episodes-list { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 15px; overflow-x: auto; padding-bottom: 15px; scrollbar-width: none; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.episodes-list::-webkit-scrollbar { display: none; }
.episode-item { flex: 0 0 auto; min-width: 220px; max-width: 220px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 15px; background: var(--surface); border-radius: 10px; border: 1px solid #1f2937; cursor: pointer; transition: 0.2s; position: relative; min-height: 90px;}
.episode-item:hover { background: #1f2937; border-color: var(--primary); }
.episode-title { color: white; font-size: 15px; display: flex; align-items: center; gap: 8px; font-weight: bold; margin-bottom: 5px; width: 80%;}
.episode-title i { color: var(--primary); font-size: 18px; }
.episode-meta { color: var(--gray); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 85%; }
.episode-download { position: absolute; top: 15px; right: 15px; color: var(--whatsapp); font-size: 18px; text-decoration:none; transition: 0.2s;}
.episode-download:hover { transform: scale(1.2); }
.btn-load-more { width: 100%; background: transparent; color: var(--primary); border: 1px solid var(--primary); padding: 12px; border-radius: 8px; margin-top: 10px; font-size: 14px; font-weight: bold; cursor: pointer; transition: 0.3s; display: flex; justify-content: center; align-items: center; gap: 8px; }
.btn-load-more:hover { background: var(--primary); color: white; }

/* BARRE DE TELECHARGEMENT */
.dl-progress-container { width: 100%; margin-top: 10px; background: #111827; border-radius: 8px; padding: 10px; border: 1px solid #1f2937; display: none; flex-direction: column; gap: 8px; grid-column: span 2; }
.dl-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray); font-weight: bold; }
.dl-bar-bg { width: 100%; height: 6px; background: #000; border-radius: 3px; overflow: hidden; position: relative; }
.dl-bar-fill { height: 100%; background: var(--whatsapp); width: 0%; transition: width 0.2s ease; box-shadow: 0 0 10px rgba(37, 211, 102, 0.5); }

/* =========================================
   11. RECOMMANDATIONS FIXES (GRILLE BÉTON SANS SCROLL)
   ========================================= */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 15px; width: 100%;}
.rec-card { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: transparent; cursor: pointer; transition: transform 0.2s ease;}
.rec-card:hover { transform: scale(1.05); }
.rec-img-wrapper { width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.5); background-color: #1f2937; }
.rec-img-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-img-wrapper::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 40%; background: linear-gradient(to top, rgba(0,0,0,0.95), transparent); pointer-events: none; }
.rec-card h4 { font-size: 13px; color: #ffffff; font-weight: 600; text-align: left; width: 100%; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.3px;}

/* Mode Cinéma */
body.cinema-mode { background-color: #000 !important; }
body.cinema-mode .bottom-nav { display: none !important; }
body.cinema-mode .modal-content { background-color: #000 !important; }
body.cinema-mode .modal-info { display: none; } /* On cache tout sauf la vidéo en mode cinéma pour une immersion totale */

/* =========================================
   12. NOTIFICATIONS TOAST
   ========================================= */
.toast-notification { position: fixed; top: -100px; left: 50%; transform: translateX(-50%); background: rgba(229, 9, 20, 0.95); color: white; padding: 12px 20px; border-radius: 30px; display: flex; align-items: center; gap: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); z-index: 100000; transition: top 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); backdrop-filter: blur(5px); width: 90%; max-width: 400px; cursor: pointer;}
.toast-notification.show { top: 20px; }
.toast-notification img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid white; }
.toast-text { display: flex; flex-direction: column; }
.toast-tag { font-size: 10px; text-transform: uppercase; font-weight: 800; color: rgba(255,255,255,0.7); letter-spacing: 1px; }
.toast-title { font-size: 14px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }

/* =========================================
   13. BANDEAU INSTALLATION PWA
   ========================================= */
.install-banner { position: fixed; bottom: 85px; left: 10px; right: 10px; background: rgba(21, 26, 40, 0.95); backdrop-filter: blur(10px); border-radius: 16px; display: flex; justify-content: space-between; align-items: center; padding: 15px; z-index: 9999; box-shadow: 0 10px 25px rgba(0,0,0,0.8); border: 1px solid rgba(255,255,255,0.1); }
.install-logo { width: 45px; height: 45px; border-radius: 10px; background: black; padding: 6px; filter: invert(1); }
.install-text h3 { font-size: 15px; color: white; margin: 0; font-weight: 700;}
.btn-install { background: var(--primary); color: white; border: none; padding: 10px 18px; border-radius: 20px; font-weight: 700; box-shadow: 0 4px 10px rgba(229,9,20,0.4); font-size: 13px; cursor:pointer;}
.btn-close { background: transparent; border: none; color: #999; font-size: 22px; margin-left: 12px; cursor: pointer;}

/* =========================================
   14. PAGES TÉLÉCHARGEMENT (LOCAL)
   ========================================= */
.dl-page-container { padding: 90px 4% 100px 4%; max-width: 800px; margin: 0 auto; }
.dl-header { text-align: center; margin-bottom: 30px; }
.dl-header h1 { color: white; font-size: 24px; font-weight: 800;}
.dl-tabs { display: flex; background: #0b0f19; border: 1px solid #1f2937; border-radius: 12px; padding: 5px; margin-bottom: 25px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);}
.dl-tab { flex: 1; padding: 12px; background: transparent; border: none; color: var(--gray); font-size: 14px; font-weight: bold; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.dl-tab.active { background: var(--surface); color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.3); border: 1px solid #1f2937;}
.dl-tab-content { display: none; }
.dl-tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.dl-tools { display: flex; gap: 15px; margin-bottom: 25px; }
.btn-local { flex: 1; background: var(--primary); border: none; color: white; padding: 16px; border-radius: 12px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.3s; box-shadow: 0 4px 15px rgba(229,9,20,0.4); font-size: 15px;}
.btn-local:hover { background: white; color: var(--primary); transform: translateY(-2px);}
.btn-local i { font-size: 20px; }
.btn-clear { background: rgba(229,9,20,0.1); border: 1px solid rgba(229,9,20,0.3); color: var(--primary); padding: 16px; border-radius: 12px; cursor: pointer; transition: 0.3s; font-size: 18px;}
.btn-clear:hover { background: var(--primary); color: white; transform: translateY(-2px);}
.dl-history-box { background: var(--surface); border-radius: 16px; border: 1px solid #1f2937; padding: 20px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.3);}
.dl-item { display: flex; justify-content: space-between; align-items: center; padding: 18px; background: #0b0f19; border-radius: 12px; border-left: 4px solid var(--whatsapp); border: 1px solid #1f2937;}
.dl-item-info { display: flex; flex-direction: column; width: 75%; }
.dl-item-title { color: white; font-size: 15px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px;}
.dl-empty { color: var(--gray); font-size: 15px; text-align: center; padding: 40px 0; font-weight: 500;}

::cue { background-color: rgba(0, 0, 0, 0.8); color: white; font-family: sans-serif; font-size: 16px; }

/* =========================================
   15. RESPONSIVE MOBILE
   ========================================= */
@media (max-width: 768px) {
    .navbar { padding: 10px 15px; height: 60px; }
    .nav-links, .hamburger { display: none !important; }
    .search-box { width: 65%; padding: 6px 12px; }
    .filter-tabs { top: 60px; gap: 20px; padding: 10px 4%; }
    .filter-tab { font-size: 14px; }
    .bottom-nav { display: flex; }
    
    .hero { height: 38vh; margin: 110px 4% 20px 4%; border-radius: 14px; padding: 20px; }
    .hero h1 { font-size: 1.8rem; }
    
    .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 85px; }
    .movie-row { padding-bottom: 10px; }
    .movie-card { width: 115px; min-width: 115px; height: 175px; }
    .gallery-card { width: 100%; height: 160px; min-width: auto; }
    
    .rec-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; overflow-x: hidden; }
    .card-rating { font-size: 14px; }
    .card-lang { font-size: 11px; padding: 4px 6px;}
    
    .modal { height: 100vh; height: 100dvh; border-radius: 0; }
    .modal-content { max-height: none; height: 100%; border-radius: 0; margin-top: 0;}
    .close-modal { top: 10px; left: 10px; }
    .video-container { position: sticky; top: 0; z-index: 9999; }
    
    .request-container { flex-direction: column; margin-top: 80px; padding-bottom: 100px;}
    .price-card, .form-section { width: 100%; }
    .page-header-fix { padding-top: 85px; text-align: center; }
}

/* =========================================
   16. MODE PAYSAGE (LANDSCAPE) & FULLSCREEN FIX
   ========================================= */
@media screen and (orientation: landscape) and (max-height: 500px) {
    body.cinema-mode .modal-info { display: none !important; }
    body.cinema-mode .video-container { height: 100vh !important; width: 100vw !important; position: fixed; top: 0; left: 0; z-index: 100000; }
    body.cinema-mode .premium-player-wrapper { border-radius: 0; }
    body.cinema-mode .close-modal { top: 5px; left: 5px; transform: scale(0.8); opacity: 0.5; z-index: 100001; } 
}
.video-container:fullscreen { width: 100vw !important; height: 100vh !important; display: flex; justify-content: center; align-items: center; background: black; }
.video-container:fullscreen iframe, .video-container:fullscreen video { width: 100%; height: 100%; }
.premium-player-wrapper:fullscreen { width: 100vw !important; height: 100vh !important; border-radius: 0; }

/* =========================================
   17. OPTIMISATION ORDINATEUR (DESKTOP)
   ========================================= */
@media (min-width: 769px) {
    body { display: flex; flex-direction: column; align-items: center; background-color: #05070c; }
    .navbar, .hero, #main-container, #gallery-container, #music-container, #annonces-container, .profile-header-app, .profile-menu, .filter-tabs, .dl-page-container { width: 100%; max-width: 1400px; margin-left: auto; margin-right: auto; }
    .navbar { left: 50%; transform: translateX(-50%); border-bottom: 1px solid rgba(255,255,255,0.05); }
    .filter-tabs { left: 50%; transform: translateX(-50%); border-bottom: 1px solid rgba(255,255,255,0.05); }
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: var(--bg); }
    ::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 5px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--primary); }
    .hero { margin: 130px 4% 30px 4%; }
    .movie-card, .gallery-card { min-width: 160px; max-width: 160px; height: 240px; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; padding-top: 120px; }
    .rec-grid { grid-template-columns: repeat(6, 1fr); gap: 15px;}
    .modal-content { width: 85%; max-width: 1100px; height: 88vh; border-radius: 16px; box-shadow: 0 25px 60px rgba(0,0,0,0.9); border: 1px solid #1f2937; margin-top: 2vh; }
    .nav-links i.fa-arrow-left { display: none; }
}

/* =========================================
   18. PAGES PROFIL & DEMANDE
   ========================================= */
.profile-header-app { text-align: center; padding: 90px 20px 30px 20px; background: linear-gradient(to bottom, #151a28, var(--bg)); }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; background: var(--primary); color: white; font-size: 45px; display: flex; justify-content: center; align-items: center; margin: 0 auto 15px auto; border: 4px solid #1f2937; box-shadow: 0 8px 20px rgba(229,9,20,0.3);}
.profile-menu { padding: 0 4%; max-width: 600px; margin: 0 auto; }
.menu-item { display: flex; align-items: center; padding: 18px; background: var(--surface); margin-bottom: 12px; border-radius: 14px; color: white; text-decoration: none; font-weight: 600; border: 1px solid #1f2937; transition: 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.2);}
.menu-item i { font-size: 22px; color: var(--gray); margin-right: 18px; width: 30px; text-align: center; }
.menu-item:hover { background: #1f2937; transform: translateX(5px); border-color: var(--primary); }
.request-container { display: flex; max-width: 1000px; margin: 90px auto 50px auto; padding: 20px; gap: 40px; align-items: flex-start; }
.price-card { flex: 1; background: linear-gradient(135deg, #f5af19, #f12711); color: #1a1a1a; padding: 40px; border-radius: 20px; text-align: center; box-shadow: 0 15px 30px rgba(241, 39, 17, 0.3);}
.form-section { flex: 1.5; background: var(--surface); padding: 35px; border-radius: 20px; border: 1px solid #1f2937; box-shadow: 0 10px 25px rgba(0,0,0,0.5);}
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 15px; background: #0b0f19; border: 1px solid #1f2937; color: white; border-radius: 10px; margin-top:8px; margin-bottom:20px; font-size: 15px; transition: 0.3s;}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(229,9,20,0.2); }
.btn-submit { width: 100%; background: var(--primary); color: white; padding: 16px; font-size: 16px; border: none; border-radius: 10px; cursor: pointer; font-weight: 800; box-shadow: 0 6px 20px rgba(229,9,20,0.4); transition: 0.3s;}
.btn-submit:hover { background: white; color: var(--primary); transform: translateY(-2px); }
.bio-card { background: var(--surface); margin: -40px 4% 25px 4%; position: relative; z-index: 10; padding: 25px; border-radius: 16px; border: 1px solid #1f2937; box-shadow: 0 15px 30px rgba(0,0,0,0.6); text-align: left; }
.bio-card h4 { color: #f5af19; font-size: 18px; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; font-weight: 800; }
.bio-card p { color: #d1d5db; font-size: 14px; line-height: 1.7; }
.bio-card p strong { color: white; }