﻿/**
 * PFAD: /css/components/header.css
 * Version: 3.2.0
 */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding-top: var(--header-height, 60px);
    padding-bottom: 64px;
}

@media (min-width: 769px) {
    body {
        padding-bottom: 0;
    }
}

.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height, 60px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
    z-index: var(--z-fixed);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    padding: 0 var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 0 1 auto;
}

.nav-back-btn,
.nav-forward-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .nav-back-btn:hover,
    .nav-forward-btn:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
    }

    .nav-back-btn:active,
    .nav-forward-btn:active {
        transform: scale(0.95);
    }

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    transition: var(--transition-normal);
}

.logo-pyramid {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.desktop-nav {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--spacing-sm);
}

.desktop-nav-link {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-normal);
}

    .desktop-nav-link:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .desktop-nav-link.active {
        background: var(--primary-color);
        color: var(--btn-primary-text);
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.coins-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition-normal);
    flex-shrink: 0;
}

    .coins-display:hover {
        background: var(--card-hover-border);
        border-color: var(--accent-color);
    }

.user-avatar-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: var(--transition-normal);
    flex-shrink: 0;
}

    .user-avatar-btn:hover {
        border-color: var(--primary-color);
        transform: scale(1.05);
    }

    .user-avatar-btn img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--danger-color);
    border: 2px solid var(--header-bg);
    border-radius: var(--radius-full);
    animation: pulse 2s ease-in-out infinite;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--header-bg);
    border-top: 1px solid var(--header-border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: var(--z-fixed);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-container {
    max-width: 600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    position: relative;
    transition: var(--transition-fast);
}

    .nav-item:active {
        transform: scale(0.95);
    }

    .nav-item.active {
        color: var(--primary-color);
    }

.nav-icon {
    font-size: 22px;
}

.nav-badge {
    position: absolute;
    top: 8px;
    right: 50%;
    transform: translateX(16px);
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: var(--radius-full);
    animation: pulse 2s ease-in-out infinite;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    z-index: var(--z-modal);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    backdrop-filter: blur(4px);
}

    .menu-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

.menu-content {
    width: 100%;
    max-width: 320px;
    background: var(--modal-bg);
    border-left: 1px solid var(--modal-border);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
}

.menu-overlay.active .menu-content {
    transform: translateX(0);
}

.menu-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition-normal);
}

    .menu-close:hover {
        background: var(--danger-color);
        color: white;
        transform: rotate(90deg);
    }

.menu-header {
    padding: var(--spacing-2xl) var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.menu-user-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.menu-user-level {
    font-size: 14px;
    color: var(--accent-color);
    font-weight: 600;
}

.menu-items {
    padding: var(--spacing-md) 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-xl);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

    .menu-item:hover {
        background: var(--bg-hover);
    }

    .menu-item:active {
        transform: scale(0.98);
    }

.menu-item-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.menu-item-text {
    flex: 1;
}

.menu-item-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.menu-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.menu-item-danger .menu-item-icon {
    background: rgba(220, 53, 69, 0.1);
}

.menu-item-danger .menu-item-label {
    color: var(--danger-color);
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 var(--spacing-sm);
        gap: var(--spacing-sm);
    }

    .logo-text {
        display: none;
    }

    .nav-back-btn,
    .nav-forward-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .coins-display {
        padding: 6px 10px;
        font-size: 13px;
    }

    .user-avatar-btn {
        width: 36px;
        height: 36px;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}
