.site-header {
    position: sticky;
    top: 0;
    z-index: 99999;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition-normal);
}

.site-header.scrolled {
    background: rgba(3, 7, 18, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
    padding-bottom: 4px; /* Spazio per la linea */
}

/* MODIFICA: Linea Bandiera Italiana */
.header-logo-text::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #009246 33.33%, #ffffff 33.33%, #ffffff 66.66%, #ce2b37 66.66%);
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 2px;
    opacity: 0.9;
}

.header-logo-text span {
    /* MODIFICA: Colore Blu Elettrico */
    color: #1F51FF;
    text-shadow: 0 0 20px rgba(31, 81, 255, 0.4);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.nav-link:hover i {
    opacity: 1;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-header i {
    font-size: 0.85rem;
}

.btn-header-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.btn-header-ghost:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

.btn-header-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-header-outline:hover {
    border-color: var(--primary);
    color: var(--primary-glow);
    background: rgba(59, 130, 246, 0.08);
}

.btn-header-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-header-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.btn-header-success {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.btn-header-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}

.btn-header-discord {
    background: #5865F2;
    color: white;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.btn-header-discord:hover {
    background: #4752c4;
    transform: translateY(-1px);
}

.lang-switcher {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    color: var(--text-main);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu-btn:hover {
    border-color: var(--border-hover);
    background: rgba(0, 0, 0, 0.5);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: white;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-menu-chevron {
    color: var(--text-muted);
    font-size: 0.65rem;
    transition: transform var(--transition-fast);
}

.user-menu-btn.open .user-menu-chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.user-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.user-dropdown-header-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.user-dropdown-header-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-dropdown-section {
    padding: 8px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.user-dropdown-item:last-child {
    margin-bottom: 0;
}

.user-dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-main);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 8px;
}

.user-dropdown-item.danger {
    color: var(--danger);
}

.user-dropdown-item.danger i {
    color: var(--danger);
}

.user-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.user-dropdown-item.danger:hover i {
    color: var(--danger);
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

@media (max-width: 1024px) {
    .header-nav {
        display: none;
    }
    
    .nav-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: 56px;
        padding: 0 16px;
    }
    
    .header-logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .header-logo-text {
        font-size: 1.1rem;
    }
    
    .header-actions .btn-header span {
        display: none;
    }
    
    .header-actions .btn-header {
        padding: 9px 12px;
    }
    
    .header-actions .btn-header i {
        margin: 0;
    }
    
    .lang-switcher {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .user-menu-btn {
        padding: 6px;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}