/* =========================================
   1. GLOBAL
   ========================================= */
:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --accent: #8a2be2;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: white;
}

/* =========================================
   2. NAVBAR
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2%;
    background: #000;
    border-bottom: 1px solid #333;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
}

.highlight {
    color: var(--accent);
}

.search-container {
    display: flex;
    background: var(--bg-panel);
    border-radius: 20px;
    padding: 5px 15px;
}

.search-container input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
}

.search-container button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* --- USER ICON CIRCULAIRE --- */
.user-icon {
    display: flex;
    /* Pour centrer le contenu */
    justify-content: center;
    /* Centre horizontalement */
    align-items: center;
    /* Centre verticalement */
    width: 40px;
    /* Largeur fixe */
    height: 40px;
    /* Hauteur fixe (identique à largeur) */
    background-color: #000000;
    /* Le bleu de ton image (ou garde #8a2be2 pour le violet) */
    color: var(--accent);
    /* Couleur du texte/icone */
    border-radius: 50%;
    /* C'est CELA qui crée le cercle parfait */
    font-size: 1.2rem;
    /* Taille de l'icone/lettre */
    text-decoration: none;
    /* Pas de soulignement */
    border: 2px solid #111111;
    /* Petite bordure sombre pour détacher du fond */
    transition: transform 0.2s ease;
    overflow: hidden;
    /* Pour couper ce qui dépasse */
    box-shadow: 0 0 10px #8a2be2;
}

.user-icon:hover {
    transform: scale(1.1);
    /* Petit effet de zoom au survol */
    cursor: pointer;
    border-color: #8a2be2;
    box-shadow: 0 0 20px #8a2be2;
}

/* =========================================
   3. CATALOG
   ========================================= */

.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background-color: #1a1a1a;
    color: #ccc;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    /* MODIFICATION ICI : Aura violette douce + bordure légère */
    border: 1px solid #8a2be2;
    box-shadow: 0 0 10px #8a2be2;

    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.home-button:hover {
    background-color: #2d2d2d;
    color: #fff;
    transform: translateY(-2px);
    /* MODIFICATION ICI : L'aura devient plus intense et plus grande au survol */
    border-color: #8a2be2;
    box-shadow: 0 0 20px #8a2be2;
}

.home-button::before {
    content: "\f015";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 8px;
    /* Couleur de la maison (violet clair pour aller avec l'aura) */
    color: #8a2be2;
}

/* --- NOUVEAU STYLE : SEARCH BAR & HEADER --- */

/* Conteneur du haut : Titre + Loupe */
.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-bottom: 10px;
    height: 50px;
}

/* Bouton Loupe */
.search-toggle-btn {
    background: transparent;
    border: 2px solid transparent;
    /* Bordure transparente pour éviter le décalage */
    color: #ccc;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-toggle-btn:hover {
    color: #9b59b6;
    /* Violet au survol */
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.3);
}

/* Barre de recherche cachée par défaut */
.expandable-search-container {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out;
    background: #111;
    padding: 0 20px;
    margin-bottom: 0px;
}

/* Classe ajoutée via JS pour afficher la barre */
.expandable-search-container.active {
    max-height: 100px;
    /* Assez haut pour contenir l'input */
    opacity: 1;
    padding: 20px;
    padding: 20px;
    border-bottom: 1px solid #333;
}

/* Style de l'input qui prend toute la largeur */
.full-width-search {
    width: 100%;
    padding: 12px 20px;
    font-size: 1.1rem;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 25px;
    color: #fff;
    outline: none;
    font-family: inherit;
}

.full-width-search:focus {
    border-color: #9b59b6;
}

/* Spacer pour centrer le titre parfaitement */
.header-spacer {
    width: 50px;
    /* Doit être environ la même largeur que le bouton loupe */
}

.layout-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 250px;
    background: #181818;
    border-right: 1px solid #333;
    padding: 20px;
    flex-shrink: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
    position: sticky;
    top: 60px;
}

.sidebar-header h3 {
    margin-top: 0;
    color: var(--accent);
}

#tagSearchInput {
    width: 100%;
    padding: 8px;
    background: #000;
    border: 1px solid #333;
    color: white;
    border-radius: 5px;
    margin-bottom: 20px;
}

.cat-title {
    display: block;
    font-weight: bold;
    margin: 15px 0 5px 0;
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
    cursor: pointer;
}

.cat-title:hover,
.cat-title.active-cat {
    color: var(--accent);
    border-color: var(--accent);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag-link {
    font-size: 0.8rem;
    background: #252525;
    padding: 2px 8px;
    border-radius: 4px;
    color: #ccc;
}

.tag-link:hover {
    background: var(--accent);
    color: white;
}

.content {
    flex-grow: 1;
    padding: 30px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: var(--bg-panel);
    border-radius: 8px;
    overflow: hidden;
    transition: 0.3s;
    position: relative;
    display: block;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.card-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
}

.card-info {
    padding: 10px;
}

.card-info h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tags-display {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    height: 20px;
    overflow: hidden;
}

.tag-badge {
    font-size: 0.6rem;
    border: 1px solid #444;
    padding: 0 4px;
    border-radius: 3px;
    color: #999;
}

/* =========================================
   4. LANDING PAGE
   ========================================= */
.landing-body {
    overflow: hidden;
    background-color: #000;
}

.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: auto;
}

.landing-section {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.welcome-screen {
    position: relative;
}

.blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #222, #000);
    filter: blur(20px);
    z-index: 0;
}

.welcome-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.welcome-content h1 {
    font-size: 5rem;
    margin: 0;
    font-weight: 300;
    letter-spacing: 5px;
}

.welcome-content h2 {
    font-size: 3rem;
    margin: 0;
    font-weight: 700;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 2s ease-out forwards;
    transform: translateY(30px);
}

.delay {
    animation-delay: 0.6s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: #888;
    z-index: 2;
    transition: 0.3s;
}

.scroll-indicator:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.bounce {
    font-size: 2rem;
    color: #ffffff;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
        opacity: 0.8;
    }

    50% {
        transform: translateY(15px);
        opacity: 1;
    }

    100% {
        transform: translateY(0px);
        opacity: 0.8;
    }
}

.universe-screen {
    position: relative;
    background-color: #050505;
}

.universe-screen::before {
    content: "";
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image: url('https://www.transparenttextures.com/patterns/black-felt.png');
    background-size: cover;
    filter: blur(6px) brightness(0.6);
    z-index: 0;
}

.content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.landing-title {
    font-size: 3rem;
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    opacity: 0;
    animation: fadeIn 1.5s ease-out 0.5s forwards;
}

.choice-grid {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.choice-card {
    width: 280px;
    height: 420px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.choice-card .card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    transition: 0.6s ease;
    filter: grayscale(100%) brightness(0.7);
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.film-card .card-bg {
    background-image: url('https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?q=80&w=600&auto=format&fit=crop');
}

.serie-card .card-bg {
    background-image: url('https://images.unsplash.com/photo-1522869635100-1f4906a1f94d?q=80&w=600&auto=format&fit=crop');
}

.anime-card .card-bg {
    background-image: url('https://images.unsplash.com/photo-1629813134268-d05541c4391b?q=80&w=600&auto=format&fit=crop');
}

.choice-card:hover {
    transform: translateY(-15px) scale(1.03);
    border-color: rgba(138, 43, 226, 0.5);
    box-shadow: 0 20px 50px rgba(138, 43, 226, 0.2);
}

.choice-card:hover .card-bg {
    opacity: 0.9;
    filter: grayscale(0%) brightness(1);
    transform: scale(1.1);
}

.choice-card .content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.choice-card i {
    font-size: 4.5rem;
    margin-bottom: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 50%;
    transition: 0.5s;
}

.choice-card:hover i {
    background: var(--accent);
    transform: rotate(10deg);
}

.choice-card h2 {
    font-size: 2.2rem;
    margin: 0;
    font-family: 'Arial Black', sans-serif;
    text-transform: uppercase;
    text-shadow: -2px 2px 0px rgba(255, 0, 0, 0.6), 2px -2px 0px rgba(0, 255, 255, 0.6);
}

.btn-all {
    margin-top: 50px;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 30px;
    border-radius: 50px;
    transition: 0.4s;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.btn-all:hover {
    color: black;
    background: white;
    border-color: white;
    transform: scale(1.05);
}

/* =========================================
   5. WATCH PAGE & LANGUAGE FILTER
   ========================================= */
.details-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.details-left {
    flex: 1;
    max-width: 400px;
}

.poster-wrapper {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
}

.poster-wrapper img {
    width: 100%;
    display: block;
}

.details-right {
    flex: 2;
}

.media-title {
    font-size: 3rem;
    margin: 0 0 10px 0;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 5px;
}

.media-meta {
    color: #888;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.episodes-header h3 {
    margin: 0;
    color: #aaa;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-selector label {
    font-size: 0.9rem;
    color: #888;
}

.lang-selector select {
    background: #111;
    color: white;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.episode-card {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid #333;
}

.episode-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.2);
}

.episode-card img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    opacity: 0.7;
    transition: 0.3s;
}

.episode-card:hover img {
    opacity: 1;
}

.ep-info {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a;
}

.ep-number {
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
}

.ep-info i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Language Badges */
.lang-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

.lang-badge.VOSTFR {
    background-color: #8a2be2;
}

.lang-badge.VF {
    background-color: #007bff;
}

.lang-badge.English {
    background-color: #28a745;
}

.lang-badge.Raw {
    background-color: #6c757d;
}

/* PLAYER OVERLAY */
.video-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.video-container-modal {
    width: 80%;
    max-width: 1000px;
    position: relative;
    background: black;
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.2);
}

.close-video {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.btn-back {
    display: inline-block;
    background: #333;
    padding: 10px 20px;
    border-radius: 5px;
}

.btn-back:hover {
    background: var(--accent);
}

/* =========================================
   6. ADMIN PANEL
   ========================================= */
.admin-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.admin-panel {
    width: 100%;
    background: #1e1e1e;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.panel-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.admin-panel h2 {
    color: var(--accent);
    margin: 0 0 5px 0;
    font-size: 1.8rem;
}

.admin-panel p {
    color: #888;
    margin: 0;
    font-size: 0.9rem;
}

.separator-arrow {
    color: #555;
    font-weight: bold;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: bold;
    color: #ccc;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 12px;
    background: #121212;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    outline: none;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.tags-large-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    height: 500px;
    overflow-y: auto;
    background: #111;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #444;
}

.tag-section-label {
    grid-column: 1 / -1;
    color: var(--accent);
    font-weight: bold;
    margin-top: 10px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 4px;
    transition: 0.2s;
    cursor: pointer;
}

.checkbox-label:hover {
    background: #222;
    color: white;
}

.checkbox-label input {
    transform: scale(1.2);
    cursor: pointer;
}

.big-select {
    font-size: 1.1rem;
    padding: 15px;
    background: #000;
    border: 1px solid var(--accent);
    color: white;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}

.btn-submit:hover {
    background: #9d4edd;
}

.btn-submit.secondary {
    background: #444;
}

.btn-submit.secondary:hover {
    background: #666;
}

.btn-submit.btn-delete {
    background-color: #2a0a0a;
    border: 1px solid #551111;
    color: #ffcccc;
    margin-top: 15px;
}

.btn-submit.btn-delete:hover {
    background-color: #8a0000;
    border-color: #ff0000;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

.btn-submit.btn-delete-soft {
    background-color: #333;
    border: 1px solid #555;
    color: #ccc;
    margin-top: 10px;
}

.btn-submit.btn-delete-soft:hover {
    background-color: #444;
    border-color: #777;
    color: white;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .layout-container {
        display: block;
    }

    .choice-grid {
        flex-direction: column;
        height: 60vh;
        overflow-y: auto;
        gap: 20px;
    }

    .choice-card {
        width: 90vw;
        height: 140px;
        flex-direction: row;
        justify-content: flex-start;
        padding-left: 20px;
    }

    .choice-card i {
        font-size: 2rem;
        margin: 0 20px 0 0;
        background: none;
        padding: 0;
    }

    .choice-card h2 {
        font-size: 1.5rem;
    }

    .details-container {
        flex-direction: column;
        align-items: center;
    }

    .details-left {
        max-width: 100%;
        width: 100%;
    }

    .media-title {
        font-size: 2rem;
    }

    .video-container-modal {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* --- NOUVEAUX BOUTONS DRAPEAUX (VO/VF) --- */

.lang-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.flag-btn {
    width: 60px;
    height: 35px;
    border-radius: 6px;
    border: 2px solid #333;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 0;

    /* Par défaut (non sélectionné) : Sombre et un peu transparent */
    opacity: 0.5;
    filter: grayscale(80%);
    transform: scale(0.95);
}

/* Texte par dessus (VO / VF) */
.flag-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    font-family: sans-serif;
    color: black;
    /* Texte noir comme sur ton image */
    text-shadow: 0 0 2px white;
    /* Petit contour blanc pour lisibilité */
    font-size: 1rem;
    z-index: 2;
}

/* --- DRAPEAU JAPON (VO) --- */
/* Fond blanc avec un cercle rouge au centre */
.vo-flag {
    background: radial-gradient(circle, #bc002d 35%, #ffffff 36%);
    background-color: white;
    /* Sécurité */
}

/* --- DRAPEAU FRANCE (VF) --- */
/* Trois bandes verticales : Bleu, Blanc, Rouge */
.vf-flag {
    background: linear-gradient(90deg,
            #002395 0%, #002395 33.3%,
            #ffffff 33.3%, #ffffff 66.6%,
            #ed2939 66.6%, #ed2939 100%);
}

/* --- BOUTON GLOBE (TOUS) --- */
.all-flag {
    background: #333;
    color: white;
    border: 2px solid #555;
    display: flex;
    justify-content: center;
    align-items: center;
}

.all-flag i {
    font-size: 1.2rem;
}

/* --- ÉTAT ACTIF (Sélectionné) --- */
.flag-btn.active {
    opacity: 1;
    /* Pleine couleur */
    filter: grayscale(0%);
    transform: scale(1.1);
    /* Grossit légèrement */
    border-color: white;
    /* Bordure blanche brillante */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Au survol (Hover) */
.flag-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* --- CONTROLS AREA (Seasons + Lang) --- */
.controls-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

/* Season Selector */
.season-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.season-tab-btn {
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: 0.3s;
}

.season-tab-btn:hover {
    border-color: var(--accent);
    color: white;
}

.season-tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.4);
}

/* Responsive adjustment */
@media (max-width: 600px) {
    .controls-area {
        flex-direction: column-reverse;
        /* Langue au dessus sur mobile */
        align-items: flex-start;
    }
}

/* =========================================
   7. PLAYER MODAL & CONTROLS (UPDATE)
   ========================================= */

/* On améliore le conteneur principal */
.video-container-modal {
    width: 90%;
    max-width: 1100px;
    background: #181818;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #333;
}

/* En-tête du lecteur (Titre + Bouton Fermer) */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #111;
    border-bottom: 1px solid #333;
}

.modal-title-text {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    margin: 0;
}

.btn-close-modern {
    background: #333;
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.btn-close-modern:hover {
    background: #e74c3c;
    /* Rouge au survol */
    transform: rotate(90deg);
}


/* Zone du lecteur (Iframe) */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* Ratio 16:9 */
    height: 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Barre de contrôles (Précédent / Suivant) */
.modal-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #111;
    border-top: 1px solid #333;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #252525;
    color: white;
    border: 1px solid #444;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    user-select: none;
}

.nav-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #1a1a1a;
    border-color: #333;
    transform: none;
}

.nav-btn i {
    font-size: 1rem;
}

/* Admin Login Page */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
}

.login-box {
    background: #1e1e1e;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #fff;
    text-align: center;
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.login-box p {
    color: #888;
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #8a2be2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-btn:hover {
    background: #9d4edd;
}

.error-message {
    background: #2a0a0a;
    border: 1px solid #551111;
    color: #ffcccc;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.success-message {
    background: #0a2a0a;
    border: 1px solid #115511;
    color: #ccffcc;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 0.85rem;
}

.logo_login {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: 800;
}

.logo_login a {
    color: #fff;
    text-decoration: none;
}

.logo_login .highlight {
    color: #8a2be2;
}

/* Icon */

.logo-icon {
    background: var(--accent);
    /* Ton violet #8a2be2 */
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    /* Carré arrondi */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    transform: rotate(-5deg);
    /* Petit effet de style incliné */
}

.logo a:hover .logo-icon {
    transform: rotate(0deg) scale(1.1);
    transition: 0.3s;
}

/* Player Selector */
/* --- CUSTOM DROPDOWN (Menu Personnalisé) --- */
.custom-select-wrapper {
    position: relative;
    width: 220px;
    margin: 10px auto 25px auto;
    /* Centré */
    user-select: none;
    font-size: 1rem;
    z-index: 5;
}

/* Le bouton principal (fermé) */
.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    border: 2px solid #333;
    border-radius: 12px;
    /* Arrondi du bouton principal */
    padding: 10px 15px;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
}

.custom-select-trigger:hover {
    border-color: #555;
}

/* La flèche */
.custom-select-trigger i {
    color: #8a2be2;
    /* Violet */
    font-size: 0.8rem;
    transition: transform 0.3s;
}

/* Liste des options (Le menu déroulant) */
.custom-options {
    position: absolute;
    top: 110%;
    /* Juste en dessous du bouton */
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    /* ARRONDIS DU MENU DÉROULANT */
    overflow: hidden;
    /* Important pour que les options ne dépassent pas */
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* État ouvert */
.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: #8a2be2;
    /* Bordure violette quand ouvert */
}

.custom-select-wrapper.open .custom-select-trigger i {
    transform: rotate(180deg);
    /* La flèche tourne */
}

/* Les options individuelles */
.custom-option {
    padding: 12px 15px;
    cursor: pointer;
    color: #ccc;
    transition: all 0.2s;
}

/* Survol des options */
.custom-option:hover {
    background-color: #8a2be2;
    /* Fond Violet */
    color: white;
}

/* Option sélectionnée */
.custom-option.selected {
    background-color: #2a2a2a;
    color: #8a2be2;
    font-weight: bold;
}

/* Ajustement pour la 3ème section */
.latest-screen {
    background: #111;
    /* Fond sombre */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 80px;
    overflow-y: auto;
    /* Permet de scroller si beaucoup d'épisodes */
}

.latest-header {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Grille des épisodes */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 0 5%;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 50px auto;
    box-sizing: border-box;
}

/* Carte d'épisode */
.ep-card {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: white;
    position: relative;
    display: block;
}

.ep-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 69, 0, 0.4);
    /* Couleur orange style ALStream */
}

.ep-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    position: relative;
}

.ep-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 69, 0, 0.9);
    color: white;
    padding: 2px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
    font-weight: bold;
}


.ep-title {
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-time {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 5px;
}

/* Bouton scroll bas sur la section Universe */
.scroll-down-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    animation: bounce 2s infinite;
}

/* --- PAGE AUTHENTIFICATION (Sliding Effect) --- */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    background: #0f1115;
    font-family: 'Poppins', sans-serif;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

.auth-logo span {
    color: #8a2be2;
}

/* Conteneur principal */
.container {
    background-color: #111111;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25),
        0 10px 10px rgba(0, 0, 0, 0.22),
        0 0 20px rgba(138, 43, 226, 0.2);
    /* Lueur violette */
    position: relative;
    overflow: hidden;
    width: 768px;
    max-width: 100%;
    min-height: 480px;
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
}

/* Formulaire Connexion (Par défaut à gauche) */
.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

/* Formulaire Inscription (Caché au début) */
.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

/* ANIMATION D'ACTIVATION */
.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}

@keyframes show {

    0%,
    49.99% {
        opacity: 0;
        z-index: 1;
    }

    50%,
    100% {
        opacity: 1;
        z-index: 5;
    }
}

/* Overlay (Le panneau coloré qui glisse) */
.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.container.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: #8a2be2;
    background: -webkit-linear-gradient(to right, #6a11cb, #2575fc);
    background: linear-gradient(to right, #8a2be2, #4b0082);
    /* Dégradé Violet */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.container.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.overlay-left {
    transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0);
}

.overlay-right {
    right: 0;
    transform: translateX(0);
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}

/* STYLE DES ÉLÉMENTS INTERNES */
form {
    background-color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    text-align: center;
    color: white;
}

h1 {
    font-weight: bold;
    margin: 0;
    margin-bottom: 10px;
}

p {
    font-size: 14px;
    font-weight: 100;
    line-height: 20px;
    letter-spacing: 0.5px;
    margin: 20px 0 30px;
}

a.social {
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    margin: 15px 0;
}

/* Champs de saisie */
input {
    background-color: #0f1115;
    border: 1px solid #333;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
    color: white;
    border-radius: 4px;
    outline: none;
    transition: 0.3s;
}

input:focus {
    border-color: #8a2be2;
    box-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
}

/* Boutons */
button {
    border-radius: 20px;
    border: 1px solid #8a2be2;
    background-color: #8a2be2;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in;
    margin-top: 20px;
    cursor: pointer;
}

button:active {
    transform: scale(0.95);
}

button:focus {
    outline: none;
}

button.ghost {
    background-color: transparent;
    border-color: #FFFFFF;
}

.error-msg {
    color: #ff4757;
    font-size: 0.8rem;
    margin-top: 10px;
}

.forgot-pass {
    color: #aaa;
    font-size: 0.8rem;
    text-decoration: none;
    margin: 10px 0;
}

.social-container {
    margin: 20px 0;
}

.social-container a {
    border: 1px solid #ddd;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    height: 40px;
    width: 40px;
    color: white;
    border-color: #333;
    transition: 0.3s;
}

.social-container a:hover {
    background-color: #8a2be2;
    border-color: #8a2be2;
}

/* =========================================
                Planning
   ========================================= */

/* Ligne de séparation sous le titre principal */
.planning-separator {
    border: none;
    height: 1px;
    background-color: #2a2a2a;
    /* Couleur par défaut (gris) */
    margin-bottom: 30px;
    transition: background-color 0.4s ease;
    /* Joli effet de transition */

}

.planning-wrapper {
    max-width: 1300px;
    margin: 50px auto;
    padding: 0 10px;
    color: #fff;
}

/* Grille semaine */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 20px;
    border: none !important;
}


.day-column {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* En-tête */
.day-header {
    border-bottom: none !important;
    background: transparent !important;
    padding-bottom: 15px;
    text-align: center;
}

.day-column.active .day-header {
    background: #0b0b0b;
    border-bottom: 2px solid var(--accent);
}

.day-column.active {
    background: #39125eb0;
}

.dh-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}


.dh-date {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 5px;
}

.day-column.active .dh-date {
    color: #ccc;
}

.day-column.active .dh-name {
    color: #7d2ae8;
}


/* Corps */
.day-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Carte */
.p-card {
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    height: auto;
    margin-bottom: 15px;
}

.p-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.p-card:hover .pc-img-box img {
    transform: scale(1.05);
}

.pc-img-box {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

.pc-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pc-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.badge {
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.jp {
    background: white;
    color: black;
}

.p-card:hover .pc-info {
    max-height: 100px;
    opacity: 1;
    padding-bottom: 5px;
}

.pc-info {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 10px;
    background-color: #1a1a1a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pc-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
    line-height: 1.3;
}

.pc-footer {
    padding: 10px;
    background-color: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.pc-btn {
    background: #1e093179;
    color: #8a2be2;
    border: 1px solid #1a2a3d;
    border-radius: 3px;
    font-size: 0.75rem;
    padding: 5px;
    text-align: center;
    font-weight: 600;
}

/* Le style "Bouton/Cadre" autour de l'heure comme sur ton dessin */
.time-box {
    background-color: #2a2a2a;
    border: 2px solid #333;
    color: #fff;
    padding: 5px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 90%;
    justify-content: center;
    transition: background 0.3s;
}

/* L'heure s'allume au survol */
.p-card:hover .time-box {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Lien actif dans la navbar */
.active-link {
    color: #8a2be2 !important;
}

/* --- DRAPEAUX DE LANGUE (HAUT DROIT) --- */
.lang-flag {
    position: absolute;
    top: 8px;
    /* Même distance du haut que le badge "Anime" */
    right: 8px;
    /* On le place à droite */
    width: 28px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    /* Petite bordure blanche */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    /* Ombre pour le faire ressortir */
    z-index: 3;
    /* Pour être au-dessus de l'image */
}

/* Drapeau Français (pour VF) créé en CSS */
.flag-vf {
    background: linear-gradient(to right, #002395 33.3%, #ffffff 33.3%, #ffffff 66.6%, #ed2939 66.6%);
}

/* Drapeau Japonais (pour VOSTFR) créé en CSS */
.flag-vostfr {
    background-color: white;
    /* Le cercle rouge est un dégradé radial */
    background-image: radial-gradient(circle at center, #bc002d 40%, transparent 41%);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    .week-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* --- USER NAV ICON CONTAINER --- */
.nav-actions {
    display: flex !important;
    /* FORCE l'alignement flexible */
    flex-direction: row !important;
    /* FORCE la direction horizontale */
    align-items: center;
    /* Centre verticalement */
    gap: 15px;
    /* Espace entre le calendrier et le profil */
    margin-left: auto;
    /* Pousse le tout vers la droite */
}

/* S'assure que les liens ne prennent pas toute la largeur */
.nav-actions a {
    display: flex;
    text-decoration: none;
}



/* Profile CSS */
.profile-container {
    max-width: 800px;
    margin: 100px auto;
    padding: 20px;
}

.profile-header {
    background: #111111;
    padding: 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #333;
    position: relative;
}

.avatar {
    width: 100px;
    height: 100px;
    background: #8a2be2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    font-weight: bold;
}

.info h1 {
    margin: 0;
    color: white;
    font-size: 2rem;
}

.info p {
    color: #aaa;
    margin: 5px 0;
}

.btn-logout {
    position: absolute;
    right: 30px;
    top: 30px;
    background: #ff4757;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-logout:hover {
    background: #ff6b81;
}

.section-title {
    color: white;
    margin-top: 40px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.placeholder-box {
    background: #111111;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    color: #666;
    margin-top: 20px;
    border: 1px dashed #444;
}

/* Admin Page CSS */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.admin-container {
    max-width: 1000px;
    margin: 0 auto;
}

.admin-section {
    background: #1e1e1e;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #8a2be2;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-weight: bold;
}

input[type="text"],

input[type="number"],

select {
    width: 100%;
    padding: 12px;
    background: #0f1115;
    border: 1px solid #0f1115;
    color: white;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 1rem;
}

button:hover {
    background: #9d50e5;
}

.btn-delete {
    background: #b20710;
    width: 100%;
    margin-top: 10px;
}

.btn-delete:hover {
    background: #d30913;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    background: #252525;
    padding: 15px;
    border-radius: 4px;
}

.tag-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #ccc;
}

.tag-item input {
    width: auto;
    margin-right: 8px;
    margin-bottom: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 10px;
    background: #333;
}

td {
    padding: 10px;
    border-bottom: 1px solid #333;
}

.planning-select {
    margin-bottom: 0;
}

/* Index */

/* === RECHERCHE LIVE ET BARRE EXTENSIBLE === */

/* Conteneur de la barre (caché par défaut) */
.expandable-search-container {
    max-height: 0;
    overflow: hidden;
    /* Garder hidden pour l'animation de fermeture */
    opacity: 0;
    transition: all 0.4s ease-in-out;
    background: #111;
    padding: 0 20px;
    z-index: 1001;
    /* Doit être au dessus de la grille */
    position: relative;
}

/* État actif (quand on clique sur la loupe) */
/* Quand la barre est ouverte */
.expandable-search-container.active {
    max-height: 120px;
    opacity: 1;
    padding: 20px;
    /* TRÈS IMPORTANT : on autorise le débordement quand c'est ouvert */
    overflow: visible;
    border-bottom: 1px solid #333;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Menu déroulant des résultats */
#liveSearchResults {
    position: absolute;
    top: 100%;
    /* Juste en dessous de l'input */
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 0 0 10px 10px;
    z-index: 9999;
    /* Valeur très haute pour passer au dessus des affiches */
    display: none;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
}

/* Style de chaque "case" de résultat (Style Anime-Sama) */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #222;
    text-decoration: none;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #2a2a2a;
}

.search-result-item img {
    width: 55px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
    font-weight: bold;
}

.search-result-info p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.no-result {
    padding: 15px;
    color: #666;
    text-align: center;
}

/* Style de l'input large */
.full-width-search {
    width: 100%;
    padding: 12px 20px;
    background: #000;
    border: 1px solid #444;
    border-radius: 25px;
    color: white;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.full-width-search:focus {
    border-color: var(--accent);
}