/* ════════════════════════════════════════════════════════════════
   header.css — Clean Pixel / GeoExplorer System
   Estilos do <header> principal (extraídos de includes/header.php)
   ════════════════════════════════════════════════════════════════ */

/* ── Nav links ──────────────────────────────────────────────────── */
.header-nav-link {
    display: inline-block;
    padding: 6px 14px;
    color: #555;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 400;
    border-radius: 8px;
    transition: color .15s, background .15s;
    position: relative;
}
.header-nav-link:hover {
    color: #2e7d32;
    background: #f0f7f0;
}
.header-nav-link.active {
    color: #1b5e20;
    font-weight: 600;
}
.header-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: #4caf50;
    border-radius: 2px;
}

/* ── Avatar ──────────────────────────────────────────────────────── */
#header-avatar-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #4caf50;
    display: block;
}

/* ── Wrapper top / Nav principal ─────────────────────────────────── */
.hdr-top-wrap { z-index: 1000; left: 0; right: 0; }

.hdr-nav {
    background: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px 0 20px;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
body.dark-mode .hdr-nav {
    background: #121212;
    border-color: #2a2a2a;
}

/* ── Logo ─────────────────────────────────────────────────────────── */
.hdr-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; flex-shrink: 0; margin-right: 28px;
}
.hdr-logo-icon {
    width: 32px; height: 32px;
    background: #2e7d32; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; color: #fff; font-size: 1.1rem; flex-shrink: 0;
}
.hdr-logo-name {
    color: #2e7d32;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700; font-size: 24px;
    letter-spacing: -.5px; white-space: nowrap;
}

/* ── Nav links container (desktop) ───────────────────────────────── */
.hdr-nav-links {
    display: flex; align-items: center; gap: 2px; flex: 1;
}

/* ── Lado direito ────────────────────────────────────────────────── */
.hdr-right {
    display: flex; align-items: center; gap: 8px;
    margin-left: auto; flex-shrink: 0;
}

/* ── XP Pill (#painel-pontos) ────────────────────────────────────── */
#painel-pontos {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 9999px;
    padding: 8px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}
#painel-pontos.visivel { display: flex !important; }
body.dark-mode #painel-pontos {
    background: #1e1e1e; border-color: #333;
}
body.dark-mode .hdr-globinho-img {
    filter: brightness(1.6) drop-shadow(0 0 3px rgba(100,200,100,.35));
}

.hdr-xp-group    { display: flex; align-items: center; gap: 6px; }
.hdr-globinho-img { width: 22px; height: 22px; object-fit: contain; display: block; }
.hdr-globinho-emoji { font-size: 1.1rem; line-height: 1; }
.hdr-xp-texts    { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }

.hdr-pill-label {
    font-size: 9px; font-weight: 600; color: #444746;
    text-transform: uppercase; letter-spacing: .04em; line-height: 1;
}
body.dark-mode .hdr-pill-label { color: #888; }

#saldoTotalHeader    { font-size: 14px; font-weight: 700; color: #2e7d32; line-height: 1.1; }
.hdr-divider         { width: 1px; height: 24px; background: #e0e0e0; flex-shrink: 0; }
body.dark-mode .hdr-divider { background: #444; }

.hdr-nivel-group { display: flex; flex-direction: column; align-items: center; gap: 0; }
#header-nivel-num { font-size: 14px; font-weight: 700; color: #1c1b1b; line-height: 1.1; }
body.dark-mode #header-nivel-num { color: #eee; }

.hdr-hidden { display: none; }

/* ── Status dot ──────────────────────────────────────────────────── */
#status-dot-link { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
#status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #aaa; display: inline-block;
    flex-shrink: 0; transition: background .4s;
}
#status-label { font-size: .68rem; color: #777; display: none; margin-left: 3px; }

/* ── Bloco usuário ───────────────────────────────────────────────── */
#hdr-user    { display: none; align-items: center; gap: 8px; }
#hdr-avatar-foto {
    display: none; position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
#header-avatar { display: none; }
.hdr-avatar  { cursor: pointer; }

/* Esconde elementos antigos que não cabem no novo design */
#imagem50 { display: none; }

/* ── Botões ícone (som + dark mode) ─────────────────────────────── */
.hdr-icon-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #666;
    padding: 5px 11px;
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.hdr-icon-btn:hover {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}
body.dark-mode .hdr-icon-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #bbb;
}
body.dark-mode .hdr-icon-btn:hover {
    background: #1b3a1f;
    color: #81c784;
    border-color: #2e7d32;
}

/* ── Botões de controle em verde (som, dark mode, A-/A+) ────────── */
#toggle-som,
#toggle-dark-mode,
#toggle-som-mob,
#toggle-dark-mob,
#mob-decrease-font,
#mob-increase-font {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}
#toggle-som:hover,
#toggle-dark-mode:hover {
    background: #1b5e20;
    border-color: #1b5e20;
    color: #fff;
}
#toggle-som-mob:hover,
#toggle-dark-mob:hover,
#mob-decrease-font:hover,
#mob-increase-font:hover {
    background: #1b5e20;
    border-color: #1b5e20;
}
body.dark-mode #toggle-som,
body.dark-mode #toggle-dark-mode,
body.dark-mode #toggle-som-mob,
body.dark-mode #toggle-dark-mob,
body.dark-mode #mob-decrease-font,
body.dark-mode #mob-increase-font {
    background: #2e7d32;
    border-color: #388e3c;
    color: #fff;
}

/* ── Bloco usuário (nome + sair + avatar) ────────────────────────── */
.hdr-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}
.hdr-user-nome {
    font-family: 'Montserrat', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.hdr-sair-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: .7rem;
    font-weight: 600;
    color: #e53935;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
    line-height: 1.3;
    transition: color .15s;
}
.hdr-sair-btn:hover { color: #b71c1c; }

/* ── Avatar circular com inicial ────────────────────────────────── */
.hdr-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.3);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: box-shadow .15s;
}
.hdr-avatar:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.22);
}

/* Dark mode — texto */
body.dark-mode .hdr-user-nome { color: #e0e0e0; }

/* ── Breakpoint custom: hambúrguer em < 800px ────────────────────────
   W3.CSS usa 601px (small) e 992px (medium/large).
   Aqui sobrescrevemos para 800px como ponto de corte único.         */
@media (max-width: 800px) {
    /* Mostra hambúrguer */
    nav button.w3-hide-large.w3-hide-medium {
        display: inline-flex !important;
        align-items: center;
    }
    /* Esconde nav links do desktop */
    nav div.w3-hide-small {
        display: none !important;
    }
}
@media (min-width: 801px) {
    /* Esconde hambúrguer */
    nav button.w3-hide-large.w3-hide-medium {
        display: none !important;
    }
    /* Mostra nav links */
    nav div.w3-hide-small {
        display: flex !important;
    }
}

/* ── Hamburger ───────────────────────────────────────────────────── */
.hdr-hamburger {
    background: none; border: none; color: #555;
    padding: 6px 10px; cursor: pointer; font-size: 1.1rem;
}
body.dark-mode .hdr-hamburger { color: #ccc; }

/* ── Mobile nav drawer ───────────────────────────────────────────── */
#navDemo {
    margin-top: 56px; z-index: 999;
    background: #fff; border-top: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    max-height: calc(100vh - 56px); overflow-y: auto;
}
body.dark-mode #navDemo { background: #1e1e1e; border-color: #333; }

.mob-nav-item {
    color: #333; padding: 14px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
}
body.dark-mode .mob-nav-item { color: #ddd; }

.mob-nav-icon { width: 16px; color: #999; }

.mob-dropdown-btn {
    text-align: left; width: 100%;
    border: none; background: inherit;
    color: #333; padding: 14px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 10px; cursor: pointer;
}
body.dark-mode .mob-dropdown-btn { color: #ddd; }

.mob-submenu { border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
body.dark-mode .mob-submenu { border-color: #2a2a2a; }

.mob-submenu-item {
    padding: 11px 20px 11px 46px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px; color: #555;
}
body.dark-mode .mob-submenu-item { color: #aaa; }

.mob-separator { height: 1px; background: #f0f0f0; margin: 4px 0; }
body.dark-mode .mob-separator { background: #2a2a2a; }

.mob-controls {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px 16px; border-top: 1px solid #eee; margin-top: 4px;
}
body.dark-mode .mob-controls { border-color: #333; }

.mob-btn-group { display: flex; gap: 6px; }

.mob-ctrl-btn {
    width: 38px; height: 38px; border-radius: 8px;
    border: 1px solid #e0e0e0; background: #f8f9fa;
    color: #555; cursor: pointer;
}
body.dark-mode .mob-ctrl-btn { background: #2a2a2a; border-color: #444; color: #bbb; }

#toggle-som-mob, #toggle-dark-mob { font-size: .95rem; }
#mob-decrease-font { font-size: .8rem; font-weight: 700; }
#mob-increase-font { font-size: .85rem; font-weight: 700; }

/* ── Modal Sair ──────────────────────────────────────────────────── */
#modal-sair-global {
    display: none; position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
    align-items: center; justify-content: center;
}
.modal-sair-card {
    background: #fff; border-radius: 16px;
    max-width: 340px; width: 92%;
    padding: 32px 24px 24px; text-align: center;
    position: relative; box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
body.dark-mode .modal-sair-card { background: #1e1e1e; }
.modal-sair-img  { margin-bottom: 10px; display: block; margin-inline: auto; }
.modal-sair-title {
    color: #e53935; margin: 0 0 6px;
    font-family: 'Montserrat', sans-serif; font-size: 1.1rem;
}
#modal-sair-msg { font-size: .88rem; color: #555; margin: 0 0 20px; line-height: 1.5; }
body.dark-mode #modal-sair-msg { color: #aaa; }

.modal-sair-btns { display: flex; gap: 10px; }
.modal-sair-btn-confirm {
    flex: 1; padding: 11px; border-radius: 8px; border: none;
    background: #e53935; color: #fff; font-weight: 700;
    cursor: pointer; font-family: 'Montserrat', sans-serif;
}
.modal-sair-btn-cancel {
    flex: 1; padding: 11px; border-radius: 8px;
    border: 1px solid #ddd; background: #f5f5f5;
    color: #444; cursor: pointer; font-family: 'Montserrat', sans-serif;
}
