/* ==========================================================================
   1. RESET & VARIABLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary-color: #e50914;
    --primary-hover: #cc0812;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-input: #2a2a2a;
    --text-main: #ffffff;
    --text-muted: #999999;
    --transition: all 0.3s ease;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   2. NAVIGATION
   ========================================================================== */
.navbar {
    background: var(--bg-card);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.7);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.logo {
    height: 40px;
    width: auto;
}
.logo-text h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    letter-spacing: -1px;
}
.tagline {
    color: #666;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    text-transform: uppercase;
    font-weight: bold;
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}
.nav-menu a {
    color: var(--text-main);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.95rem;
}
.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary-color);
}

/* ==========================================================================
   3. HERO & RECHERCHE
   ========================================================================== */
.hero {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(rgba(10, 10, 10, 0.7), rgba(10, 10, 10, 0.7)),
                linear-gradient(135deg, #1a1a1a 0%, #333 100%);
}
.hero h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 800;
}
.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
}
.search-section {
    padding: 2.5rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid #222;
}
.search-container {
    max-width: 700px;
    margin: 0 auto 2rem;
    display: flex;
    gap: 0.8rem;
}
#searchInput {
    flex: 1;
    padding: 1rem;
    border: 1px solid #333;
    border-radius: 6px;
    background: var(--bg-input);
    color: white;
    font-size: 1rem;
    outline: none;
}
#searchInput:focus {
    border-color: var(--primary-color);
}
#searchBtn {
    padding: 0 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}
#searchBtn:hover {
    background: var(--primary-hover);
}
.filters {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.filters select {
    padding: 0.6rem 1.2rem;
    background: var(--bg-input);
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    min-width: 160px;
}

/* ==========================================================================
   4. GRILLE DE CONTENU
   ========================================================================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2.5rem;
    padding: 4rem 2rem;
    max-width: 1300px;
    margin: 0 auto;
}
.content-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.content-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(229, 9, 20, 0.2);
}
.content-thumbnail {
    width: 100%;
    height: 380px;
    object-fit: cover;
}
.content-info {
    padding: 1.5rem;
}
.content-type {
    font-size: 0.7rem;
    background: #333;
    color: #eee;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 0.8rem;
    display: inline-block;
    text-transform: uppercase;
}
.content-title {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
}
.content-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}
.content-rating {
    color: #ffb400;
    font-weight: bold;
}
.content-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* ==========================================================================
   5. MODAL (LECTEUR VIDÉO)
   ========================================================================== */
#videoModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none !important;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
#videoModal.active {
    display: flex !important;
    opacity: 1;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}
.modal-content {
    position: relative;
    background: var(--bg-card);
    width: 95%;
    max-width: 1000px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-height: 90vh;              /* --- clé --- */
    display: flex;
    flex-direction: column;
}
.video-container {
    background: #000;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(90vh - 200px); /* --- clé --- */
}
#videoPlayer {
    width: 100%;
    height: 100%;
}
.video-info {
    padding: 2.5rem;
    overflow-y: auto;
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(229, 9, 20, 0.9);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.modal-close:hover {
    transform: rotate(90deg);
    background: var(--primary-color);
}
body.modal-open {
    overflow: hidden;
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
footer {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-card);
    color: #666;
    border-top: 1px solid #222;
}
footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .nav-container { flex-direction: column; gap: 1.5rem; }
    .hero h2 { font-size: 2rem; }
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
        padding: 2rem 1rem;
    }
    .modal-content { width: 100%; height: 100%; max-width: none; border-radius: 0; }
    .video-container { flex: 1; aspect-ratio: auto; }
    .video-info { padding: 1.5rem; max-height: 35vh; overflow-y: auto; }
    .modal-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 1.4rem; }
}

@media (max-width: 600px) {
    .video-info { padding: 1rem; font-size: 0.9rem; max-height: 30vh; }
    .modal-close { top: 8px; right: 8px; width: 32px; height: 32px; font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .hero h2 { font-size: 1.6rem; }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
    .video-info h3 { font-size: 1rem; }
    .video-info p { font-size: 0.8rem; }
}

@media (max-height: 500px) and (orientation: portrait) {
    .video-container { flex: 0 0 60%; }
    .video-info { max-height: 40vh; }
}
