/**
 * Profile Dropdown Styles
 * Modern dropdown menu for user profile management
 */

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

/* Profile Trigger Button */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.profile-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* Avatar */
.profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
    text-transform: uppercase;
}

.profile-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: white;
    text-transform: uppercase;
    flex-shrink: 0;
}

.profile-trigger .profile-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-trigger .chevron {
    font-size: 10px;
    transition: transform 0.2s ease;
}

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

/* Dropdown Menu */
.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1050;
    overflow: hidden;
}

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

/* Menu Header */
.profile-menu-header {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #eee;
}

.profile-menu-header .profile-info {
    flex: 1;
    min-width: 0;
}

.profile-menu-header .profile-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu-header .profile-email {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu-header .profile-type-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e9ecef;
    color: #666;
    text-transform: uppercase;
    margin-top: 4px;
    display: inline-block;
}

.profile-type-badge.external {
    background: #d4edda;
    color: #155724;
}

.profile-type-badge.internal {
    background: #cce5ff;
    color: #004085;
}

.profile-type-badge.admin {
    background: #f8d7da;
    color: #721c24;
}

/* Menu Divider */
.profile-menu-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

/* Menu Items */
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s ease;
    cursor: pointer;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.profile-menu-item:hover {
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.profile-menu-item:focus {
    outline: none;
    background: #f0f0f0;
}

.profile-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: #666;
}

.profile-menu-item:hover i {
    color: #0d6efd;
}

.profile-menu-item.logout {
    color: #dc3545;
}

.profile-menu-item.logout i {
    color: #dc3545;
}

.profile-menu-item.logout:hover {
    background: #fff5f5;
}

/* Menu Section Label */
.profile-menu-section {
    padding: 8px 16px 4px;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Badge for payment */
.profile-menu-item .badge {
    margin-left: auto;
    font-size: 11px;
}

/* Backdrop for closing menu */
.profile-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: none;
}

.profile-dropdown.open .profile-dropdown-backdrop {
    display: block;
}

/* Animation for menu items */
.profile-menu-item {
    transform: translateX(0);
    transition: transform 0.15s ease, background 0.15s ease;
}

.profile-menu-item:active {
    transform: translateX(2px);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .profile-menu {
        min-width: 260px;
        right: -10px;
    }

    .profile-trigger .profile-name {
        display: none;
    }

    .profile-trigger {
        padding: 6px 8px;
    }
}

/* Dark theme support (optional) */
.navbar-dark .profile-dropdown .profile-trigger {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-dark .profile-dropdown .profile-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
}
