/* --- Variables de couleurs --- */
:root {
    --bg-dark: #050505;
    --bg-grey: #121212;
    --bg-light-grey: #2a2a2a;
    --accent-yellow: #ffd700;
    --text-white: #ffffff;
    --text-grey: #aaaaaa;
}

/* --- Reset et Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
    position: relative;
    animation: pageFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* --- Fond Animé Géométrique --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        linear-gradient(rgba(255, 215, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, 0.1) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 215, 0, 0.15) 1px, transparent 1px);
    background-size: 50px 50px, 50px 50px, 100px 100px;
    background-position: 0 0, 0 0, 50px 50px;
    animation: backgroundGridPan 60s linear infinite;
}

@keyframes backgroundGridPan {
    from { background-position: 0 0, 0 0, 50px 50px; }
    to { background-position: 1000px 1000px, 1000px 1000px, 1050px 1050px; }
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Barre de navigation --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: linear-gradient(to bottom, rgba(5,5,5,0.9), transparent);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: 0.3s ease;
}

.logo { font-size: 24px; font-weight: 800; letter-spacing: 2px; }
.logo span { color: var(--accent-yellow); }

.nav-links { list-style: none; display: flex; gap: 30px; }
.nav-links a { text-decoration: none; color: var(--text-grey); font-weight: 600; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--text-white); }

.user-actions { display: flex; align-items: center; gap: 15px; }

/* --- Barre de Recherche --- */
.search-container { position: relative; }
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-light-grey);
    border-radius: 25px;
    padding: 5px 15px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    padding: 5px;
    width: 140px;
    font-size: 0.9rem;
    transition: width 0.4s;
}

.search-input:focus { width: 220px; }

.btn-search {
    background: transparent;
    border: none;
    color: var(--accent-yellow);
    cursor: pointer;
    font-size: 1.1rem;
}

/* --- Boutons Utilisateur (Connexion, Profil, Déconnexion) --- */
.btn-login {
    padding: 8px 20px;
    background-color: transparent;
    color: var(--accent-yellow);
    border: 2px solid var(--accent-yellow);
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-login:hover {
    background-color: var(--accent-yellow);
    color: var(--bg-dark);
}

.user-profile-link {
    color: var(--accent-yellow);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
}

.user-profile-link:hover {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    color: #fff;
}

.btn-logout {
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 15px;
    border: 1px solid var(--bg-light-grey);
    border-radius: 5px;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.05);
}

.btn-logout:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: #ff6b7a;
}

.btn-primary, .btn-secondary {
    padding: 12px 30px; font-size: 1rem; font-weight: 600; border: none; border-radius: 5px; cursor: pointer; transition: 0.3s;
}

.btn-primary { background-color: var(--accent-yellow); color: var(--bg-dark); }
.btn-primary:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); }
.btn-secondary { background-color: rgba(255,255,255,0.1); color: var(--text-white); margin-left: 15px; }
.btn-secondary:hover { background-color: rgba(255,255,255,0.2); }

/* --- Section Hero DYNAMIQUE --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 50px;
    position: relative;
    background-color: var(--bg-dark);
    transition: background-image 1s ease-in-out;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(5,5,5,1) 0%, rgba(5,5,5,0.5) 45%, transparent 100%),
                linear-gradient(to top, rgba(5,5,5,1) 0%, transparent 20%);
    z-index: 1;
}

.hero-content { position: relative; z-index: 2; max-width: 650px; transition: opacity 0.5s ease-in-out; }
.badge { background-color: var(--accent-yellow); color: var(--bg-dark); padding: 5px 10px; font-weight: 800; border-radius: 3px; font-size: 12px; text-transform: uppercase; }

/* --- Rangées de films --- */
.filter-bar { padding: 20px 50px 0 50px; display: flex; align-items: center; gap: 15px; margin-top: 10px; }
.filter-bar label { font-weight: 600; font-size: 1.1rem; color: var(--text-grey); }
.genre-select { background-color: var(--bg-light-grey); color: white; border: 1px solid var(--accent-yellow); padding: 10px 15px; border-radius: 5px; outline: none; cursor: pointer; font-size: 1rem; font-family: 'Poppins', sans-serif; }

.movie-row { padding: 40px 50px; }
.movie-row h2 { margin-bottom: 20px; font-size: 1.8rem; border-left: 4px solid var(--accent-yellow); padding-left: 15px; }
.carousel { display: flex; gap: 20px; overflow-x: auto; padding: 20px 0; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }

.movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 25px; width: 100%; padding-bottom: 20px;}

.movie-card {
    min-width: 220px;
    height: 330px;
    background-color: var(--bg-grey);
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    background-position: center;
    background-size: cover;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center bottom;
    will-change: transform;
}

.movie-card:hover {
    transform: scale(1.15) translateY(-10px);
    border-color: var(--accent-yellow);
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0,0,0,0.9);
    border-radius: 8px;
}

/* --- Modales (Général) --- */
.modal, .video-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-grey);
    padding: 40px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--bg-light-grey);
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn, .close-video {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-grey);
    font-size: 30px;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover, .close-video:hover { color: var(--accent-yellow); }

/* --- Formulaires Auth --- */
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form h2 { margin-bottom: 20px; color: var(--text-white); }
.auth-form input {
    width: 100%; padding: 12px; margin-bottom: 15px;
    background-color: var(--bg-light-grey); border: 1px solid transparent;
    color: var(--text-white); border-radius: 5px; outline: none;
}
.auth-form input:focus { border-color: var(--accent-yellow); }
.w-100 { width: 100%; }
.auth-form p { margin-top: 20px; font-size: 0.9rem; text-align: center; color: var(--text-grey); }
.auth-form a { color: var(--accent-yellow); text-decoration: none; font-weight: 600; }

/* --- Lecteur Vidéo --- */
.video-container {
    width: 85%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    border: 2px solid var(--accent-yellow);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.close-video { top: -45px; right: 0; }

/* --- Page Profil --- */
.profile-page-wrapper {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 100px 20px;
}

.profile-card {
    background-color: var(--bg-grey); width: 100%; max-width: 600px;
    border-radius: 15px; padding: 40px; border: 1px solid var(--bg-light-grey);
    position: relative; overflow: hidden;
}

.profile-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 100px;
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.1), transparent);
}

.profile-avatar {
    width: 80px; height: 80px; background-color: var(--accent-yellow);
    color: var(--bg-dark); font-size: 2.5rem; font-weight: 800;
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%; margin-bottom: 20px; position: relative;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-grey); font-size: 0.9rem; }
.form-group input {
    width: 100%; padding: 12px; background-color: var(--bg-dark);
    border: 1px solid var(--bg-light-grey); color: var(--text-white); border-radius: 8px; outline: none;
}
.form-group input:focus { border-color: var(--accent-yellow); }

.profile-actions { display: flex; gap: 15px; margin-top: 30px; }
.btn-cancel {
    flex: 1; padding: 12px; text-align: center; border: 1px solid var(--text-grey);
    border-radius: 5px; color: white; text-decoration: none;
}

/* --- Alertes --- */
.alert { padding: 15px; border-radius: 8px; margin-bottom: 25px; font-weight: 600; text-align: center; position: relative; z-index: 1; }
.alert.success { background-color: rgba(40, 167, 69, 0.1); color: #4dd86a; border: 1px solid #28a745; }
.alert.error { background-color: rgba(220, 53, 69, 0.1); color: #ff6b7a; border: 1px solid #dc3545; }

/* --- Page Film --- */
.movie-page-container { width: 100%; min-height: 100vh; padding-top: 0; }
.details-header { height: 70vh; background-size: cover; background-position: top center; position: relative; display: flex; align-items: flex-end; padding: 60px 50px; }
.details-header::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-dark) 0%, rgba(5,5,5,0.5) 50%, transparent 100%); }
.details-header-info { position: relative; z-index: 2; width: 100%; max-width: 1200px; margin: 0 auto; }
.details-header-info h1 { font-size: 4rem; font-weight: 800; margin: 15px 0 10px 0; text-shadow: 2px 2px 10px black; }
.details-meta { font-size: 1.2rem; margin-bottom: 10px; color: var(--text-grey); }
.details-genres { font-size: 1rem; color: #ccc; }
.btn-back { display: inline-block; color: white; text-decoration: none; font-weight: 600; padding: 10px 20px; background: rgba(255,255,255,0.1); border-radius: 5px; transition: 0.3s; }
.btn-back:hover { background: rgba(255,255,255,0.2); color: var(--accent-yellow); }
.details-main { max-width: 1200px; margin: 0 auto; padding: 40px 50px; }

.details-body { display: grid; grid-template-columns: 2fr 1.5fr; gap: 50px; margin-bottom: 60px; align-items: start; }
.details-synopsis, .details-cast { min-width: 0; }

.details-synopsis h3 { color: white; margin-bottom: 15px; font-size: 1.5rem; border-left: 3px solid var(--accent-yellow); padding-left: 10px; }
.details-synopsis p { color: var(--text-grey); line-height: 1.8; font-size: 1.1rem; }
.details-cast p { color: var(--text-grey); margin-bottom: 15px; font-size: 1rem; line-height: 1.5; }
.details-cast strong { color: white; display: block; margin-bottom: 5px; }
.details-video-wrapper { width: 100%; margin-bottom: 50px; }
.details-video-container { width: 100%; aspect-ratio: 16/9; background: #000; border: 2px solid var(--accent-yellow); box-shadow: 0 0 30px rgba(255, 215, 0, 0.1); border-radius: 10px; overflow: hidden; }

/* --- RECHERCHE EN DIRECT (LIVE) --- */
.live-search-results { position: absolute; top: 110%; left: 0; width: 300px; background: var(--bg-grey); border: 1px solid var(--bg-light-grey); border-radius: 8px; max-height: 400px; overflow-y: auto; z-index: 3000; display: none; box-shadow: 0 10px 30px rgba(0,0,0,0.9); }
.live-search-item { display: flex; align-items: center; gap: 15px; padding: 12px; cursor: pointer; border-bottom: 1px solid #222; text-decoration: none; color: white; transition: 0.2s; }
.live-search-item:hover { background: var(--bg-light-grey); border-left: 3px solid var(--accent-yellow); }
.live-search-img { width: 45px; height: 65px; object-fit: cover; border-radius: 4px; }
.live-search-info h4 { font-size: 0.9rem; margin-bottom: 3px; }
.live-search-info span { font-size: 0.75rem; color: var(--accent-yellow); }

/* --- SKELETON LOADING --- */
.skeleton { background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite linear; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { min-width: 200px; height: 330px; border-radius: 10px; border: none; }
.skeleton-hero { height: 100vh; width: 100%; }

/* --- CERCLES POUR LES ACTEURS --- */
.cast-container { display: flex; gap: 15px; overflow-x: auto; padding: 10px 0 20px 0; scrollbar-width: thin; scrollbar-color: var(--accent-yellow) var(--bg-dark); }
.actor-circle-link { display: flex; flex-direction: column; align-items: center; text-decoration: none; min-width: 80px; max-width: 80px; transition: transform 0.3s ease; }
.actor-circle-link:hover { transform: scale(1.1); }
.actor-circle-img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; transition: border 0.3s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.6); flex-shrink: 0; }
.actor-circle-link:hover .actor-circle-img { border-color: var(--accent-yellow); }
.actor-circle-name { color: var(--text-white); font-size: 0.75rem; text-align: center; margin-top: 8px; line-height: 1.2; }
.actor-circle-link:hover .actor-circle-name { color: var(--accent-yellow); }

/* --- MULTI-SERVEURS ET PLEIN ÉCRAN --- */
.server-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; padding: 10px; background: rgba(255,255,255,0.05); border-radius: 8px; }
.btn-server { padding: 8px 15px; background: var(--bg-dark); color: var(--text-white); border: 1px solid var(--text-grey); border-radius: 5px; cursor: pointer; transition: 0.3s; font-size: 0.9rem; font-weight: 600; }
.btn-server:hover { border-color: var(--accent-yellow); color: var(--accent-yellow); }
.btn-server.active { background: var(--accent-yellow); color: var(--bg-dark); border-color: var(--accent-yellow); }
.btn-fullscreen { margin-left: auto; padding: 8px 15px; background: #17a2b8; color: white; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; transition: 0.3s; display: flex; align-items: center; gap: 5px; }
.btn-fullscreen:hover { background: #138496; transform: scale(1.05); }

/* --- EFFETS ADMIN ET BANNISSEMENT --- */
.text-admin-animated { background: linear-gradient(90deg, #ffd700, #ff8c00, #ff0055, #ffd700); background-size: 300% 100%; color: transparent; -webkit-background-clip: text; background-clip: text; animation: admin-glow 2.5s linear infinite; font-weight: 900; text-shadow: 0 0 15px rgba(255, 215, 0, 0.4); display: inline-block; }
@keyframes admin-glow { 0% { background-position: 100% 0; } 100% { background-position: -200% 0; } }
.btn-ban { background-color: rgba(220, 53, 69, 0.1); color: #ff6b7a; border: 1px solid #dc3545; padding: 5px 10px; border-radius: 5px; cursor: pointer; transition: 0.3s; font-weight: 600; font-size: 0.8rem; }
.btn-ban:hover { background-color: #dc3545; color: white; transform: scale(1.05); }

/* --- AVIS ET COMMENTAIRES --- */
.review-card { background: var(--bg-dark); border: 1px solid var(--bg-light-grey); border-radius: 10px; padding: 20px; position: relative; margin-bottom: 15px; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review-author { font-weight: bold; font-size: 1.1rem; }
.review-date { font-size: 0.8rem; color: var(--text-grey); }
.review-rating { color: var(--accent-yellow); font-size: 1.1rem; margin-bottom: 10px; letter-spacing: 2px; }
.review-text { color: var(--text-grey); line-height: 1.6; }
.btn-delete-review { position: absolute; top: 15px; right: 15px; background: rgba(220, 53, 69, 0.2); color: #ff6b7a; border: 1px solid #dc3545; border-radius: 5px; padding: 5px 10px; cursor: pointer; transition: 0.3s; font-size: 0.8rem; font-weight: 600; }
.btn-delete-review:hover { background: #dc3545; color: white; transform: scale(1.05); }
.review-form-container { background: var(--bg-grey); padding: 25px; border-radius: 10px; border: 1px solid var(--bg-light-grey); margin-bottom: 30px; }

/* --- AVATARS ET DISCORD --- */
.btn-discord { background-color: #5865F2; color: white; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 5px; text-decoration: none; font-weight: bold; transition: 0.3s; width: 100%; box-sizing: border-box; }
.btn-discord:hover { background-color: #4752C4; transform: scale(1.02); }
.review-header-left { display: flex; align-items: center; gap: 15px; }
.review-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-yellow); box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.profile-avatar-img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent-yellow); margin-bottom: 15px; background: var(--bg-light-grey); }
.admin-table-avatar { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 10px; border: 1px solid var(--accent-yellow); }
.user-badge { background: linear-gradient(45deg, #ff0055, #ff8c00); color: white; font-size: 0.65rem; padding: 3px 8px; border-radius: 12px; margin-left: 10px; font-weight: bold; text-transform: uppercase; box-shadow: 0 2px 5px rgba(255,0,85,0.5); vertical-align: middle; }

/* --- LOADER GLOBAL --- */
#global-loader { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: var(--accent-yellow); z-index: 9999; animation: loadingBar 1.5s infinite ease-in-out; display: none; }
@keyframes loadingBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* --- CHAT ET NOTIFICATIONS --- */
.chat-msg { max-width: 80%; padding: 10px 15px; border-radius: 15px; margin-bottom: 5px; font-size: 0.9rem; line-height: 1.4; word-wrap: break-word; }
.chat-msg.user { align-self: flex-end; background: var(--accent-yellow); color: black; border-bottom-right-radius: 2px; }
.chat-msg.admin { align-self: flex-start; background: #333; color: white; border-bottom-left-radius: 2px; }
.chat-time { font-size: 0.7rem; opacity: 0.7; text-align: right; margin-top: 5px; }
.notif-dropdown { position: absolute; top: 40px; right: -10px; width: 300px; background: #111; border: 1px solid #333; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); z-index: 10000; display: none; flex-direction: column; opacity: 0; transform: translateY(-15px); transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); cursor: default; }
.notif-dropdown.show { display: flex; opacity: 1; transform: translateY(0); }
.notif-header { padding: 10px 15px; background: #222; font-weight: bold; font-size: 0.9rem; border-bottom: 1px solid #333; border-radius: 8px 8px 0 0; color: var(--accent-yellow); text-align: left; }
.notif-item { padding: 12px 15px; border-bottom: 1px solid #222; cursor: pointer; transition: background 0.2s; text-align: left; }
.notif-item:last-child { border-bottom: none; border-radius: 0 0 8px 8px; }
.notif-item:hover { background: #1a1a1a; }
.notif-user { font-weight: bold; font-size: 0.9rem; color: white; display: flex; justify-content: space-between; }
.notif-snippet { font-size: 0.8rem; color: var(--text-grey); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-unread-badge { background: #dc3545; color: white; font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; }


/* =========================================
   🖥️ SUR PC : On cache le menu spécial mobile
========================================= */
.mobile-icons {
    display: none;
}

/* =========================================
   📱 SUR MOBILE (< 992px) : Le tour de magie
========================================= */
@media screen and (max-width: 992px) {
    
    /* 1. On CACHE le menu classique et les boutons PC */
    .nav-links, .user-actions {
        display: none !important;
    }

    /* 2. On AFFICHE les icônes mobiles */
    .mobile-icons {
        display: flex !important;
        gap: 20px;
        align-items: center;
        font-size: 24px;
        color: white;
        cursor: pointer;
    }

    /* 3. On aligne Logo à gauche, Icônes à droite */
    .navbar {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 15px 20px !important;
    }

    /* 4. On rétrécit et on centre le gros titre (Peaky Blinders) */
    .hero-content {
        text-align: center !important;
        padding: 0 20px;
    }
    
    h1, .hero-title {
        font-size: 38px !important;
        line-height: 1.2;
        margin-top: 20px;
    }

    /* On force les boutons du Hero à se centrer sur mobile */
    .hero-buttons {
        display: flex;
        justify-content: center;
        gap: 15px;
        width: 100%;
        margin-top: 20px;
    }

    /* On cache l'espacement initial du bouton secondaire */
    .btn-secondary {
        margin-left: 0;
    }
}