/* ========================================
 * Account Dropdown Styles
 * 호주로열트립 계정 드롭다운 메뉴 시스템
 * ======================================== */

/* Account Dropdown Container */
.header-navbar__end .header-menu-logged-in {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Account Menu Items */
.header-menu-logged-in li {
    list-style: none;
    position: relative;
    margin: 0;
}

/* Account Button/Link */
.header-menu-logged-in > li > a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.header-menu-logged-in > li > a:hover,
.header-menu-logged-in > li > a:focus {
    color: var(--primary-color);
    background-color: rgba(78, 205, 196, 0.1);
}

/* Dropdown Arrow */
.header-menu-logged-in > li > a::after {
    content: '\f078'; /* FontAwesome down arrow */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    transition: transform 0.3s ease;
    font-size: 12px;
}

.header-menu-logged-in > li:hover > a::after,
.header-menu-logged-in > li.focus > a::after {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.header-menu-logged-in .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--dropdown-bg, #ffffff);
    border-radius: 12px;
    box-shadow: var(--shadow-dropdown, 0 4px 20px rgba(0, 0, 0, 0.1));
    border: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    margin: 0;
    padding: 8px 0;
}

/* Show dropdown on hover/focus */
.header-menu-logged-in > li:hover .sub-menu,
.header-menu-logged-in > li.focus .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Menu Items */
.header-menu-logged-in .sub-menu li {
    margin: 0;
    padding: 0;
}

.header-menu-logged-in .sub-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s ease;
    border: none;
    background: none;
}

.header-menu-logged-in .sub-menu a:hover,
.header-menu-logged-in .sub-menu a:focus {
    background-color: rgba(78, 205, 196, 0.08);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Menu Item Icons (if using FontAwesome) */
.header-menu-logged-in .sub-menu a[href*="dashboard"]::before {
    content: '\f3c5';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    width: 16px;
    display: inline-block;
}

.header-menu-logged-in .sub-menu a[href*="profile"]::before {
    content: '\f2c0';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    width: 16px;
    display: inline-block;
}

.header-menu-logged-in .sub-menu a[href*="messages"]::before {
    content: '\f4ad';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    width: 16px;
    display: inline-block;
}

.header-menu-logged-in .sub-menu a[href*="settings"]::before {
    content: '\f013';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    width: 16px;
    display: inline-block;
}

.header-menu-logged-in .sub-menu a[href*="logout"]::before {
    content: '\f2f5';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    width: 16px;
    display: inline-block;
}

/* Logout Item Special Styling */
.header-menu-logged-in .sub-menu a[href*="logout"] {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 8px;
    padding-top: 16px;
    color: #dc3545;
}

.header-menu-logged-in .sub-menu a[href*="logout"]:hover {
    background-color: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    /* Mobile dropdown positioning */
    .header-menu-logged-in .sub-menu {
        right: -10px;
        left: auto;
        min-width: 180px;
        margin-top: 5px;
    }
    
    /* Larger touch targets for mobile */
    .header-menu-logged-in .sub-menu a {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    /* Account button mobile adjustments */
    .header-menu-logged-in > li > a {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .header-menu-logged-in .sub-menu {
        position: fixed;
        right: 10px;
        left: 10px;
        width: auto;
        min-width: auto;
        max-width: calc(100vw - 20px);
    }
}

/* Accessibility Improvements */
.header-menu-logged-in > li > a:focus,
.header-menu-logged-in .sub-menu a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Keyboard Navigation Support */
.header-menu-logged-in > li.focus .sub-menu,
.header-menu-logged-in > li:focus-within .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .header-menu-logged-in .sub-menu {
        border: 2px solid;
        box-shadow: none;
    }
    
    .header-menu-logged-in .sub-menu a:hover {
        background-color: transparent;
        text-decoration: underline;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .header-menu-logged-in > li > a::after,
    .header-menu-logged-in .sub-menu,
    .header-menu-logged-in .sub-menu a {
        transition: none;
    }
}

/* Brand Color Integration */
.header-menu-logged-in {
    --account-primary: var(--primary-color, #4ECDC4);
    --account-hover: rgba(78, 205, 196, 0.1);
    --account-shadow: var(--shadow-dropdown, 0 4px 20px rgba(0, 0, 0, 0.1));
}

/* Animation for dropdown appearance */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-menu-logged-in > li:hover .sub-menu,
.header-menu-logged-in > li.focus .sub-menu {
    animation: dropdownFadeIn 0.3s ease forwards;
}