/* ===== MODERN NAVBAR STYLES ===== */

/* Header Glass Moderno */
.header-glass {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.header-glass.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(0, 255, 136, 0.2);
}

.header-glass.hidden {
    transform: translateY(-100%);
}

/* Container Navbar */
.nav-container {
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: relative;
    gap: 3rem;
}

/* Brand/Logo */
.nav-brand {
    display: flex;
    align-items: center;
    z-index: 1001;
}

.logo-glow {
    display: flex;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo-glow:hover {
    transform: scale(1.05);
}

.logo-text {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.logo-accent {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 4px;
    position: relative;
}

.logo-accent::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logo-glow:hover .logo-accent::after {
    opacity: 1;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: flex-start;
    padding-left: 2rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    position: relative;
    background: transparent;
    border: 1px solid transparent;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-link.active {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 15px -5px rgba(0, 255, 136, 0.5);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
    flex-shrink: 0;
    padding-right: 1rem;
}

/* Action Buttons */
.nav-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    overflow: hidden;
}

.nav-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 204, 106, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-action-btn:hover::before {
    opacity: 1;
}

.nav-action-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.nav-action-btn:hover svg {
    transform: scale(1.1);
}

/* Badge per contatori */
.nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-auth-unified {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #0f172a;
    box-shadow: 0 4px 15px -5px rgba(0, 255, 136, 0.6);
}

.btn-auth-unified:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -5px rgba(0, 255, 136, 0.7);
}

.btn-auth-unified:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px -5px rgba(0, 255, 136, 0.6);
}

.btn-auth-unified:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-auth-unified svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.btn-auth-unified:hover svg {
    transform: scale(1.1);
}


/* Profile Menu */
.profile-menu {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

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

.profile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.profile-link:hover {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover span {
    background: #00ff88;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

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

.mobile-menu-content {
    padding: 2rem;
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-links li {
    margin-bottom: 1rem;
}

.mobile-nav-links .nav-link {
    display: block;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

.mobile-nav-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-container {
        padding: 0 1.5rem;
        gap: 2rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
        padding-left: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .nav-container {
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    .nav-menu {
        gap: 1rem;
        padding-left: 1rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        height: 60px;
        gap: 0.5rem;
    }
    
    .logo-glow {
        font-size: 1.4rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-actions {
        gap: 0.5rem;
    }
    
    .nav-action-btn {
        width: 36px;
        height: 36px;
    }
    
    .nav-action-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .btn-auth-unified {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .profile-btn {
        padding: 0.4rem;
    }
    
    .profile-btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.75rem;
        height: 55px;
    }
    
    .logo-glow {
        font-size: 1.2rem;
    }
    
    .nav-actions {
        gap: 0.25rem;
    }
    
    .nav-action-btn {
        width: 32px;
        height: 32px;
    }
    
    .nav-action-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .btn-auth-unified {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* Animazioni di entrata */
@keyframes slideInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-glass {
    animation: slideInFromTop 0.6s ease-out;
}

/* Effetti di focus per accessibilità */
.nav-link:focus,
.nav-action-btn:focus,
.btn-auth-unified:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
}

/* Stati di caricamento */
.nav-loading {
    opacity: 0.7;
    pointer-events: none;
}

.nav-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
