/* ================================================
   HEADER.CSS — Cabeçalho, Navegação e Autenticação
   Midnight Edition | MinhaRua App
   ================================================ */

/* ================= CABEÇALHO PRINCIPAL ================= */
.main-header {
    background: #111114;
    border-bottom: 1px solid rgba(57, 255, 110, 0.12);
    color: white;
    padding: 0 24px;
    padding-top: env(safe-area-inset-top);
    height: calc(64px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
    z-index: var(--z-header);
    position: relative;
}

/* ================= LOGO ================= */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-fast);
    min-width: 220px;
}

.logo-area:hover { opacity: 0.95; }

.logo-site {
    height: 55px;
    width: auto;
    object-fit: contain;
    margin-left: 10px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    filter: drop-shadow(0px 4px 8px rgba(13, 148, 136, 0.15));
    transition: var(--transition-fast);
}

.logo-area:hover .logo-icon {
    filter: drop-shadow(0px 6px 12px rgba(13, 148, 136, 0.25));
    transform: translateY(-1px);
}

.logo-text h1 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.brand-name {
    color: white;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.logo-text .tagline {
    font-size: 0.68rem;
    opacity: 0.75;
    font-weight: 400;
    letter-spacing: 1.2px;
    display: block;
    margin-top: 3px;
}

/* ================= NAVEGAÇÃO DESKTOP ================= */
.main-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    transition: color 0.2s ease, background 0.2s ease, text-shadow 0.2s ease;
    position: relative;
}

.main-nav a:hover {
    color: #39FF6E;
    background-color: rgba(57, 255, 110, 0.07);
    text-shadow: 0 0 12px rgba(57, 255, 110, 0.55);
}

/* Ícone Instagram na nav */
.nav-instagram {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px !important;
    transition: all 0.2s ease !important;
}

.nav-instagram svg { transition: stroke 0.2s ease, filter 0.2s ease; }

.nav-instagram:hover {
    color: #39FF6E !important;
    background-color: rgba(57, 255, 110, 0.07) !important;
    text-shadow: none !important;
}

.nav-instagram:hover svg {
    stroke: #39FF6E;
    filter: drop-shadow(0 0 6px rgba(57, 255, 110, 0.6));
}

@media (max-width: 768px) {
    .nav-instagram { display: none !important; }
}

/* ================= ÁREA DO USUÁRIO ================= */
.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    justify-content: flex-end;
}

#user-logged-in { display: none; align-items: center; gap: 12px; }

#user-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

#user-name { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }

#badge-admin {
    display: none;
    background-color: var(--accent-orange);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ================= BOTÕES SOCIAIS (GOOGLE / APPLE) ================= */
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-social:active { transform: scale(0.96); }

.social-icon { width: 18px; height: 18px; }

.btn-google {
    background-color: white;
    color: #3c4043;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.btn-google:hover { background-color: #f8f9fa; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12); }

.btn-apple {
    background-color: #000000;
    color: white;
    border-color: #000000;
}
.btn-apple:hover { background-color: #333333; border-color: #333333; }

.main-header .btn-logout {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition-fast);
}

.main-header .btn-logout:hover { background: rgba(255, 255, 255, 0.25); }

/* ================= BOTÃO DE TEMA (LUA / SOL) ================= */
.btn-tema-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0;
    flex-shrink: 0;
}

.btn-tema-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* ================= BOTÃO MINHA CONTA (DESKTOP ONLY) ================= */
.btn-minha-conta {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2d;
    color: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.2px;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}
.btn-minha-conta:hover { background: #3a3a3e; transform: translateY(-1px); }
.btn-minha-conta:active { transform: scale(0.96); }

@media (max-width: 768px) { .btn-minha-conta { display: none !important; } }

/* ================= BOTÃO HAMBÚRGUER ================= */
#btn-mobile-toggle {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: var(--z-mobile-toggle);
    background: rgba(18, 20, 26, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(57, 255, 110, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
    font-size: 1.4rem;
    color: #a3ff00;
    text-shadow: 0 0 8px rgba(163, 255, 0, 0.5);
}

#btn-mobile-toggle:active {
    background: rgba(18, 20, 26, 0.95);
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 2px 5px rgba(0,0,0,0.5);
}

/* ================= OCULTAR LOGIN MOBILE NO DESKTOP ================= */
@media (min-width: 769px) {
    #btn-login-mobile { display: none !important; }
}

/* ================= RESPONSIVE HEADER MOBILE ================= */
@media (max-width: 768px) {
    .main-header {
        height: calc(60px + env(safe-area-inset-top));
        padding: 0 12px;
        padding-top: env(safe-area-inset-top);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .main-nav,
    .user-area { display: none !important; }

    .logo-area { min-width: unset; gap: 10px; }

    .logo-icon { width: 42px; height: 42px; }
    .logo-text h1 { font-size: 1rem; }
    .brand-name { font-size: 1rem; }
    .logo-text .tagline { font-size: 0.65rem; display: block; }

    #btn-mobile-toggle {
        display: flex !important;
        position: static;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        background: transparent;
        color: #39ff14;
        border: none;
        border-radius: 10px;
        font-size: 1.5rem;
        cursor: pointer;
        text-shadow: 0 0 8px rgba(57, 255, 20, 0.7);
        transition: opacity 0.2s, transform 0.15s;
        z-index: var(--z-mobile-toggle);
    }

    #btn-mobile-toggle:active { transform: scale(0.9); opacity: 0.75; }
    #btn-mobile-toggle.ativo-btn { color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.5); }

    @media (max-width: 380px) {
        .btn-social { height: 40px; padding: 0 20px; min-width: 120px; }
    }
}
