/* css/header.css - Estilos do Header VouF Game */

/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
    --header-bg: #ffffff;
    --header-border: #f3f4f6;
    --header-text: #374151;
    --header-text-hover: #3b82f6;
    --header-btn-bg: rgba(255, 255, 255, 0.1);
    --header-btn-border: #4b5563;
    --header-btn-hover-bg: rgba(59, 130, 246, 0.15);
    --header-menu-bg: #111827;
    --header-menu-text: #d1d5db;
    --header-menu-hover: #60a5fa;
    --header-dropdown-bg: #ffffff;
    --header-dropdown-border: #e5e7eb;
    --header-dropdown-hover: #eff6ff;
    --header-user-bg: rgba(255, 255, 255, 0.7);
    --header-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --container-width: 42rem; /* max-w-2xl */
    --transition-speed: 0.2s;
}

/* ===== BASE DO HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: var(--header-bg);
    box-shadow: var(--header-shadow);
    border-bottom: 1px solid var(--header-border);
    font-family: 'Inter', sans-serif;
}

/* Container padrão para Linhas 1 e 3 */
.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== LINHA 1: Logo + Banner + Auth ===== */
.header-line-1 {
    display: none; /* Oculta em mobile */
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
	border: 1px solid;
}

@media (min-width: 768px) {
    .header-line-1 {
        display: flex;
    }
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    text-decoration: none;
}

.header-logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.125rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-logo-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1f2937;
}

.header-logo-text span {
    color: #2563eb;
}

.header-banner {
    display: none;
    flex: 1;
    margin: 0 1rem;
    max-width: 20rem;
    background: #f9fafb;
    border: 1px solid var(--header-border);
    border-radius: 0.75rem;
    padding: 0.25rem 0.75rem;
}

@media (min-width: 1024px) {
    .header-banner {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.header-banner-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    width: 100%;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn-notification {
    display: none;
    padding: 0.5rem;
    color: #6b7280;
    border-radius: 0.5rem;
    transition: all var(--transition-speed);
    background: none;
    border: none;
    cursor: pointer;
}

.header-btn-notification:hover {
    color: var(--header-text-hover);
    background: #eff6ff;
}

@media (min-width: 768px) {
    .header-btn-notification {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.header-btn-notification i {
    font-size: 1rem;
}

.header-btn-notification .badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 0.5rem;
    height: 0.5rem;
    background: #ef4444;
    border-radius: 50%;
}

.header-btn-auth {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.header-btn-auth.logout {
    color: #4b5563;
}

.header-btn-auth.logout:hover {
    color: #dc2626;
    background: #fef2f2;
}

.header-btn-auth.login {
    background: #111827;
    color: white;
}

.header-btn-auth.login:hover {
    background: #1f2937;
}

/* ===== LINHA 2: Menu (Fundo Escuro) ===== */
.header-line-2 {
    width: 100%;
    background: var(--header-menu-bg);
    border-top: 1px solid #374151;
    display: none;
}

@media (min-width: 768px) {
    .header-line-2 {
        display: block;
    }
}

.header-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

/* Botões do Menu */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--header-menu-text);
    background: var(--header-btn-bg);
    border: 1px solid var(--header-btn-border);
    border-radius: 9999px;
    text-decoration: none;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--header-menu-hover);
    border-color: var(--header-menu-hover);
    background: var(--header-btn-hover-bg);
}

.nav-btn i {
    font-size: 0.75rem;
    opacity: 0.7;
    transition: opacity var(--transition-speed);
}

.nav-btn:hover i,
.nav-btn.active i {
    opacity: 1;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-toggle i.fa-chevron-down {
    font-size: 0.625rem;
    transition: transform var(--transition-speed);
}

.dropdown:hover .dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 13rem;
    background: var(--header-dropdown-bg);
    border: 1px solid var(--header-dropdown-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.25rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
    z-index: 50;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all var(--transition-speed);
}

.dropdown-item i {
    width: 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
}

.dropdown-item:hover {
    color: #2563eb;
    background: var(--header-dropdown-hover);
}

.dropdown-item:hover i {
    color: #2563eb;
}

/* ===== LINHA 3: Stats do Usuário ===== */
.header-line-3 {
    display: none;
    width: 100%;
    background: linear-gradient(90deg, #eff6ff, #faf5ff, #fdf2f8);
    border-bottom: 1px solid #e0e7ff;
}

@media (min-width: 768px) {
    .header-line-3 {
        display: block;
    }
}

.header-user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.header-username {
    font-weight: 600;
    color: #374151;
}

.header-stats {
    display: flex;
    gap: 0.75rem;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--header-user-bg);
    padding: 0.125rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--header-border);
}

.header-stat i {
    font-size: 0.75rem;
}

.header-stat.coins i { color: #eab308; }
.header-stat.diamonds i { color: #a855f7; }

.header-stat strong {
    color: #1f2937;
    font-weight: 600;
}

/* ===== HEADER MOBILE (Aparece apenas em telas pequenas) ===== */
.header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    background: var(--header-menu-bg);
    border-bottom: 1px solid #374151;
    box-shadow: var(--header-shadow);
}

@media (min-width: 768px) {
    .header-mobile {
        display: none;
    }
}

.header-mobile-toggle {
    padding: 0.5rem;
    color: #d1d5db;
    background: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.header-mobile-toggle:hover {
    background: #374151;
    color: white;
}

.header-mobile-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

.header-mobile-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #1f2937;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.header-mobile-stat i {
    font-size: 0.75rem;
}

.header-mobile-stat.coins i { color: #fbbf24; }
.header-mobile-stat.diamonds i { color: #c084fc; }

.header-mobile-auth {
    color: #9ca3af;
    transition: color var(--transition-speed);
}

.header-mobile-auth:hover {
    color: #ef4444;
}

.header-mobile-auth.login-btn {
    background: #2563eb;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== MENU MOBILE RECOLHÍVEL ===== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 18rem;
    background: white;
    z-index: 51;
    box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.mobile-menu-panel.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.mobile-menu-title {
    font-weight: 600;
    color: #1f2937;
}

.mobile-menu-close {
    padding: 0.5rem;
    color: #6b7280;
    background: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.mobile-menu-close:hover {
    color: #1f2937;
    background: #e5e7eb;
}

.mobile-menu-nav {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all var(--transition-speed);
}

.mobile-menu-item:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.mobile-menu-item i {
    width: 1.25rem;
    text-align: center;
    color: #9ca3af;
}

/* Accordion para Jogos no Mobile */
.mobile-accordion {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.mobile-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: #374151;
    background: white;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: left;
}

.mobile-accordion-header:hover {
    background: #eff6ff;
    color: #2563eb;
}

.mobile-accordion-header i.fa-chevron-down {
    transition: transform var(--transition-speed);
}

.mobile-accordion-header.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.mobile-accordion-content {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: none;
}

.mobile-accordion-content.active {
    display: block;
}

.mobile-accordion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-speed);
}

.mobile-accordion-item:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* Footer do Menu Mobile */
.mobile-menu-footer {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
}

.mobile-login-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.625rem;
    background: #2563eb;
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background var(--transition-speed);
}

.mobile-login-btn:hover {
    background: #1d4ed8;
}

/* ===== UTILITÁRIOS ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu {
    animation: fadeIn 0.2s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.mobile-menu-panel.active {
    animation: slideIn 0.3s ease-out;
}

/* ===== RESPONSIVIDADE ADICIONAL ===== */
@media (max-width: 767px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .nav-btn {
        padding: 0.25rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .dropdown-menu {
        width: 11rem;
        left: 0;
        transform: translateX(0) translateY(4px);
    }
    
    .dropdown:hover .dropdown-menu {
        transform: translateX(0) translateY(0);
    }
}

/* ===== ACESSIBILIDADE ====   = */
.nav-btn:focus,
.dropdown-item:focus,
.mobile-menu-item:focus,
.mobile-accordion-header:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduzir animações para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}