﻿.account-dropdown {
    position: relative;
    display: inline-block;
}

.account-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: #222;
}

    .account-trigger .chevron {
        font-size: 14px;
        transition: transform 0.25s ease;
    }

@media (hover: hover) and (pointer: fine) {
    .account-dropdown::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 14px; /* bridge height */
    }

    /* Rotate chevron on hover */
    .account-dropdown:hover .chevron {
        transform: rotate(180deg);
    }

    /* Show on hover */
    .account-dropdown:hover .account-menu {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Dropdown panel */
.account-menu {
    position: absolute;
    top: 36px;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    min-width: 200px;
    padding: 10px 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 1000;
}

/* Callout arrow */
.account-menu .arrow {
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -3px -3px 6px rgba(0,0,0,0.05);
}

/* Menu links */
.account-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
}

    .account-menu a:hover {
        background: #f5f5f5;
    }

.account-menu hr {
    border: none;
    height: 1px;
    background: #eee;
    margin: 6px 0;
}

.account-menu .logout {
    color: #c0392b;
}

/* ---------- Mobile Accordion ---------- */
@media (max-width: 768px) {
    .account-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.3s ease;
    }

    .account-dropdown.open .account-menu {
        max-height: 400px; /* enough for content */
    }

    .account-dropdown.open .chevron {
        transform: rotate(180deg);
    }
}

.menu-link {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}

    .menu-link:hover {
        background: #f5f5f5;
    }

    .menu-link.logout {
        color: #c0392b;
    }
