/* Navigation Authentication Styles */

/* Navigation Auth Container */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Auth Buttons (when not logged in) */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.login-link:hover {
    color: #374151;
    background: #f3f4f6;
}

.login-link i {
    font-size: 0.875rem;
}

/* User Menu (when logged in) */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.user-info:hover {
    background: #f8fafc;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
}

.user-details {
    display: flex;
    align-items: center;
}

.user-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
}

.user-role {
    display: none; /* Hide user role */
}

/* Dropdown */
.user-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-toggle:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.dropdown-toggle i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.dropdown-toggle.active i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #1f2937;
}

.dropdown-item i {
    font-size: 0.875rem;
    color: #6b7280;
    width: 16px;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.logout-btn {
    color: #dc2626;
}

.logout-btn:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.logout-btn i {
    color: #dc2626;
}

/* Admin Role Styling */
.user-role.admin {
    color: #059669;
    background: #dcfce7;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.user-avatar.admin {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-auth {
        gap: 0.5rem;
    }
    
    .user-details {
        display: none;
    }
    
    .user-info {
        padding: 0.25rem;
    }
    
    .login-link {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .login-link span {
        display: none;
    }
    
    .dropdown-menu {
        right: -1rem;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .auth-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Navigation Container Updates */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

@media (max-width: 768px) {
    .nav-container {
        gap: 1rem;
    }
}

/* Loading State */
.nav-auth.loading {
    opacity: 0.6;
    pointer-events: none;
}

.nav-auth.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}