/**
 * =========================================================================
 * ARBIMASTER - HEADER STYLES
 * File: assets/css/header-styles.css
 * Versione: 3.0 - Stili header ottimizzati e modulari
 * =========================================================================
 */

/* === NAVBAR BASE === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    padding: 0.75rem 0;
}

/* Dark mode navbar */
[data-theme="dark"] .navbar {
    background: rgba(31, 41, 55, 0.95);
}

/* Navbar scrolled state */
.navbar.scrolled {
    background: var(--bg-primary);
    box-shadow: 0 4px 6px -1px var(--shadow);
    padding: 0.5rem 0;
}

/* === NAVBAR CONTAINER === */
.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* === LOGO & BRAND === */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.navbar-logo {
    font-size: 2rem;
    animation: subtle-bounce 2s ease-in-out infinite;
}

@keyframes subtle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* === DESKTOP NAVIGATION === */
.nav-desktop {
    display: none;
}

@media (min-width: 768px) {
    .nav-desktop {
        display: flex;
        align-items: center;
        gap: 2rem;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
}

/* Underline effect */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: calc(100% - 2rem);
}

/* Logout link special style */
.nav-link-logout {
    color: #ef4444;
}

.nav-link-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* === USER ACTIONS === */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle Button */
.theme-toggle {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: rotate(180deg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* User Avatar */
.user-avatar {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* User Menu Button */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-btn:hover {
    background: var(--bg-quaternary);
    transform: translateY(-1px);
}

/* User Dropdown Menu */
.user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 16rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Auth Buttons */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* === MOBILE MENU BUTTON === */
.mobile-menu-btn {
    display: flex;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
}

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

/* === MOBILE MENU OVERLAY === */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-medium);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1998;
}

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

/* === MOBILE MENU PANEL === */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -10px 0 25px var(--shadow-xl);
    transition: right 0.3s ease;
    z-index: 1999;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

/* Mobile menu content */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-close {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.mobile-menu-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Mobile navigation links */
.mobile-nav {
    padding: 1rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.mobile-nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    text-decoration: none;
}

.mobile-nav-link.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

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

/* Mobile user info */
.mobile-user-info {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-user-avatar {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

/* Mobile divider */
.mobile-nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

/* Mobile CTA */
.mobile-cta {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.mobile-cta .btn-gradient {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.5rem;
}

/* === ANIMATIONS === */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-logo {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 90%;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
}

/* === ACCESSIBILITY === */
.nav-link:focus,
.theme-toggle:focus,
.user-menu-btn:focus,
.mobile-menu-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 0 0.5rem 0.5rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 1001;
}

.skip-link:focus {
    top: 0;
}

/* === PRINT STYLES === */
@media print {
    .navbar {
        position: static;
        background: white;
        box-shadow: none;
        border-bottom: 1px solid #ccc;
    }
    
    .nav-actions,
    .mobile-menu-btn,
    .theme-toggle {
        display: none !important;
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .navbar {
        border-bottom: 2px solid var(--text-primary);
    }
    
    .nav-link {
        text-decoration: underline;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: var(--text-primary);
        color: var(--bg-primary);
    }
}