/* Importation des polices Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Georgia:wght@400;700&display=swap');

/* Styles généraux du corps de la page */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background-image: url('../img/fond.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    color: #4b4b4b;
}

/* ---------------------------------------------------------------------- */
/* --- DÉBUT DES STYLES DE LA NAVBAR (CORRIGÉS DÉFINITIVEMENT) --- */
/* ---------------------------------------------------------------------- */

nav {
  width: 100%;
  /* Couleur exacte du fond de la navbar sur l'image */
  background-color: #D9AED8; 
  padding: 10px 0; /* Padding vertical pour l'espace au-dessus et en dessous des liens */
  /* Pas d'ombre portée visible sur la navbar de l'image, donc je la retire pour coller à l'image.
     Si vous voulez une ombre légère, vous pouvez la rajouter ici:
     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */
  position: relative; 
  z-index: 1000; 
}

.navbar {
  display: flex;
  justify-content: center; /* Centre les éléments de la navbar horizontalement */
  list-style: none;
  margin: 0 auto; /* Centre le conteneur de la liste elle-même */
  padding: 0;
  /* La navbar sur l'image a ses liens groupés au centre, pas étirés sur toute la largeur. */
  /* Une max-width aide à maintenir cet aspect sur de grands écrans. */
  max-width: 1000px; /* Ajustez si nécessaire pour plus ou moins d'espace */
}

.navbar li {
  /* Espacement visuel entre les boutons, tel qu'observé sur l'image */
  margin: 0 15px; 
}

.navbar a {
  text-decoration: none;
  /* Couleur du texte des liens par défaut (non actif), blanc comme sur l'image */
  color: white; 
  font-family: 'Poppins', sans-serif; /* Utilisez Poppins ou Roboto selon votre préférence, j'ai choisi Poppins pour la cohérence globale */
  font-weight: 600; /* Les textes semblent en gras */
  /* Padding qui définit la taille des "boutons", basé sur l'image */
  padding: 10px 20px; 
  /* Arrondi des coins pour créer l'effet "bouton" comme sur l'image */
  border-radius: 5px; 
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap; /* Empêche le texte de passer à la ligne */
  display: block; /* S'assure que le padding et le fond s'appliquent bien au clic */
  font-size: 16px; /* Taille de police explicite pour cohérence */
}

.navbar a:hover {
  /* Fond noir au survol */
  background-color: #000000; 
  color: white; /* Texte blanc au survol */
}

.navbar .active {
  /* Fond noir pour l'élément actif */
  background-color: #000000; 
  color: white; /* Texte blanc pour l'élément actif */
}
/* Conteneur principal du contenu de la page pour un centrage et un style global */
.page-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.85); /* Fond légèrement plus transparent */
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* Titre principal de la page */
.main-title {
    font-family: 'Georgia', serif;
    font-size: 3.2em;
    font-weight: 700;
    color: #4a235a;
    text-align: center;
    margin-bottom: 60px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

/* Titre de section (Top Mangas Populaires) */
.section-title {
    font-family: 'Georgia', serif;
    font-size: 2.5em;
    font-weight: 700;
    color: #6a0578;
    text-align: center;
    margin-bottom: 50px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Section contenant la grille de mangas */
.popular-mangas {
    padding: 0;
    margin-bottom: 80px;
}

/* Grille des cartes de mangas */
.mangas-grid {
    display: grid;
    /* Ajusté pour un rendu plus grand et aéré, 300px min */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 50px; /* Augmenté l'espacement pour aérer */
    justify-content: center;
    padding: 20px;
}

/* Styles des cartes de manga */
.manga-card {
    /* Fond très légèrement transparent pour se fondre un peu avec le fond, mais rester lisible */
    background-color: rgba(255, 255, 255, 0.95); 
    border: 1px solid #ddd;
    border-radius: 15px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease-in-out, border-color 0.4s ease-in-out;
    padding: 0;
    margin: 0;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Style de l'image à l'intérieur de la carte */
.manga-card img {
    width: 100%;
    /* Hauteur fixe augmentée pour un meilleur rendu visuel et un bon ratio */
    height: 420px; 
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    box-shadow: none;
    display: block;
}

/* Style du titre du manga */
.manga-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6em; /* Taille légèrement augmentée pour le titre du manga */
    font-weight: 600;
    color: #333;
    padding: 20px 10px; /* Padding autour du titre augmenté */
    margin: 0;
    text-align: center;
}

/* Effet au survol de la carte */
.manga-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    border-color: #ff9aa2;
}

/* Autres images hors de .grid (si applicable) */
img {
    max-width: 100%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Nouvelle section de texte */
.text-section {
    max-width: 900px;
    margin: 60px auto 40px auto;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.text-section h2 {
    font-family: 'Georgia', serif;
    font-size: 2.2em;
    font-weight: 700;
    color: #4a235a;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.08);
}

.text-section p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05em;
    color: #444;
    line-height: 1.8;
    margin-bottom: 1.5em;
    text-align: justify;
}

/* ======= ANIMATIONS FADE-IN-UP et POP-IN ======= */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out;
    animation-play-state: running;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pop-in {
    opacity: 0;
    animation-name: popIn;
    animation-duration: 0.6s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out;
}

/* Délais pour les animations */
.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 0.9s; }
.delay-4 { animation-delay: 1.2s; }
.delay-5 { animation-delay: 1.5s; }

/* Media Queries pour la responsivité */
@media (max-width: 1200px) {
    .page-content {
        max-width: 95%;
    }
    .mangas-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 40px;
    }
    .manga-card img {
        height: 350px;
    }
    .text-section {
        max-width: 800px;
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .navbar li {
        margin: 0 10px; /* Réduit l'espacement sur les petits écrans */
    }
    .navbar a {
        padding: 8px 12px; /* Réduit le padding des liens */
        font-size: 14px;
    }
    .page-content {
        margin: 20px 15px;
        padding: 20px;
        border-radius: 10px;
    }
    .main-title {
        font-size: 2.5em;
        margin-bottom: 30px;
    }
    .section-title {
        font-size: 2em;
        margin-bottom: 25px;
    }
    .popular-mangas {
        margin-bottom: 40px;
    }
    .mangas-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 20px;
    }
    .manga-card img {
        height: 250px;
    }
    .manga-card h3 {
        font-size: 1.2em;
    }
    .text-section {
        margin: 40px 15px;
        padding: 20px;
    }
    .text-section h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    .text-section p {
        font-size: 0.95em;
        line-height: 1.6;
        margin-bottom: 1em;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-wrap: wrap; /* Permet aux éléments de passer à la ligne si l'espace est insuffisant */
        justify-content: space-around; /* Mieux répartir sur plusieurs lignes */
    }
    .navbar li {
        flex-basis: 45%; /* Deux éléments par ligne pour les très petits écrans */
        margin: 5px 0; /* Espacement ajusté */
    }
    .main-title {
        font-size: 1.8em;
    }
    .section-title {
        font-size: 1.5em;
    }
    .mangas-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
    }
    .manga-card {
        margin: 0 auto;
        max-width: 250px;
    }
    .manga-card img {
        height: 300px;
    }
    .text-section {
        padding: 15px;
        margin: 30px 10px;
    }
    .text-section h2 {
        font-size: 1.5em;
    }
    .text-section p {
        font-size: 0.9em;
    }
}