/* ===================================
   COMMON STYLES - USER MENU & GLOBAL
   =================================== */

/* User Menu Dropdown */
.user-menu {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
}

.user-menu .user-greeting {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
    position: relative;
    font-size: 14px;
    white-space: nowrap;
}

.user-menu .user-greeting:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.user-menu .dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

.user-menu:hover .dropdown,
.user-menu .dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.user-menu .dropdown a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.user-menu .dropdown a:hover {
    background: linear-gradient(to right, #f8f9ff 0%, #ffffff 100%);
    color: #667eea;
    padding-left: 1.5rem;
}

.user-menu .dropdown a:first-child {
    border-radius: 12px 12px 0 0;
}

.user-menu .dropdown a:last-child {
    border-radius: 0 0 12px 12px;
    color: #ef5350;
}

.user-menu .dropdown a:last-child:hover {
    background: #ffebee;
    color: #c62828;
}

/* Auth Links (Login/Register) */
.auth-link {
    display: inline-block;
    margin-left: 0.5rem;
}

.auth-link .nav-link {
    color: var(--text-color, #2c3e50);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
    display: inline-block;
}

.auth-link .nav-link:hover {
    color: #667eea;
}

.auth-link .btn-register {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.auth-link .btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Dark Mode User Menu */
[data-theme="dark"] .user-menu .dropdown {
    background: #2c2f38;
    border-color: #3a3d45;
}

[data-theme="dark"] .user-menu .dropdown a {
    color: #e8eaed;
}

[data-theme="dark"] .user-menu .dropdown a:hover {
    background: #343843;
    color: #7f8ff1;
}

[data-theme="dark"] .user-menu .dropdown a:last-child {
    color: #ff7b7b;
}

[data-theme="dark"] .user-menu .dropdown a:last-child:hover {
    background: #3a2f2f;
    color: #ff9595;
}

[data-theme="dark"] .auth-link .nav-link {
    color: #e8eaed;
}

[data-theme="dark"] .auth-link .nav-link:hover {
    color: #7f8ff1;
}

/* Navigation Enhancement */
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .user-menu .user-greeting {
        padding: 0.5rem 1rem;
        font-size: 13px;
    }
    
    .user-menu .dropdown {
        right: -10px;
        min-width: 180px;
    }
    
    .auth-link .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 13px;
    }
    
    .auth-link .btn-register {
        padding: 0.5rem 1rem;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .user-menu {
        margin-left: 0.5rem;
    }
    
    .user-menu .user-greeting {
        padding: 0.4rem 0.8rem;
        font-size: 12px;
        gap: 5px;
    }
    
    .user-menu .dropdown {
        left: auto;
        right: 0;
        min-width: 160px;
    }
}
