/* --- Styles Généraux et Réinitialisations --- */
body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; /* Police moderne et lisible */
    margin: 0;
    padding: 0; /* Suppression du padding ici, géré par les conteneurs */
    background-color: #0A0A0A; /* Noir très profond pour le fond principal de l'app */
    color: #E0E0E0; /* Blanc cassé pour le texte par défaut sur fond sombre */
    line-height: 1.6;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased; /* Lissage des polices */
    -moz-osx-font-smoothing: grayscale;
    display: flex; /* Utilise flexbox pour le layout */
    flex-direction: column;
    min-height: 100vh; /* S'assure que le corps prend au moins toute la hauteur de la vue */
}

*, *::before, *::after {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    cursor: pointer;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* --- Header Principal de la Page --- */
.main-header {
    background: linear-gradient(160deg, #1A1A1A 0%, #0A0A0A 100%); /* Dégradé sombre et profond */
    color: white;
    padding: 30px 25px; /* Plus de padding */
    text-align: left;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); /* Ombre plus prononcée */
    margin-bottom: 0; /* Pas de marge ici, géré par le contenu */
    display: flex;
    flex-direction: column; /* Pour empiler titre et navigation */
    position: sticky; /* Rendre le header sticky */
    top: 0;
    z-index: 990; /* Assure que le header est au-dessus du contenu */
    border-bottom: 1px solid #282828;
}

.main-header h1 {
    margin: 0;
    font-size: 2.8em; /* Titre plus grand et impactant */
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.8px; /* Espacement plus serré */
}

/* --- Conteneur de Navigation (en haut du header) --- */
.navigation-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Aligne à gauche */
    gap: 15px; /* Espacement plus grand entre les boutons */
    margin-top: 25px; /* Espace sous le titre du header */
    padding: 0; /* Le padding est déjà dans le header */
}

.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 25px; /* Plus de padding */
    background-color: #1C1C1E; /* Fond gris foncé pour les boutons */
    color: #E0E0E0; /* Blanc cassé pour le texte */
    border: 1px solid #282828; /* Bordure subtile */
    border-radius: 12px; /* Bords plus arrondis */
    text-decoration: none;
    font-weight: 600; /* Plus gras */
    font-size: 1em; /* Légèrement plus grand */
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    min-width: 120px; /* Largeur minimale plus grande */
    text-align: center;
}

.nav-button i { /* Utiliser Font Awesome ou SVG pour les icônes */
    color: #2E8B57; /* Vert Kinema+ pour les icônes */
    font-size: 1.8em; /* Plus grande icône */
    margin-bottom: 8px; /* Plus d'espace sous l'icône */
}

.nav-button span {
    display: block;
    line-height: 1.3;
}

.nav-button:hover {
    background-color: #2E8B57; /* Vert Kinema+ au survol */
    border-color: #246B44;
    transform: translateY(-5px); /* Effet de soulèvement plus prononcé */
    box-shadow: 0 8px 20px rgba(46, 139, 87, 0.4); /* Ombre avec lueur verte */
    color: #fff; /* Texte blanc au survol */
}
.nav-button:hover i {
    color: #fff; /* Icône blanche au survol */
}
.nav-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
    background-color: #1A5432;
}

/* --- Contenu Principal de la Page --- */
.main-content {
    max-width: 1200px;
    margin: 40px auto 100px auto; /* Plus de marge sup, et marge inf pour la nav */
    padding: 30px; /* Plus de padding */
    background-color: #111111; /* Fond sombre pour le contenu principal */
    border-radius: 15px; /* Plus arrondi */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* Ombre plus forte */
    border: 1px solid #282828; /* Bordure subtile */
}

.section-title {
    color: #FFFFFF; /* Blanc pour les titres de section */
    text-align: left; /* Alignement à gauche pour un look moderne */
    margin: 40px 0 25px 0;
    font-size: 2.2em; /* Plus grand */
    font-weight: 700;
    padding-bottom: 15px;
    position: relative;
    letter-spacing: -0.5px;
}

.section-title::after { /* Ligne décorative sous le titre */
    content: '';
    display: block;
    width: 80px; /* Plus longue */
    height: 4px;
    background-color: #2E8B57; /* Vert Kinema+ */
    position: absolute;
    bottom: -2px;
    left: 0; /* Aligné à gauche */
    border-radius: 2px;
}

/* --- Lignes de Contenu Défilantes (Scroll Rows) --- */
.scroll-row {
    display: flex;
    overflow-x: auto; /* Permet le défilement horizontal */
    padding-bottom: 20px; /* Espace pour la barre de défilement et l'ombre des cartes */
    margin-bottom: 30px;
    -webkit-overflow-scrolling: touch; /* Améliore le défilement sur iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #2E8B57 #1A1A1A; /* Vert pour le pouce, sombre pour la piste (Firefox) */
    gap: 20px; /* Espace entre les cartes */
}

/* Custom scrollbar for Webkit browsers (Chrome, Safari) */
.scroll-row::-webkit-scrollbar {
    height: 10px; /* Plus épais */
}

.scroll-row::-webkit-scrollbar-track {
    background: #1A1A1A; /* Piste sombre */
    border-radius: 10px;
}

.scroll-row::-webkit-scrollbar-thumb {
    background: #2E8B57; /* Pouce vert Kinema+ */
    border-radius: 10px;
    border: 2px solid #1A1A1A; /* Bordure pour le pouce */
}

.scroll-row::-webkit-scrollbar-thumb:hover {
    background: #246B44; /* Vert plus foncé au survol */
}

/* --- Cartes de Contenu (Films, Séries, etc.) --- */
.card {
    flex: 0 0 auto; /* Empêche le redimensionnement et le forçage à une seule ligne */
    width: 200px; /* Largeur fixe ajustée */
    margin-right: 0; /* Géré par le gap de .scroll-row */
    background-color: #1C1C1E; /* Fond sombre pour les cartes */
    border: 1px solid #282828; /* Bordure subtile */
    border-radius: 12px; /* Bords arrondis */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4); /* Ombre plus prononcée */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 15px; /* Padding interne en bas */
    color: #E0E0E0; /* Texte de la carte */
}

.card:hover {
    transform: translateY(-10px); /* Soulèvement plus important */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6); /* Ombre plus dramatique */
    background-color: #222224; /* Légèrement plus clair au survol */
}

.card img {
    width: 100%;
    height: 160px; /* Hauteur fixe ajustée pour les images */
    object-fit: cover;
    border-bottom: 1px solid #282828; /* Bordure sombre en bas de l'image */
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.2em; /* Taille ajustée */
    font-weight: 600; /* Plus gras */
    color: #FFFFFF; /* Blanc pur pour le titre de la carte */
    padding: 0 10px;
    margin-bottom: 5px; /* Espace sous le titre */
    white-space: nowrap; /* Empêche le retour à la ligne */
    overflow: hidden; /* Cache le texte qui dépasse */
    text-overflow: ellipsis; /* Ajoute des points de suspension */
    width: 90%; /* Pour permettre l'ellipsis */
}
.card-genre { /* Pour ajouter un genre ou sous-titre */
    font-size: 0.85em;
    color: #A0A0A0;
    margin: 0;
    padding: 0 10px;
}


/* --- Modal Styles --- */
.modal {
    display: none; /* Caché par défaut */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8); /* Fond sombre plus opaque */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #1C1C1E; /* Fond sombre pour le modal */
    margin: auto;
    padding: 30px;
    border: 1px solid #282828; /* Bordure sombre */
    width: 90%;
    max-width: 600px; /* Plus large pour le contenu du modal */
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    color: #E0E0E0; /* Texte clair dans le modal */
}

.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close-button {
    color: #A0A0A0; /* Gris doux pour le bouton de fermeture */
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px; /* Plus grand */
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #FFFFFF; /* Blanc au survol */
    text-decoration: none;
}

#modalTitle {
    color: #2E8B57; /* Vert Kinema+ pour le titre du modal */
    font-size: 2em; /* Plus grand */
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #282828; /* Bordure sombre */
    padding-bottom: 15px;
    font-weight: 700;
}

#modalDescription {
    font-size: 1.1em;
    color: #B0B0B0; /* Gris doux pour la description */
    text-align: left; /* Description alignée à gauche */
    margin-bottom: 25px;
    max-height: 200px; /* Limite la hauteur pour le défilement */
    overflow-y: auto; /* Active le défilement si le contenu est trop long */
    padding-right: 10px; /* Pour éviter que le texte ne touche la barre de défilement */
    scrollbar-width: thin;
    scrollbar-color: #2E8B57 #1A1A1A;
}
#modalDescription::-webkit-scrollbar {
    width: 8px;
}
#modalDescription::-webkit-scrollbar-track {
    background: #1A1A1A;
    border-radius: 10px;
}
#modalDescription::-webkit-scrollbar-thumb {
    background: #2E8B57;
    border-radius: 10px;
}
#modalDescription::-webkit-scrollbar-thumb:hover {
    background: #246B44;
}


.modal-close-btn {
    display: block;
    width: 80%; /* Plus étroit pour le bouton du modal */
    margin: 0 auto; /* Centré */
    padding: 15px 20px;
    background-color: #2E8B57; /* Vert Kinema+ */
    color: white;
    border: none;
    border-radius: 30px; /* Très arrondi */
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.modal-close-btn:hover {
    background-color: #246B44; /* Vert plus foncé */
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}
.modal-close-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
    background-color: #1A5432;
}

/* --- Boutons d'icônes en haut à droite (Profil, Partage, Notification) --- */
/* Ces styles sont déjà dans les autres fichiers et devraient être dans un fichier CSS global */
/* Pour cette page, si ces boutons sont dans le header, voici comment ils s'intégreraient */
.top-right-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    position: absolute; /* Positionne ces boutons dans le coin supérieur droit du header */
    top: 25px;
    right: 25px;
}

.icon-btn {
    background: linear-gradient(to bottom right, #1A1A1A, #0A0A0A);
    border: 1px solid #282828;
    padding: 12px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to bottom right, #2E8B57, #246B44);
}
.icon-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
}

.icon-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* rend l'icône blanche */
}
.icon-btn:hover img {
    filter: brightness(100%) invert(0);
}

/* --- Navigation de Publicités (si dans le header) --- */
/* Si cette nav est distincte de .navigation-container */
.header-ads-nav { /* J'ai renommé `nav` pour éviter les conflits */
    margin-top: 20px;
    text-align: center; /* Centrer les liens si c'est pour des pubs */
}

.header-ads-nav a {
    color: #F8F8F8; /* blanc très clair */
    margin: 0 20px;
    font-size: 1.3em;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.header-ads-nav a:hover {
    color: #2E8B57; /* Vert Kinema+ au survol */
    transform: scale(1.05); /* Zoom discret */
}
.header-ads-nav a:active {
    color: #1A5432; /* Couleur plus douce au clic */
}
.header-ads-nav a.active {
    color: #2E8B57;
    font-weight: 700;
}
.header-ads-nav a.active::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80%;
    height: 3px;
    background-color: #2E8B57;
    border-radius: 2px;
}
.header-ads-nav i {
    pointer-events: none;
}


/* --- Navigation Inférieure Flottante --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #111111; /* Fond très sombre */
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 999;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.4);
    border-top-left-radius: 20px; /* Plus arrondi */
    border-top-right-radius: 20px; /* Plus arrondi */
    border-top: 1px solid #282828; /* Bordure subtile en haut */
}

.bottom-nav .nav-item {
    color: #888888; /* Gris doux pour les inactifs */
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    padding: 8px 5px; /* Plus de padding */
    border-radius: 12px; /* Plus arrondi */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    flex-grow: 1;
    max-width: 90px;
}

.bottom-nav .nav-item img {
    filter: invert(70%); /* Rend les icônes grises pour l'inactif */
    margin-bottom: 5px; /* Plus d'espace */
    width: 26px; /* Plus grandes */
    height: 26px; /* Plus grandes */
    transition: filter 0.3s ease;
}

.bottom-nav .nav-item span {
    font-size: 0.9em; /* Texte légèrement plus grand */
    font-weight: 500;
}

.bottom-nav .nav-item:hover {
    background-color: #1A1A1A; /* Fond sombre au survol */
    color: #E0E0E0; /* Blanc cassé au survol */
    transform: translateY(-3px); /* Léger soulèvement */
}
.bottom-nav .nav-item:hover img {
    filter: invert(100%); /* Icône blanche au survol */
}

.bottom-nav .nav-item.active { /* Style pour l'élément actif */
    background-color: #2E8B57; /* Vert Kinema+ pour l'actif */
    color: #fff;
    transform: translateY(-5px); /* Soulèvement plus important */
    box-shadow: 0 -5px 15px rgba(46, 139, 87, 0.3); /* Ombre avec lueur verte */
}
.bottom-nav .nav-item.active img {
    filter: invert(0%) brightness(100%); /* Icône blanche et éclatante pour l'actif */
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .main-header h1 {
        font-size: 2.5em;
    }
    .navigation-container {
        gap: 12px;
    }
    .nav-button {
        padding: 12px 20px;
        min-width: 100px;
    }
    .nav-button i {
        font-size: 1.6em;
    }
    .main-content {
        margin: 30px auto 90px auto;
        padding: 25px;
    }
    .section-title {
        font-size: 2em;
        margin: 35px 0 20px 0;
    }
    .card {
        width: 180px;
    }
    .card img {
        height: 140px;
    }
    .card-title {
        font-size: 1.1em;
    }
    .modal-content {
        max-width: 550px;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 25px 20px;
        position: static; /* Retire sticky pour les petits écrans si cela pose problème avec le défilement */
    }
    .main-header h1 {
        font-size: 2.2em;
    }
    .top-right-buttons {
        position: static; /* Retire la position absolue */
        margin-top: 15px; /* Espace sous le titre */
        justify-content: center; /* Centre les boutons */
        width: 100%;
    }
    .icon-btn {
        width: 45px;
        height: 45px;
        padding: 10px;
    }
    .icon-btn img {
        width: 22px;
        height: 22px;
    }
    .navigation-container {
        flex-direction: row; /* Garde en ligne pour une petite nav horizontale */
        overflow-x: auto; /* Permet le défilement horizontal si les boutons sont trop nombreux */
        justify-content: flex-start; /* Aligne au début */
        margin-top: 20px;
        padding-bottom: 10px; /* Pour la scrollbar */
    }
    .nav-button {
        flex-shrink: 0; /* Empêche le rétrécissement */
        width: auto; /* Largeur automatique */
        min-width: 90px; /* Minimum pour la lisibilité */
        padding: 10px 15px;
        font-size: 0.9em;
        border-radius: 10px;
    }
    .nav-button i {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    .main-content {
        margin: 25px 15px 80px 15px; /* Marges ajustées pour le mobile */
        padding: 20px;
        border-radius: 12px;
    }
    .section-title {
        font-size: 1.8em;
        margin: 30px 0 18px 0;
    }
    .section-title::after {
        width: 60px;
    }
    .scroll-row {
        padding-bottom: 15px;
        gap: 15px;
    }
    .card {
        width: 160px; /* Cartes plus petites sur mobile */
        height: auto; /* Hauteur auto pour s'adapter au contenu */
        padding-bottom: 10px;
    }
    .card img {
        height: 120px;
    }
    .card-title {
        font-size: 1em;
        padding: 0 8px;
    }
    .card-genre {
        font-size: 0.8em;
    }
    .modal-content {
        padding: 25px;
        border-radius: 12px;
        max-width: 95%;
    }
    #modalTitle {
        font-size: 1.8em;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    #modalDescription {
        font-size: 1em;
        max-height: 150px;
    }
    .modal-close-btn {
        width: 90%;
        padding: 12px 15px;
        font-size: 1em;
    }
    .bottom-nav .nav-item {
        font-size: 10px;
        padding: 6px 3px;
    }
    .bottom-nav .nav-item img {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 20px 15px;
    }
    .main-header h1 {
        font-size: 1.6em;
    }
    .top-right-buttons {
        gap: 10px;
        margin-top: 10px;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    .icon-btn img {
        width: 20px;
        height: 20px;
    }
    .navigation-container {
        gap: 10px;
        margin-top: 15px;
    }
    .nav-button {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.8em;
    }
    .nav-button i {
        font-size: 1.3em;
    }
    .main-content {
        margin: 20px 10px 70px 10px;
        padding: 15px;
    }
    .section-title {
        font-size: 1.6em;
        margin: 25px 0 15px 0;
    }
    .section-title::after {
        width: 50px;
    }
    .scroll-row {
        padding-bottom: 12px;
        gap: 10px;
    }
    .card {
        width: 140px; /* Plus petit sur les très petits écrans */
        padding-bottom: 8px;
    }
    .card img {
        height: 100px;
    }
    .card-title {
        font-size: 0.9em;
        padding: 0 5px;
    }
    .card-genre {
        font-size: 0.75em;
    }
    .modal-content {
        padding: 20px;
    }
    #modalTitle {
        font-size: 1.6em;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    #modalDescription {
        font-size: 0.95em;
        max-height: 120px;
    }
    .modal-close-btn {
        padding: 10px 12px;
        font-size: 0.95em;
    }
    .bottom-nav .nav-item {
        font-size: 9px;
        padding: 5px 2px;
    }
    .bottom-nav .nav-item img {
        width: 18px;
        height: 18px;
    }
}
