/* =========================================
   BARRE DE NAVIGATION & MENU DÉROULANT
   ========================================= */

/* Barre fixe en haut */
#navbar-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #111827; /* Fond très sombre */
    border-bottom: 2px solid #d97706; /* Liseré doré */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000; /* Toujours au-dessus du reste (boosters, cartes) */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Le titre / Logo */
.navbar-brand span {
    color: #fbbf24;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    font-family: sans-serif;
}

/* Le bouton Burger */
#burger-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.burger-line {
    width: 25px;
    height: 3px;
    background-color: #fbbf24;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* --- LE MENU DÉROULANT --- */
#dropdown-menu {
    position: fixed;
    top: 60px; /* Juste en dessous de la barre */
    left: 0;
    width: 100%;
    background: rgba(31, 41, 55, 0.95); /* Fond gris sombre translucide */
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    z-index: 999;
    
    /* Animation de déroulement (caché en haut par défaut) */
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease, visibility 0.4s;
    
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #d97706;
}

/* Classe active ajoutée par le JS pour ouvrir le menu */
#dropdown-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* --- LES LIENS DU MENU --- */
.menu-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-links li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-item {
    display: block;
    padding: 20px;
    text-align: center;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 1.1rem;
    font-family: sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.3s, color 0.3s;
}

.menu-item:hover {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

/* --- ANIMATION DU BURGER QUAND OUVERT --- */
#burger-menu-btn.open .burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
#burger-menu-btn.open .burger-line:nth-child(2) {
    opacity: 0;
}
#burger-menu-btn.open .burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* =========================================
   STYLES DU POP-UP & AUTHENTIFICATION
   ========================================= */

/* Classe utilitaire très importante pour cacher des éléments en JS */
.hidden {
    display: none !important;
}

/* Zone du pseudo en haut du menu */
.user-greeting {
    text-align: center;
    padding: 15px;
    color: #e5e7eb;
    font-family: sans-serif;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(251, 191, 36, 0.1);
}

#user-pseudo {
    color: #fbbf24;
    font-weight: bold;
}

/* Le Footer du menu contenant les boutons */
.menu-footer {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 10px; /* Espace entre les boutons "Connexion" et "Créer compte" */
}

/* Boutons de connexion/inscription dans le menu */
.auth-btn, #logout-btn {
    padding: 10px 15px;
    background: transparent;
    color: #e5e7eb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.auth-btn.highlight {
    color: #fbbf24;
    border-color: #fbbf24;
}

.auth-btn.highlight:hover {
    background: #fbbf24;
    color: #111827;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* Spécial Déconnexion (Rouge) */
#logout-btn {
    color: #ef4444;
    border-color: #ef4444;
}
#logout-btn:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.w-100 {
    width: 100%;
    margin: 15px 0 0 0;
}

/* --- LE POP-UP (MODAL) --- */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000; /* Doit être au dessus de la navbar (1000) */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1f2937;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #d97706;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    position: relative;
    font-family: sans-serif;
    color: white;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #fbbf24;
}

.modal-content h2 {
    margin-top: 0;
    color: #fbbf24;
    text-align: center;
    text-transform: uppercase;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    box-sizing: border-box;
    background: #111827;
    border: 1px solid #4b5563;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
}

.modal-content input:focus {
    outline: none;
    border-color: #fbbf24;
}

.modal-switch-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #9ca3af;
}

.modal-switch-text a {
    color: #fbbf24;
    text-decoration: none;
    font-weight: bold;
}

.modal-switch-text a:hover {
    text-decoration: underline;
}
/* Message affiché à la place du contenu d'une page (non connecté, accès refusé...) */
.page-message {
    max-width: 500px;
    margin: 120px auto 0;
    padding: 30px;
    text-align: center;
    color: #e5e7eb;
    font-family: sans-serif;
    font-size: 1.2rem;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid #d97706;
    border-radius: 12px;
}

.page-message .auth-btn {
    margin-top: 15px;
}
