/* --- VARIABLES ET THÈME --- */
:root {
    --header-bg: rgba(13, 17, 28, 0.82);
    --header-border: rgba(255, 255, 255, 0.07);
    --primary-color: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bez: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Thème G-Coins Premium */
    --gold-border: rgba(184, 134, 11, 0.6);
    --gold-text: #FFA500;
    --gold-glow: rgba(255, 165, 0, 0.8);
    --coin-bg: rgba(22, 22, 26, 0.9);
}

/* --- ANIMATIONS --- */
@keyframes coinRotate {
    0%   { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* --- STRUCTURE PRINCIPALE --- */
.main-header {
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar { padding: 0.75rem 0; }

.navbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* --- LOGO PRINCIPAL --- */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s var(--bez);
}

.logo:hover { transform: scale(1.03); }

.logo-wrapper {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.8px;
}

.logo-text span {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- SECTION COMPTE ET G-COINS --- */
.account-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* LA PILULE G-COINS PREMIUM */
.gcoin-pill {
    display: inline-flex;
    align-items: center;
    background: var(--coin-bg);
    border: 1px solid var(--gold-border);
    padding: 6px 16px 6px 8px;
    border-radius: 50px;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
    height: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.gcoin-pill:hover {
    background: rgba(30, 30, 35, 1);
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.2);
    transform: translateY(-1px);
}

.coin-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    position: relative;
}

.coin-icon-nav {
    width: 24px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--gold-glow));
}

.rotating-logo {
    animation: coinRotate 4s infinite linear;
    transform-style: preserve-3d;
    will-change: transform;
}

.coin-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gold-text);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

#gCoinsBalance {
    color: #FFD700;
}

.coin-value small {
    font-size: 0.85rem;
    color: var(--gold-text);
    opacity: 0.8;
    font-weight: 600;
    text-transform: none;
}

/* --- BOUTONS --- */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s var(--bez);
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-glass {
    background: var(--glass);
    color: var(--text-main);
    border: 1px solid var(--header-border);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* --- DROPDOWN --- */
.dropdown-container { position: relative; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 230px;
    background: #111520;
    border: 1px solid var(--header-border);
    border-radius: 18px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    padding: 10px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s var(--bez);
}

.dropdown-container:hover .dropdown-menu,
.dropdown-container.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.92rem;
    border-radius: 12px;
    transition: var(--transition);
}

.dropdown-item:hover { background: rgba(255, 255, 255, 0.05); }

.dropdown-item.logout-btn {
    margin-top: 8px;
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
    font-weight: 700;
}

/* --- NAV LINKS --- */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 35px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 1.2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link:hover { color: #fff; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-link span, .nav-btn span, .logo-text { display: none; }
    .nav-links { gap: 20px; }
}

/* --- STYLE DES PIÈCES DANS LES MODALES --- */
.modal-header {
    display: flex;
    align-items: center;
    gap: 20px; /* Plus d'espace car la pièce est plus grosse */
    padding: 20px;
    border-bottom: 1px solid var(--header-border);
}

.modal-coin-icon {
    /* On force les dimensions */
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;

    /* On annule les bridages potentiels de Bootstrap */
    max-width: none !important;

    object-fit: contain;
    filter: drop-shadow(0 0 15px var(--gold-glow));
    animation: coinRotate 4s infinite linear;
    transform-style: preserve-3d;

    /* Optionnel : un peu de marge pour ne pas coller au bord */
    margin-right: 10px;
}

#modalTitle {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
}
