/* =========================================
   1. VARIABLES & RESET
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
    --bg-dark: #0a0e17;       /* Noir profond */
    --bg-card: #131b2c;       /* Bleu nuit */
    --text-main: #ffffff;
    --text-muted: #9ca3af;    /* Gris clair par défaut */
    --primary: #3b82f6;       /* Bleu électrique */
    --accent: #8b5cf6;        /* Violet */
    --neon-pink: #ec4899;     /* Rose */
    --neon-gradient: linear-gradient(90deg, var(--primary), var(--accent), var(--neon-pink));
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, var(--bg-dark) 80%);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
.navbar-custom {
    background-color: rgba(10, 14, 23, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 0;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
}
.nav-brand i { color: var(--primary); }

/* =========================================
   3. HERO SECTION & FILTRES
   ========================================= */
.hero-section {
    text-align: center;
    padding: 80px 0 50px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

/* Le dégradé sur le texte */
.text-gradient {
    background: var(--neon-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle { 
    color: var(--text-muted); 
    font-size: 1.1rem; 
    margin-bottom: 30px; 
}

/* Conteneur Flexbox pour les filtres */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 8px 24px;
    border-radius: 50px;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0; 
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* =========================================
   4. CARTES DE JEU (FIX HAUTEUR)
   ========================================= */
   
/* Force l'étirement des colonnes */
.row.g-4 {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Force l'étirement des enfants directs */
.row.g-4 > [class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* Force les cartes et wrappers à prendre toute la hauteur */
.card-wrapper-boost, 
.game-card {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.game-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 1;
    transform: translateZ(0); 
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Images & Overlay */
.card-img-wrap {
    height: 160px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0; /* Empêche l'image de rétrécir */
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.game-card:hover .card-img-wrap img { transform: scale(1.1); }

/* Filtre sombre sur l'image uniquement */
.card-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
    pointer-events: none;
}

.game-card:hover .card-img-wrap::after { opacity: 1; }

/* Bouton Jouer */
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.3s;
    z-index: 2;
}

.game-card:hover .play-overlay { opacity: 1; }

.btn-play {
    background: white;
    color: black;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Contenu Texte */
.card-body {
    padding: 15px;
    flex-grow: 1; /* Le corps s'étire pour remplir l'espace */
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-card);
    z-index: 3;
}

.game-title { color: white; font-weight: 700; margin-bottom: 5px; font-size: 1.1rem; }

.game-desc { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    margin-bottom: 15px; 
    flex-grow: 1; /* Pousse les actions vers le bas */
    /* Limitation lignes (optionnel mais propre) */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Actions Footer */
.card-actions { 
    display: flex; 
    gap: 10px; 
    margin-top: auto; /* Colle au bas */
}

.btn-action {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text-muted); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); color: white; }

.btn-primary { background: var(--neon-gradient); color: white; }
.btn-primary:hover { opacity: 0.9; }

/* =========================================
   5. SYSTÈME BOOST / SPONSORISÉ
   ========================================= */
.card-wrapper-boost {
    position: relative;
    padding: 2px;
    border-radius: 18px;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--neon-pink), var(--primary));
    background-size: 300% 300%;
    animation: neonFlow 3s linear infinite;
    /* height: 100% déjà défini plus haut */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-wrapper-boost:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
}

.card-wrapper-boost .game-card {
    border: none;
    /* height: 100% déjà défini */
    border-radius: 16px;
    transform: none !important; 
    box-shadow: none !important;
}

.badge-boost {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f59e0b;
    color: black;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 5;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

@keyframes neonFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================
   6. PAGE AUTHENTIFICATION
   ========================================= */
.auth-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.1);
    position: relative;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 5px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
}

.tab-btn.active {
    background: var(--bg-card);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.auth-title {
    text-align: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 25px;
}

/* Inputs */
.input-group-custom { position: relative; margin-bottom: 15px; }

.input-group-custom i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group-custom input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 12px 12px 45px;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
}

.input-group-custom input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.btn-auth {
    width: 100%;
    background: var(--neon-gradient);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-auth:hover { transform: scale(1.02); box-shadow: 0 0 20px rgba(139, 92, 246, 0.4); }

/* =========================================
   7. DASHBOARD & PROFIL
   ========================================= */

/* Avatar Rond */
.avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--primary);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    color: var(--text-muted);
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

/* Onglets verticaux (Pills) */
.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: 10px;
    padding: 12px 20px;
    transition: 0.3s;
}
.nav-pills .nav-link:hover { background: rgba(255, 255, 255, 0.05); color: white; }
.nav-pills .nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* Correction Alert "Vide" (Ghost) */
.tab-pane .alert-dark {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    backdrop-filter: blur(5px);
    border-radius: 16px;
}
.tab-pane .alert-dark i {
    color: rgba(255, 255, 255, 0.2) !important;
    animation: floatGhost 3s ease-in-out infinite;
}
.tab-pane .alert-dark .btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.tab-pane .alert-dark .btn-outline-primary:hover { background: var(--primary); color: white; }

@keyframes floatGhost {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Correction Formulaire Boost */
.tab-content .form-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.promo-form-container {
    border-color: rgba(59, 130, 246, 0.2) !important;
    background: rgba(0, 0, 0, 0.3) !important;
}
.promo-form-container h5 { color: white !important; }

button[name="apply_code"] {
    background: var(--neon-gradient) !important;
    border: none;
    font-weight: 700;
}
button[name="apply_code"]:hover { opacity: 0.9; box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }

.btn-outline-secondary[disabled] {
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    background: transparent;
}
/* =========================================
   8. ALERTES (TOAST NOTIFICATIONS AVEC TIMER)
   ========================================= */

/* Conteneur principal du toast */
.alert {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    min-width: 320px;
    max-width: 400px;
    background: rgba(19, 27, 44, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    
    /* Animation d'entrée + Disparition auto après 5s */
    animation: 
        slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        toastFadeOut 0.5s 4.5s forwards; /* Disparaît à 4.5s */
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden; /* Important pour que la barre ne dépasse pas */
}

/* La barre verticale gauche (Indicateur de type) */
.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
}

/* La barre horizontale bas (Timer animé) */
.alert::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px; /* Épaisseur de la barre */
    width: 100%;
    background: currentColor; /* Prend la couleur du texte ou spécifique */
    opacity: 0.7;
    animation: timeBar 4.5s linear forwards; /* Dure 4.5s comme le fadeOut */
}

/* Couleurs spécifiques (Gauche + Barre Timer) */
.alert-success { border-left: 1px solid rgba(16, 185, 129, 0.2); }
.alert-success::before { background: #10b981; box-shadow: 0 0 10px #10b981; }
.alert-success::after { background: #10b981; box-shadow: 0 0 10px #10b981; }

.alert-danger { border-left: 1px solid rgba(239, 68, 68, 0.2); }
.alert-danger::before { background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.alert-danger::after { background: #ef4444; box-shadow: 0 0 10px #ef4444; }

.alert-info { border-left: 1px solid rgba(59, 130, 246, 0.2); }
.alert-info::before { background: #3b82f6; box-shadow: 0 0 10px #3b82f6; }
.alert-info::after { background: #3b82f6; box-shadow: 0 0 10px #3b82f6; }

/* Bouton Fermer */
.alert .btn-close {
    margin-left: 15px;
    filter: invert(1);
    opacity: 0.7;
    background-size: 0.8em;
    z-index: 2; /* Au dessus de la barre */
}

/* Animations */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes timeBar {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes toastFadeOut {
    to { opacity: 0; transform: translateX(20px); pointer-events: none; }
}

/* =========================================
   9. FOOTER
   ========================================= */
footer {
    margin-top: auto;
    background: #05080f;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
}

/* =========================================
   10. CORRECTION SPÉCIFIQUE DASHBOARD
   ========================================= */

.dashboard-ui .text-muted {
    color: #cbd5e1 !important; 
}

.dashboard-ui .small, .dashboard-ui small {
    color: #94a3b8 !important;
}

.dashboard-ui h3, .dashboard-ui h5 {
    color: white !important;
}

.dashboard-ui .form-control, 
.dashboard-ui .form-select {
    color: white !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dashboard-ui ::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1;
}

.dashboard-ui .avatar-circle + h3 + p {
    color: #cbd5e1 !important; 
}

/* =========================================
   11. PAGE JEU DÉTAIL (SCOPED)
   ========================================= */

.page-jeu-detail .game-card {
    height: auto !important; 
    min-height: 0 !important;
}

.page-jeu-detail .cover-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    aspect-ratio: 4/3; 
    width: 100%;
}

.page-jeu-detail .jeu-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.page-jeu-detail {
    padding-top: 40px;
    padding-bottom: 80px;
}

.page-jeu-detail p {
    font-size: 1.05rem;
    color: #cbd5e1 !important;
}

.page-jeu-detail .sticky-sidebar {
    position: sticky;
    top: 100px;
    z-index: 10;
}

@media (max-width: 991px) {
    .page-jeu-detail .cover-wrapper {
        aspect-ratio: auto;
        height: 300px;
    }
}

.page-jeu-detail .text-muted { color: #cbd5e1 !important; }
.page-jeu-detail .text-muted i { color: #94a3b8 !important; }
.page-jeu-detail .fw-bold { color: white !important; }
.page-jeu-detail .text-warning { color: #ffc107 !important; }

/* Navigation Épurée */
.nav-tags-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.nav-tag-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-tag-glass:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.nav-tag-glass i { font-size: 0.75rem; }

/* =========================================
   12. STYLE SPÉCIFIQUE INDEX (GRID & FANTÔME)
   ========================================= */

/* Force une hauteur identique pour tout le monde */
.idx-media-wrapper {
    height: 180px; 
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.idx-media-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.game-card:hover .idx-media-wrapper img {
    transform: scale(1.1);
}

/* Style FANTÔME */
.idx-ghost-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.idx-ghost-icon {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.1);
    animation: idxFloatAnim 3s ease-in-out infinite;
}

@keyframes idxFloatAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* =========================================
   13. PROFIL SPECIFIC STYLES (ALIGNEMENT CORRIGÉ)
   ========================================= */

/* 1. SEPARATEUR VERTICAL */
/* La ligne verticale au milieu */
.stat-separator {
    width: 1px;
    height: 35px;
    background: rgba(255, 255, 255, 0.15); /* Ligne fine blanche */
    margin: 0 15px; /* Espace autour de la ligne */
}

/* 2. STATS ÉPURÉES (Suppression des fonds/bordures forcés) */
/* Flexbox Column pour FORCER l'empilement Chiffre / Texte */
.profile-stat-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    
    padding: 5px 0 !important;
    background: transparent !important; /* Force le fond transparent */
    border: none !important; /* Force la suppression des bordures */
    box-shadow: none !important;
    min-width: 80px; /* Assure une largeur minimale */
}

.profile-stat-box h4 {
    font-size: 1.8rem;
    margin-bottom: 2px;
}

.profile-stat-box small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* 3. CARTES BIBLIOTHÈQUE (LISTE PROPRE) */
.library-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-radius: 12px;
    padding: 12px; 
    transition: all 0.2s ease;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.library-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.library-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.library-card:hover::before {
    opacity: 1;
}

/* ZONE IMAGE */
.lib-img-wrapper {
    width: 80px;  
    height: 60px; 
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #0f172a; 
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
}

.lib-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lib-ghost {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.5rem;
}

/* CONTENU */
.lib-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.lib-content h5 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 4. BOUTONS : SÉPARÉS ET CARRÉS (ALIGNEMENT CORRIGÉ) */
/* On reset complètement le style btn-group de bootstrap */
.library-card .btn-group {
    display: flex !important;
    gap: 10px !important; /* ESPACE ENTRE LES BOUTONS */
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    margin-left: auto; /* Pousse les boutons à droite */
}

/* Style individuel des boutons */
.library-card .btn-group .btn {
    width: 38px;  /* Taille carrée */
    height: 38px;
    padding: 0;
    margin: 0 !important;
    flex: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    
    border-radius: 8px !important; /* Coins arrondis pour CHAQUE bouton */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    transition: 0.2s;
}

/* Effet au survol des boutons */
.library-card .btn-group .btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Exception pour le bouton Booster (Jaune) */
.library-card .btn-group .btn-outline-warning {
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.library-card .btn-group .btn-outline-warning:hover {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #000 !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* Responsive Mobile */
@media (max-width: 576px) {
    .library-card {
        flex-wrap: wrap;
    }
    .library-card .btn-group {
        width: 100%;
        margin-top: 10px;
        justify-content: flex-end;
    }
}

/* =========================================
   14. FIX RESPONSIVE (SCROLL HORIZONTAL)
   ========================================= */

@media (max-width: 991px) { /* On vise tablettes + mobiles */

    /* 1. FILTRES ACCUEIL (Hero Section) */
    .filters-container {
        display: flex;
        flex-wrap: nowrap !important;       /* Force sur une seule ligne */
        justify-content: flex-start !important; /* Aligne au début (gauche) */
        overflow-x: auto;                   /* Active le scroll horizontal */
        overflow-y: hidden;                 /* Bloque le scroll vertical */
        white-space: nowrap;                /* Empêche le texte de casser */
        -webkit-overflow-scrolling: touch;  /* Fluidité iOS/Safari essentielle ! */
        
        /* Esthétique du scroll */
        padding-bottom: 15px;               /* Espace pour l'ombre */
        padding-left: 20px;                 /* Espace gauche pour pas coller */
        padding-right: 20px;                /* Espace droit */
        margin-left: -15px;                 /* Hack pour que le scroll touche les bords */
        margin-right: -15px;
        width: auto;
        max-width: 100vw;
    }

    /* Cache la barre de défilement (Scrollbar) moche */
    .filters-container::-webkit-scrollbar {
        display: none; 
    }
    .filters-container {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }

    .filter-btn {
        flex: 0 0 auto; /* Empêche le bouton de s'écraser */
    }

    /* 2. TAGS PAGE DÉTAIL (Si tu en as aussi) */
    .nav-tags-container {
        display: flex;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 3. AJUSTEMENT HERO TITLE SUR PETIT ECRAN */
    .hero-title {
        font-size: 2rem; /* Réduit un peu la taille police */
    }
}


/* --- NOTIFICATIONS DROPDOWN STYLE --- */

/* Le conteneur du menu */
.notif-dropdown-menu {
    background-color: #1e293b; /* Dark Slate */
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    padding: 0;
    overflow: hidden;
    width: 320px;
}

/* En-tête "Notifications" */
.notif-header {
    background-color: #0f172a;
    padding: 12px 15px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #334155;
    font-size: 14px;
}

/* Un élément de notification */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    color: #cbd5e1;
    text-decoration: none;
    border-bottom: 1px solid #334155;
    transition: all 0.2s;
    position: relative;
}

.notif-item:hover {
    background-color: #334155;
    color: #fff;
}

/* Notification non lue (petit fond plus clair ou bordure gauche) */
.notif-item.unread {
    background-color: rgba(99, 102, 241, 0.1); /* Indigo très léger */
    border-left: 3px solid #6366f1;
}

/* Icône de notif */
.notif-icon {
    margin-top: 3px;
    flex-shrink: 0;
}

/* Le texte */
.notif-content {
    font-size: 13px;
    line-height: 1.4;
}

/* Le pied de page "Voir tout" */
.notif-footer {
    background-color: #0f172a;
    text-align: center;
    padding: 10px;
    font-size: 12px;
}
.notif-footer a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}
.notif-footer a:hover {
    text-decoration: underline;
}

/* Scrollbar jolie pour la liste */
#notif-list::-webkit-scrollbar { width: 5px; }
#notif-list::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }