/* Profile Dropdown Component Styles */
/* Matches the main website design system */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #1d4ed8;
    --accent-color: #2563eb;
    --highlight-color: #ffd700;
    --success-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --cta-gradient: linear-gradient(135deg, #1E3A8A 0%, #1d4ed8 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Main Header Integration */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.header-logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.header-nav a:hover {
    color: var(--primary-color);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.2s ease;
}

.header-nav a:hover::after {
    width: 100%;
}

/* Profile Dropdown Container */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.profile-trigger:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background: var(--cta-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.2;
}

.profile-email {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.profile-chevron {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.profile-dropdown.open .profile-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

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

.dropdown-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    background: var(--cta-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
}

.dropdown-user-details h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-user-details p {
    margin: 2px 0 0 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.dropdown-menu-items {
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 16px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.dropdown-item.danger {
    color: #dc2626;
}

.dropdown-item.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-item.danger i {
    color: #dc2626;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
        height: 60px;
    }
    
    .header-nav {
        display: none;
    }
    
    .profile-info {
        display: none;
    }
    
    .profile-trigger {
        padding: 6px 8px;
    }
    
    .dropdown-menu {
        min-width: 260px;
        right: -10px;
    }
    
    .dropdown-header {
        padding: 15px;
    }
    
    .dropdown-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Animation for smooth appearance */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.animate {
    animation: slideDown 0.2s ease-out;
}

/* Hide profile dropdown when not logged in */
.profile-dropdown.hidden {
    display: none;
}

/* Login button for non-logged in users */
.login-button {
    background: var(--cta-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    z-index: 1000; /* Ensure it's above other elements */
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* FORCEFULLY HIDE LOGIN BUTTON WHEN USER IS AUTHENTICATED */
/* This ensures no login button appears when user is logged in */
body.user-authenticated .login-button,
body.user-authenticated .login-btn,
body[data-user-id]:not([data-user-id=""]) .login-button,
body[data-user-id]:not([data-user-id=""]) .login-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Ensure profile dropdown is visible when authenticated */
body.user-authenticated .profile-dropdown,
body[data-user-id]:not([data-user-id=""]) .profile-dropdown {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide profile dropdown when NOT authenticated */
body:not(.user-authenticated):not([data-user-id]) .profile-dropdown,
body[data-user-id=""] .profile-dropdown {
    display: none !important;
}