/**
 * Profile Button Styles - Navigation Menu Integration
 */

.menu-item-profile,
.profile-dropdown-container {
    position: relative;
}

.profile-dropdown {
    position: relative;
    display: inline-block;
}

/* Mobile layout: Profile button to the right of menu button */
.dropdown.dropdown-end.ml-2 {
    margin-left: 0.5rem;
}

/* Base profile button styles */
.profile-btn,
.profile-button {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.profile-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}

.profile-name {
    color: inherit;
}

.profile-dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: rgb(55, 65, 81);
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 10000;
    border: 1px solid #545e6c;
    overflow: hidden;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.profile-dropdown-content.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* When using style.display in JavaScript */
.profile-dropdown-content[style*="block"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-item {
    color: #00cab6 !important;
    padding: 12px 12px 4px 4px;
    display: block;
    transition: background-color 0.2s ease;
    font-size: 14px;
    font-weight: 400;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    border-radius: 8px;
}

.profile-dropdown-item:hover {
    background-color: #f8f9fa;
    color: #00cab6 !important;
    text-decoration: none;
}

.profile-dropdown-item.logout {
    color: #dc2626;
}

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

/* Integration with existing menu styles */
.menu-item-profile .profile-btn,
.profile-dropdown-container .profile-button {
    /* Inherit menu item styling */
    font-size: inherit;
    color: inherit;
    padding: inherit;
}

/* Desktop navigation menu integration */
.profile-dropdown-container {
    position: relative;
}

/* Ensure desktop profile button matches menu styling */
#primary-menu .profile-dropdown-container .profile-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    vertical-align: baseline;
    line-height: 1.5;
    height: auto;
}

#primary-menu .profile-dropdown-container {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* Desktop menu specific styles */
#primary-menu .menu-item-profile,
#primary-menu .profile-dropdown-container,
#site-navigation .menu-item-profile,
#site-navigation .profile-dropdown-container,
.main-navigation .menu-item-profile,
.main-navigation .profile-dropdown-container {
    display: inline-block;
    position: relative;
    vertical-align: top;
}

#primary-menu .profile-btn,
#primary-menu .profile-button,
#site-navigation .profile-btn,
#site-navigation .profile-button,
.main-navigation .profile-btn,
.main-navigation .profile-button {
    display: inline-flex;
    align-items: center;
    vertical-align: baseline;
    line-height: 1.5;
}

/* Ensure desktop dropdown positioning */
#primary-menu .profile-dropdown-content,
#site-navigation .profile-dropdown-content,
.main-navigation .profile-dropdown-content {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
}

/* Mobile menu specific styles */
.dropdown-content .menu-item-profile,
.menu-sm .menu-item-profile {
    width: 100%;
}

.dropdown-content .profile-btn,
.menu-sm .profile-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
}

.dropdown-content .profile-dropdown-content,
.menu-sm .profile-dropdown-content {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin-left: 16px;
    margin-top: 8px;
}

.dropdown-content .profile-dropdown-content.show,
.menu-sm .profile-dropdown-content.show {
    display: block;
}

.dropdown-content .profile-dropdown-content:not(.show),
.menu-sm .profile-dropdown-content:not(.show) {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-dropdown-content {
        right: -10px;
        min-width: 160px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .profile-dropdown-content {
        background: #374151;
        border-color: #4b5563;
    }
    
    .profile-dropdown-item {
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .profile-dropdown-item:hover {
        background: #4b5563;
        color: #ffffff;
    }
    
    .profile-dropdown-item.logout:hover {
        background: rgba(220, 38, 38, 0.2);
    }
} 

/* Mobile profile button positioning - to the right of menu button */
.dropdown.dropdown-end.ml-2 {
    margin-left: 0.5rem;
}

/* Ensure profile dropdown items have proper styling */
.profile-dropdown-item {
    display: block;
    padding: 4px 12px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.profile-dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.profile-dropdown-item.logout:hover {
    background-color: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    /* Ensure mobile dropdowns work with the theme's layout */
    .dropdown.dropdown-end.ml-2 .menu {
        right: 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .profile-dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .profile-dropdown-item.logout:hover {
        background-color: rgba(220, 38, 38, 0.2);
    }
} 