/* =========================================
   1. VARIABLES & PALETTE "DEEP SPACE"
   ========================================= */
:root {
    /* --- COULEURS --- */
    --bg-void: #000000;      /* Noir pur */
    --bg-abyss: #020617;     /* Bleu très sombre */
    --bg-surface: #0f172a;   /* Bleu nuit pour les cartes */
    
    /* Marque */
    --primary: #7c3aed;      /* Violet Principal */
    --primary-hover: #6d28d9; 
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    --secondary-gradient: linear-gradient(to right, #8E2DE2, #4A00E0);
    
    /* Texte */
    --text: #f8fafc;         
    --text-muted: #94a3b8;   
    
    /* Accents */
    --accent: #8b5cf6;       
    --accent-glow: 0 0 30px rgba(124, 58, 237, 0.4);
    
    /* États */
    --success: #10b981;      
    --warning: #f59e0b;      
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-void);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

a { text-decoration: none; color: white; transition: 0.3s; }
ul { list-style: none; }
html { scroll-behavior: smooth; }

/* =========================================
   2. HEADER & NAV
   ========================================= */
header, .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo-container { display: flex; align-items: center; }

.logo {
    height: 45px; 
    width: auto; 
    object-fit: contain;
    display: block;
}
.logo:hover { transform: scale(1.05); filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.6)); }

.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-link { 
    color: #cbd5e1; font-weight: 600; font-size: 0.85rem; 
    text-transform: uppercase; letter-spacing: 1px; 
    position: relative; padding: 5px 0;
}
.nav-link:hover { color: var(--primary); }
.nav-links a::after {
    content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0;
    background-color: var(--primary); transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }

.btn-login {
    background: var(--primary);
    padding: 8px 25px; border-radius: 6px;
    font-weight: 700; font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}
.btn-login:hover { background: var(--accent); transform: translateY(-2px); }

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    min-height: 100vh;
    background: radial-gradient(circle at center, #1e293b 0%, var(--bg-void) 70%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 120px 20px 40px 20px;
}

.hero-logo {
    width: 450px; max-width: 90%; height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 40px rgba(124, 58, 237, 0.3));
    animation: fadeIn 1.5s ease-in-out;
}

.hero p {
    font-size: 1.3rem; color: var(--text-muted); 
    margin-bottom: 40px; max-width: 600px;
}

.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.price-teaser {
    color: var(--accent); font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; font-size: 0.9rem; margin-bottom: -10px;
}

.btn-cta-main {
    background: var(--primary-gradient);
    padding: 16px 50px; border-radius: 8px;
    font-size: 1.1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
    border: 2px solid transparent;
}
.btn-cta-main:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.6); 
    background: transparent; border-color: var(--primary);
}

.divider-text {
    font-size: 0.8rem; color: rgba(255,255,255,0.4); 
    text-transform: uppercase; letter-spacing: 1px; 
    margin: 10px 0;
}

.hero-apps { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }
.app-pill {
    background: rgba(255,255,255,0.1); padding: 10px 20px; 
    border-radius: 6px; font-size: 0.9rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px; color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.1);
}
.app-pill:hover { background: rgba(255,255,255,0.2); color: white; transform: translateY(-3px); }

/* Scroll Indicator */
.scroll-indicator {
    margin-top: auto; padding-bottom: 20px;
    display: flex; flex-direction: column; align-items: center;
    color: rgba(255,255,255,0.5); font-size: 0.8rem;
    animation: bounce 2s infinite; cursor: pointer;
}
.scroll-indicator i { font-size: 1.5rem; color: var(--primary); margin-top: 5px; }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* =========================================
   4. CATALOGUE
   ========================================= */
.catalog-wrapper {
    background-color: var(--bg-void);
    padding-top: 20px; padding-bottom: 60px;
    position: relative;
    background: linear-gradient(to bottom, var(--bg-void) 0%, var(--bg-void) 100%);
}

.row-title {
    text-align: left; margin-left: 5%; margin-bottom: 15px; color: white;
    font-size: 1.1rem; font-weight: 700; text-transform: uppercase;
    border-left: 4px solid var(--accent-color); padding-left: 15px;
}

/* Tapis Roulant */
.movie-grid {
    display: flex; overflow: hidden; position: relative; width: 100%; padding: 20px 0;
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.movie-track {
    display: flex; gap: 0; width: max-content;
    transform: translate3d(0, 0, 0); will-change: transform;
    animation: scroll 60s linear infinite; 
}
.movie-track:hover { animation-play-state: paused; }

.movie-card-wrapper {
    flex: 0 0 auto; width: 150px; margin-right: 15px;
}

.movie-poster {
    width: 100%; height: 225px; border-radius: 8px;
    object-fit: cover; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: block; transition: transform 0.3s;
}
.movie-poster:hover { transform: scale(1.08); z-index: 10; box-shadow: 0 10px 25px rgba(0,0,0,0.8); }

.music-cover {
    aspect-ratio: 1/1; width: 100%; height: auto;
    border-radius: 8px; display: block;
}

/* Lien invisible sur les affiches */
.movie-link {
    text-decoration: none; color: inherit; display: block; cursor: pointer;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   5. PAGE RECHERCHE
   ========================================= */
.search-page-container {
    padding-top: 140px; max-width: 900px; margin: 0 auto; text-align: center;
}
.search-input-wrapper { position: relative; width: 100%; margin-bottom: 40px; }

#search-box {
    width: 100%; padding: 20px 60px 20px 30px;
    font-size: 1.2rem; background: rgba(30, 41, 59, 0.8);
    border: 2px solid #334155; border-radius: 50px; 
    color: white; outline: none; backdrop-filter: blur(10px);
}
#search-box:focus { border-color: var(--primary); box-shadow: 0 0 20px rgba(124, 58, 237, 0.3); }
.search-icon { position: absolute; right: 25px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 1.5rem; }

#search-results {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 30px; padding: 20px; 
    max-width: 1200px; margin: 0 auto;
}
.movie-card-result { width: 100%; overflow: hidden; transition: transform 0.3s; }
.movie-card-result:hover { transform: translateY(-10px); }

.poster-container {
    width: 100%; aspect-ratio: 2/3; border-radius: 8px; 
    overflow: hidden; background: #1e293b; position: relative;
    border: 2px solid transparent;
}
.movie-card-result:hover .poster-container { border-color: var(--primary); }

.movie-poster-search { width: 100%; height: 100%; object-fit: cover; }
.movie-title-search {
    font-size: 0.95rem; margin-top: 10px; white-space: nowrap; 
    overflow: hidden; text-overflow: ellipsis; display: block; font-weight: 600;
}
.year-badge {
    position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.8);
    color: var(--primary); padding: 2px 8px; border-radius: 4px; font-weight: bold; font-size: 0.8rem;
}

/* Loader */
.loader {
    display: none; border: 4px solid #1e293b; border-top: 4px solid var(--primary);
    border-radius: 50%; width: 50px; height: 50px;
    animation: spin 1s linear infinite; margin: 40px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================
   6. ABONNEMENTS (BOUTONS & DESIGN)
   ========================================= */
.pricing-section {
    padding: 100px 20px; text-align: center;
    background: linear-gradient(to bottom, var(--bg-void) 0%, var(--bg-abyss) 100%);
}

.pricing-container {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 40px;
    max-width: 1200px; margin: 0 auto; margin-top: 60px;
}

/* CARTE DE BASE (Sombre & Solide) */
.card {
    background-color: var(--bg-surface); 
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 50px 30px;
    width: 100%; max-width: 360px;
    display: flex; flex-direction: column; justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.card:hover { transform: translateY(-15px); border-color: var(--primary); }

/* CARTE POPULAIRE (Highlight) */
.card.highlight {
    border: 2px solid var(--primary);
    box-shadow: 0 0 50px rgba(124, 58, 237, 0.2);
    transform: scale(1.05);
    z-index: 2;
    background-color: #131c31; 
}

/* Badge "Populaire" */
.popular-badge {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: white;
    padding: 8px 25px; border-radius: 30px;
    font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.4);
}

.card h3 { font-size: 1.8rem; margin-bottom: 10px; color: white; font-weight: 800; }
.card .price { font-size: 3rem; font-weight: 900; margin-bottom: 30px; color: var(--primary); }
.card .price span { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

.features { margin-bottom: 40px; text-align: left; }
.features li {
    margin-bottom: 15px; color: #cbd5e1; display: flex; gap: 15px; align-items: center; font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px;
}
.features li i { color: white; font-weight: bold; font-size: 1.2rem; }

/* BOUTONS D'ABONNEMENT (VISIBLE !) */
.btn-subscribe {
    display: block; width: 100%; padding: 18px;
    border-radius: 12px; font-weight: 800; text-align: center;
    transition: 0.3s; text-transform: uppercase; letter-spacing: 1px;
    margin-top: auto; cursor: pointer; text-decoration: none;
}

/* Bouton Contour (Offres basiques) */
.btn-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
}
.btn-outline:hover {
    border-color: white; background: rgba(255,255,255,0.1);
    transform: scale(1.02);
}

/* Bouton Plein (Offre Standard - Violet) */
.btn-fill {
    background: var(--primary);
    border: none; color: white;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}
.btn-fill:hover { 
    background: var(--primary-hover); 
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.5); 
    transform: scale(1.02);
}

/* Badge Climate */
.climate-badge {
    display: inline-flex; align-items: center; gap: 15px;
    background: rgba(16, 185, 129, 0.05); border: 1px solid #059669;
    padding: 12px 30px; border-radius: 50px; 
    font-size: 0.9rem; color: #34d399; margin-bottom: 50px;
    text-decoration: none; transition: 0.3s;
}
.climate-badge:hover { background: rgba(16, 185, 129, 0.1); transform: translateY(-3px); }
.climate-icon-box {
    display: flex; justify-content: center; align-items: center;
    background-color: #10b981; color: #020617; width: 40px; height: 40px; border-radius: 50%;
}

/* =========================================
   7. PAGE 404 & 403 (GLITCH & EFFETS)
   ========================================= */
.error-container {
    /* On garde min-height pour remplir l'écran */
    min-height: 100vh; 
    
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    text-align: center;
    background: radial-gradient(circle at center, #1e293b 0%, #000 100%);
    padding: 20px; 
    overflow: hidden;
    
    /* LA CORRECTION MAGIQUE : */
    padding-top: 100px; /* On force le contenu à descendre sous le header */
    margin-top: 0;      /* Pas de marge externe pour garder le fond bien collé en haut */
}

.glitch {
    font-size: 10rem; font-weight: 900; color: white; position: relative;
    text-shadow: 2px 2px 0px var(--primary), -2px -2px 0px var(--accent);
    animation: glitch-anim 2s infinite linear alternate-reverse;
    line-height: 1; margin-bottom: 20px;
}
.glitch::before, .glitch::after {
    content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #000;
}
.glitch::before {
    left: 2px; text-shadow: -2px 0 #ff00c1; clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px; text-shadow: -2px 0 #00fff9; clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

.error-subtitle { font-size: 2.5rem; margin-bottom: 20px; color: var(--accent); font-weight: 800; }
.error-text { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 40px; max-width: 700px; }
.error-actions { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }

@keyframes glitch-anim {
    0% { transform: translate(0) } 20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) } 60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) } 100% { transform: translate(0) }
}
@keyframes glitch-anim-2 {
    0% { clip: rect(10px, 9999px, 30px, 0); } 20% { clip: rect(40px, 9999px, 60px, 0); }
    40% { clip: rect(20px, 9999px, 40px, 0); } 60% { clip: rect(130px, 9999px, 150px, 0); }
    80% { clip: rect(70px, 9999px, 90px, 0); } 100% { clip: rect(0, 0, 0, 0); }
}

/* =========================================
   8. PAGE MAINTENANCE (COMING SOON)
   ========================================= */
.maintenance-container {
    min-height: 85vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    padding: 20px;
}
.maintenance-icon { font-size: 6rem; color: var(--warning); margin-bottom: 30px; animation: pulse 2s infinite; }
.maintenance-title { 
    font-size: 3rem; font-weight: 900; margin-bottom: 20px; color: white; 
    text-transform: uppercase;
}
.maintenance-text {
    color: #cbd5e1; font-size: 1.2rem; max-width: 600px; margin-bottom: 40px;
}

@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.8; } 100% { transform: scale(1); opacity: 1; } }

/* =========================================
   9. PAGES ACTIVATION & SUCCESS
   ========================================= */
.activation-container, .success-container {
    min-height: 85vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    padding: 40px 20px;
}

.form-box {
    background: rgba(30, 41, 59, 0.8); padding: 40px; border-radius: 20px;
    max-width: 450px; width: 100%; border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}
.form-box input {
    width: 100%; padding: 15px; margin: 10px 0;
    background: #0f172a; border: 1px solid #334155; color: white;
    border-radius: 8px; outline: none; transition: 0.3s;
}
.form-box input:focus { border-color: var(--primary); box-shadow: 0 0 10px rgba(124, 58, 237, 0.2); }
.form-box label { display: block; text-align: left; color: var(--accent); font-weight: bold; margin-top: 15px; }

.icon-success { font-size: 5rem; color: var(--success); margin-bottom: 20px; animation: popIn 0.5s; }
.success-box-info {
    background: rgba(255,255,255,0.05); padding: 30px; border-radius: 15px;
    max-width: 500px; border: 1px solid rgba(255,255,255,0.1); margin-top: 30px;
}

@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* =========================================
   10. FAQ & FOOTER
   ========================================= */
/* Section Jellyseerr */
.request-section {
    padding: 80px 20px; text-align: center;
    background: linear-gradient(to bottom, var(--bg-abyss) 0%, #000 100%); /* Retour au noir pour le footer */
}
.jellyseerr-box {
    background: linear-gradient(135deg, #1e293b, #0f172a); border: 1px solid #334155;
    padding: 40px; border-radius: 20px; max-width: 800px; margin: 0 auto;
}
.btn-secondary {
    display: inline-block; margin-top: 30px; padding: 12px 35px;
    background: white; color: var(--bg-abyss); border-radius: 30px; font-weight: bold;
}
.btn-secondary:hover { background: #cbd5e1; }
.faq-section {
    padding: 80px 20px; background-color: var(--bg-abyss); text-align: center;
}
.faq-container { max-width: 800px; margin: 0 auto; text-align: left; margin-top: 40px; }
.faq-item {
    background-color: rgba(30, 41, 59, 0.3); border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 15px; border-radius: 8px; overflow: hidden; transition: 0.3s;
}
.faq-item:hover { border-color: var(--primary); }
summary {
    padding: 20px; font-weight: bold; cursor: pointer; color: white;
    display: flex; justify-content: space-between; align-items: center;
}
.faq-content { padding: 0 20px 20px 20px; color: var(--text-muted); line-height: 1.6; }

footer {
    padding: 50px 20px; text-align: center; background: black;
    color: #64748b; font-size: 0.85rem; border-top: 1px solid #1e293b;
}

/* =========================================
   11. MOBILE
   ========================================= */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-logo { max-width: 300px; }
    .scroll-indicator { display: none !important; }
    
    img.music-cover { 
        width: 100% !important; height: auto !important; 
        aspect-ratio: 1/1; object-fit: cover; 
    }
    .movie-card-wrapper { width: 120px !important; margin-right: 15px !important; flex-shrink: 0 !important; }
    
    .pricing-container { flex-direction: column; align-items: center; }
    .glitch { font-size: 6rem; }
    .maintenance-title { font-size: 2rem; }
}

/* --- SECTION ADMINISTRATION --- */

.admin-container {
    max-width: 1100px;
    margin: 120px auto 60px; /* Marge en haut pour ne pas être caché par le menu */
    padding: 20px;
    min-height: 60vh;
}

/* Les cartes d'admin */
.admin-card {
    background: #1e293b; /* Slate 800 */
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #334155;
    padding-bottom: 20px;
}

/* Formulaires Admin */
.form-group {
    margin-right: 15px;
}

.input-admin {
    background: #0f172a;
    border: 1px solid #475569;
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.input-admin:focus {
    border-color: #7c3aed;
}

/* Tableaux de données */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95rem;
}

.data-table th {
    background: #0f172a;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 15px;
    text-align: left;
    border-radius: 8px 8px 0 0;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #334155;
    color: #e2e8f0;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges (Statut) */
.badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-active { background: rgba(74, 222, 128, 0.15); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.2); }
.badge-expired { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* Bouton suppression */
.btn-icon-delete {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-delete:hover {
    background: #ef4444;
    color: white;
}

/* --- FIX LAYOUT ADMIN --- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header, footer {
    flex-shrink: 0;
}

/* Le contenu principal prend toute la place disponible */
.admin-container, .activation-container, .maintenance-container, .error-container, #catalog {
    flex-grow: 1;
    width: 100%;
}

/* Classe pour les pages texte (403, Login, etc.) pour éviter que le menu cache le contenu */
.page-offset {
    padding-top: 90px;
}

/* Optionnel : Assure-toi que le footer reste en bas sur les pages vides */
.page-offset {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}