/**
 * User Menu Dropdown Styles
 * Ported from Genz theme for consistent styling
 * @package CustomAuth
 */

/* Override header-right text-end inheritance */
.header-right .custom-auth-menu,
.custom-auth-menu {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    text-align: left;
}

.header-right .custom-auth-menu *,
.custom-auth-menu * {
    text-align: left;
    direction: ltr;
}

/* Trigger button (compact style for header-right) */
.header-right .custom-auth-menu .custom-auth-menu-trigger,
.custom-auth-menu .custom-auth-menu-trigger {
    font-family: 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    text-decoration: none;
    background: transparent;
    border: none;
    color: #D8E6FB;
    cursor: pointer;
    transition: color 0.2s;
    border-radius: 6px;
    position: relative;
    z-index: 1001;
}

.header-right .custom-auth-menu .custom-auth-menu-trigger:hover,
.header-right .custom-auth-menu .custom-auth-menu-trigger[aria-expanded="true"],
.custom-auth-menu .custom-auth-menu-trigger:hover,
.custom-auth-menu .custom-auth-menu-trigger[aria-expanded="true"] {
    color: #1CC2E7;
    background-color: rgba(34, 47, 67, 0.5);
}

.header-right .custom-auth-menu .custom-auth-menu-trigger:hover .user-avatar,
.header-right .custom-auth-menu .custom-auth-menu-trigger[aria-expanded="true"] .user-avatar,
.custom-auth-menu .custom-auth-menu-trigger:hover .user-avatar,
.custom-auth-menu .custom-auth-menu-trigger[aria-expanded="true"] .user-avatar {
    border-color: rgba(14, 165, 234, 0.6);
    box-shadow: 0 0 8px rgba(14, 165, 234, 0.3);
}

.header-right .custom-auth-menu .custom-auth-menu-trigger:hover .dropdown-icon,
.header-right .custom-auth-menu .custom-auth-menu-trigger[aria-expanded="true"] .dropdown-icon,
.custom-auth-menu .custom-auth-menu-trigger:hover .dropdown-icon,
.custom-auth-menu .custom-auth-menu-trigger[aria-expanded="true"] .dropdown-icon {
    opacity: 1;
    transform: rotate(180deg);
}

.header-right .custom-auth-menu .custom-auth-menu-trigger .user-icon,
.custom-auth-menu .custom-auth-menu-trigger .user-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    pointer-events: none;
}

.header-right .custom-auth-menu .custom-auth-menu-trigger .user-avatar,
.custom-auth-menu .custom-auth-menu-trigger .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(14, 165, 234, 0.3);
    transition: all 0.2s ease;
    pointer-events: none;
}

.header-right .custom-auth-menu .custom-auth-menu-trigger .user-name,
.custom-auth-menu .custom-auth-menu-trigger .user-name {
    font-size: 14px;
    color: inherit;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.header-right .custom-auth-menu .custom-auth-menu-trigger .menu-text,
.custom-auth-menu .custom-auth-menu-trigger .menu-text {
    font-size: 14px;
    color: inherit;
    pointer-events: none;
}

.header-right .custom-auth-menu .custom-auth-menu-trigger .dropdown-icon,
.custom-auth-menu .custom-auth-menu-trigger .dropdown-icon {
    width: 12px;
    height: 8px;
    opacity: 0.6;
    transition: all 0.2s;
    pointer-events: none;
}

/* Dropdown container (positioned from header-right) */
.header-right .custom-auth-menu .custom-auth-dropdown,
.custom-auth-menu .custom-auth-dropdown {
    opacity: 0;
    visibility: hidden;
    transition-duration: 0.2s;
    position: absolute;
    top: calc(100% + 15px);
    right: -10px;
    z-index: 999999;
    min-width: 300px;
    max-width: 320px;
    border-radius: 8px;
    padding: 0;
    background: #131C31;
    border: 1px solid #222F43;
    box-shadow: 0px 23.1405px 69.4215px rgba(0, 0, 0, 0.12);
}

.header-right .custom-auth-menu .custom-auth-dropdown[aria-hidden="false"],
.custom-auth-menu .custom-auth-dropdown[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

/* Dropdown header (logged-in users) */
.header-right .custom-auth-menu .dropdown-header,
.custom-auth-menu .dropdown-header {
    padding: 20px;
    border-bottom: 1px solid #222F43;
}

.header-right .custom-auth-menu .dropdown-header strong,
.custom-auth-menu .dropdown-header strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #D8E6FB;
    margin-bottom: 4px;
}

.header-right .custom-auth-menu .dropdown-header .user-email,
.custom-auth-menu .dropdown-header .user-email {
    display: block;
    font-size: 13px;
    color: #94A9C9;
}

/* Dropdown actions/links */
.header-right .custom-auth-menu .dropdown-actions,
.custom-auth-menu .dropdown-actions {
    padding: 8px 0;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link,
.custom-auth-menu .dropdown-actions .dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    color: #B8CDEB;
    text-decoration: none;
    transition: all 0.2s;
    text-align: left;
    position: relative;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link svg,
.custom-auth-menu .dropdown-actions .dropdown-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link:hover,
.custom-auth-menu .dropdown-actions .dropdown-link:hover {
    background-color: rgba(34, 47, 67, 0.5);
    color: #1CC2E7;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link:hover svg,
.custom-auth-menu .dropdown-actions .dropdown-link:hover svg {
    opacity: 1;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link.logout,
.custom-auth-menu .dropdown-actions .dropdown-link.logout {
    color: #FF756C;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link.logout:hover,
.custom-auth-menu .dropdown-actions .dropdown-link.logout:hover {
    color: #ff9892;
}

/* Admin links */
.header-right .custom-auth-menu .dropdown-actions .dropdown-link.admin-link,
.custom-auth-menu .dropdown-actions .dropdown-link.admin-link {
    color: #B8CDEB;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link.admin-link svg,
.custom-auth-menu .dropdown-actions .dropdown-link.admin-link svg {
    color: #B8CDEB;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link.admin-link:hover,
.custom-auth-menu .dropdown-actions .dropdown-link.admin-link:hover {
    background-color: rgba(34, 113, 177, 0.1);
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link.login-link,
.header-right .custom-auth-menu .dropdown-actions .dropdown-link.register-link,
.custom-auth-menu .dropdown-actions .dropdown-link.login-link,
.custom-auth-menu .dropdown-actions .dropdown-link.register-link {
    font-weight: 500;
}

.header-right .custom-auth-menu .dropdown-actions .dropdown-link.forgot-link,
.custom-auth-menu .dropdown-actions .dropdown-link.forgot-link {
    font-size: 13px;
    color: #94A9C9;
    padding-top: 8px;
    border-top: 1px solid #222F43;
    margin-top: 4px;
}

/* Count badge for favorites link */
.header-right .custom-auth-menu .dropdown-actions .dropdown-link .count-badge,
.custom-auth-menu .dropdown-actions .dropdown-link .count-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background-color: #1CC2E7;
    color: #0F172A;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

/* Dropdown divider */
.header-right .custom-auth-menu .dropdown-divider,
.custom-auth-menu .dropdown-divider {
    height: 1px;
    background: #222F43;
    margin: 8px 0;
}

/* Dropdown section title */
.header-right .custom-auth-menu .dropdown-section-title,
.custom-auth-menu .dropdown-section-title {
    padding: 12px 20px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #94A9C9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Logged out state */
.custom-auth-menu.logged-out .custom-auth-dropdown {
    min-width: 220px;
}

/* Hover state for whole component */
.custom-auth-menu:hover .custom-auth-dropdown {
    opacity: 1;
    visibility: visible;
}

/* JavaScript active state */
.custom-auth-menu-trigger[aria-expanded="true"]+.custom-auth-dropdown {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .custom-auth-menu .custom-auth-menu-trigger {
        padding: 6px 10px;
        gap: 4px;
    }

    .custom-auth-menu .custom-auth-menu-trigger .user-name,
    .custom-auth-menu .custom-auth-menu-trigger .menu-text {
        display: none;
    }

    .custom-auth-menu .custom-auth-dropdown {
        right: -30px;
        min-width: 280px;
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    .custom-auth-menu .custom-auth-dropdown {
        right: -40px;
        left: auto;
        min-width: 260px;
    }
}