@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* -- Variables de Couleurs (Palette Identique) -- */
:root {
    --bg-body: #141414;      /* Noir profond */
    --bg-card: #222222;      /* Gris foncé pour les cartes */
    --bg-header: #8A2BE2;    /* Le Violet Header */
    --accent: #a855f7;       /* Violet plus clair pour hover */
    --text-white: #ffffff;
    --text-gray: #b0b0b0;
    --border-color: #333;
}

/* -- Reset & Base -- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif; /* Police plus moderne type manga */
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-white);
}

a { text-decoration: none; color: inherit; }

/* -- HEADER (La barre violette en haut) -- */
header {
    background-color: var(--bg-header);
    padding: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-bar {
    max-width: 1240px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Liens de navigation (Home, Manga List) */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 5px 0;
    position: relative;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 1;
}

.nav-links a.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    position: absolute;
    bottom: 0;
}

/* -- BOUTONS (Connexion / S'inscrire) -- */
.user-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.action-button {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 30px; /* Forme arrondie "Pill" */
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

/* Bouton Connexion (Transparent ou sombre) */
.login-btn {
    background: rgba(0, 0, 0, 0.2);
    color: white;
}
.login-btn:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Bouton S'inscrire (Blanc ou accentué) */
.register-btn {
    background-color: #ffffff;
    color: var(--bg-header);
}
.register-btn:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
}

/* -- BARRE DE RECHERCHE -- */
.search-box {
    background: rgba(255, 255, 255, 0.2); /* Semi-transparent */
    border-radius: 20px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    width: 250px;
    margin-left: 20px;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box i {
    color: white;
}

/* -- CONTENU PRINCIPAL -- */
main {
    max-width: 1240px;
    margin: 30px auto;
    padding: 0 20px;
}

/* -- TITRES DE SECTION (La barre violette) -- */
.section-container {
    margin-bottom: 50px;
}

.section-title {
    background-color: var(--bg-header); /* Fond Violet */
    color: white;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 4px; /* Coins légèrement arrondis */
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.section-title::before {
    /* Petite icône étoile ou horloge avant le titre */
    content: '✦'; 
    margin-right: 10px;
    font-size: 1.2rem;
}

/* -- GRILLE POPULAR TODAY (Cartes Verticales) -- */
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* Responsive */
    gap: 20px;
}

.manga-card {
    background-color: transparent;
    border-radius: 5px;
    transition: transform 0.2s;
    position: relative;
}

.manga-card:hover {
    transform: translateY(-5px);
}

.manga-image {
    background-color: #2a2a2a; /* Placeholder Gris foncé */
    width: 100%;
    aspect-ratio: 2 / 3; /* Ratio manga standard */
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}

/* Effet d'ombre sur l'image pour que le texte ressorte si on en mettait dessus */
.manga-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.manga-title {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    line-height: 1.3;
    /* Coupe le texte si trop long */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -- GRILLE LATEST UPDATE (Cartes Horizontales / Liste) -- */
.latest-update-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

.update-card {
    background-color: var(--bg-card);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
    border: 1px solid #333;
    transition: background 0.2s;
}

.update-card:hover {
    background-color: #2a2a2a;
    border-color: #444;
}

.update-image {
    background-color: #333;
    width: 70px;
    height: 90px;
    border-radius: 4px;
    flex-shrink: 0; /* Empêche l'image de s'écraser */
}

.update-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.update-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: white;
}

.update-time {
    font-size: 0.75rem;
    color: var(--text-gray);
    display: block;
    margin-top: 2px;
}

/* -- FOOTER -- */
footer {
    border-top: 1px solid #333;
    background-color: #111;
    padding: 30px;
    text-align: center;
    color: #666;
    margin-top: 50px;
}

/* --- PAGE MANGA LISTS (Layout Spécifique) --- */

.page-container {
    display: grid;
    grid-template-columns: 1fr 300px; /* Contenu principal + Sidebar fixe de 300px */
    gap: 30px;
    align-items: start;
}

/* -- Barre de Filtres (Haut de la liste) -- */
.filter-bar {
    background-color: var(--bg-card);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    border: 1px solid #333;
}

.filter-select {
    background-color: #141414;
    color: white;
    border: 1px solid #444;
    padding: 8px 15px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    flex: 1; /* Les filtres prennent la largeur dispo */
}

/* -- Sidebar (Droite) -- */
.sidebar {
    background-color: var(--bg-card);
    border-radius: 5px;
    padding: 20px;
    border: 1px solid #333;
}

.sidebar-header {
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: 700;
    color: white;
}

/* -- Tags de Genres -- */
.genre-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-tag {
    background-color: #1a1a1a;
    color: #b0b0b0;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #333;
    transition: all 0.2s;
    user-select: none; /* Empêche de surligner le texte */
}

.genre-tag:hover {
    border-color: var(--bg-header);
    color: white;
}

/* État sélectionné (Violet) */
.genre-tag.active {
    background-color: var(--bg-header);
    color: white;
    border-color: var(--bg-header);
}

/* -- Bouton Recherche Avancée -- */
.advanced-search-btn {
    width: 100%;
    margin-top: 20px;
    background-color: var(--bg-header);
    color: white;
    border: none;
    padding: 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}

.advanced-search-btn:hover {
    background-color: #7b22cc;
}

/* Responsive pour mobile */
@media (max-width: 900px) {
    .page-container {
        grid-template-columns: 1fr; /* Une seule colonne */
    }
}

/* --- NOUVEAU CSS PAGE DÉTAILS (Style Pro) --- */

/* Bannière de fond floutée */
.manga-banner-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 400px;
    background-size: cover; background-position: center;
    filter: blur(20px) brightness(0.3);
    z-index: -1;
}

.manga-header-container {
    position: relative; margin-top: 80px; /* Espace sous la navbar */
    display: flex; gap: 30px; padding: 20px;
    background: rgba(20, 20, 20, 0.8); /* Fond semi-transparent */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.manga-cover-large {
    width: 280px; height: 400px; object-fit: cover;
    border-radius: 8px; box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
}

.manga-info-block { flex: 1; color: white; }

.manga-main-title {
    font-size: 2.5rem; margin: 0; font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.manga-meta-info {
    display: flex; gap: 15px; margin: 15px 0; color: #ccc; font-size: 0.9rem;
}
.manga-meta-info span i { color: #8A2BE2; margin-right: 5px; }

.manga-description {
    margin: 20px 0; color: #ddd; line-height: 1.6; font-size: 0.95rem;
    background: rgba(255,255,255,0.05); padding: 15px; border-radius: 8px;
}

/* Boutons d'action (Lecture) */
.action-buttons-container { display: flex; gap: 15px; margin: 25px 0; }
.read-btn {
    padding: 12px 30px; border-radius: 30px; font-weight: bold; text-decoration: none;
    display: flex; align-items: center; gap: 10px; transition: 0.3s;
}
.read-btn-primary {
    background: linear-gradient(45deg, #8A2BE2, #4B0082); color: white;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.4);
}
.read-btn-primary:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(138, 43, 226, 0.6); }
.read-btn-secondary {
    background: #333; color: white; border: 2px solid #555;
}
.read-btn-secondary:hover { background: #444; border-color: #8A2BE2; }

/* Liste des Chapitres (Nouveau Style) */
.chapters-list-container {
    background: #1a1a1a; padding: 20px; border-radius: 12px; margin-top: 30px;
}
.chapter-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; border-bottom: 1px solid #333; text-decoration: none; color: white;
    transition: 0.2s;
}
.chapter-item:hover { background: #222; padding-left: 20px; border-left: 3px solid #8A2BE2; }
.chapter-number { font-weight: 600; font-size: 1.1rem; }
.chapter-date { color: #777; font-size: 0.8rem; }

/* Zone Commentaires et Notes */
.comments-ratings-section {
    display: flex; gap: 30px; margin-top: 30px;
}
.ratings-box-pro {
    flex: 0 0 300px; background: #1a1a1a; padding: 20px; border-radius: 12px; text-align: center;
}
.average-score-big { font-size: 3rem; font-weight: 700; color: white; }
.comments-list-pro { flex: 1; }
.comment-box-pro {
    background: #1a1a1a; padding: 15px; border-radius: 8px; margin-bottom: 15px;
    border-left: 3px solid #8A2BE2;
}
.comment-header-pro { display: flex; justify-content: space-between; margin-bottom: 10px; }
.comment-user-pro { font-weight: bold; color: #8A2BE2; }
.comment-date-pro { color: #666; font-size: 0.8rem; }