/* css/layout.css */

/* NAVBAR GRID */
.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 70px;
    padding: 0 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- LOGOS (GAUCHE) --- */
.navbar-left {
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    height: 100%;
}

/* Logo image (sorti du rond, taille augmentée) */
.logo-main {
    height: 55px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s;
}

/* Logo texte */
.logo-text {
    height: 45px;
    width: auto;
    object-fit: contain;
    display: block;
}

.navbar-logo-container:hover .logo-main {
    transform: scale(1.05);
}

/* --- MENU (CENTRE) --- */
.navbar-center {
    display: flex;
    gap: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.nav-link.active svg {
    opacity: 1;
}

/* --- ACTIONS (DROITE) --- */
.navbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

/* 1. Boutons Standards (Quêtes & Amis) */
.quest-btn, .icon-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

/* --- FORCE BRUTE POUR L'AFFICHAGE DES SVG --- */
/* Utilisation de !important pour empêcher l'écrasement */
.quest-btn svg, .icon-btn svg {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.5px !important;
    opacity: 1 !important;
}

.quest-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #facc15;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #38bdf8;
}

/* Garde le bouton allumé quand la barre d'amis est ouverte */
.icon-btn.active {
    background: rgba(255, 255, 255, 0.05);
    color: #38bdf8;
}

.quest-btn.active {
    background: rgba(255, 255, 255, 0.05);
    color: #facc15;
}

#leftSidebarBtn.active {
    background: rgba(255, 255, 255, 0.05);
    color: #facc15;
}

/* Badge de notification (Quêtes) */
.quest-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border: 2px solid #1e293b;
    z-index: 10;
}

/* 2. Gros bouton Profil (Remplace Connexion) */
.profile-btn-large {
    background: transparent;
    border: none;
    color: #cbd5e1;
    width: 55px; /* Même taille que le logo de gauche */
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    padding: 0;
    flex-shrink: 0;
}

/* Force l'affichage du SVG Profil en grand */
.profile-btn-large svg {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.2px !important;
}

.profile-btn-large:hover {
    color: #38bdf8;
    transform: scale(1.05);
}

/* --- MODAL QUÊTES --- */
.quest-modal-overlay {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

.quest-modal-overlay.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.quest-header {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.btn-close-modal {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.quest-list {
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

/* Styles Items Quête */
.quest-item-mini {
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 3px solid #64748b;
    transition: background 0.2s;
}

.quest-item-mini.active {
    border-left-color: #38bdf8;
}

.quest-item-mini.completed {
    border-left-color: #22c55e;
    opacity: 0.7;
}

.q-content {
    width: 100%;
}

.q-title {
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.q-prog-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    width: 100%;
    overflow: hidden;
}

.q-prog-fill {
    height: 100%;
    background: #38bdf8;
    border-radius: 2px;
}

.quest-item-mini.completed .q-prog-fill {
    background: #22c55e;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .navbar-center {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #1e293b;
        z-index: 100;
        justify-content: space-around;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link span {
        display: none;
    }

    .quest-modal-overlay {
        top: 70px;
        right: 10px;
        width: auto;
        left: 10px;
    }
}