﻿/* =========================================================
   User Dropdown
   ========================================================= */

/* ── Trigger button (inner div[data-toggle]) ── */
#userDropdown [data-toggle="dropdown"] {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease;
}

    #userDropdown [data-toggle="dropdown"]:hover,
    #userDropdown.show [data-toggle="dropdown"] {
        background: rgba(0, 0, 0, 0.07);
    }

#userDropdown .user-icon {
    font-size: 1.15rem;
    color: #5a6a7e;
    transition: color 0.18s ease;
}

#userDropdown [data-toggle="dropdown"]:hover .user-icon {
    color: #2563eb;
}

/* ── Dropdown panel ── */
#userDropdown .dropdown-menu {
    min-width: 210px;
    padding: 6px !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.13), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    background: #fff !important;
    transform-origin: top right;
    animation: userDrop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes userDrop {
    from {
        opacity: 0;
        transform: scale(0.93) translateY(-6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── User identity block ── */
.user-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 10px;
}

.user-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8edf5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a6a7e;
    font-size: 14px;
}

.user-fullname {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Divider ── */
.user-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.07);
    margin: 4px 0;
    border: none;
}

/* ── Menu items ── */
#userDropdown .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px !important;
    border-radius: 8px !important;
    font-size: 13px;
    font-weight: 500;
    color: #1a202c !important;
    text-decoration: none !important;
    transition: background 0.13s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.04);
}

    #userDropdown .dropdown-menu .dropdown-item:hover,
    #userDropdown .dropdown-menu .dropdown-item:active {
        background: #f5f7fb !important;
        color: #1a202c !important;
    }

    #userDropdown .dropdown-menu .dropdown-item .item-icon {
        flex-shrink: 0;
        width: 16px;
        text-align: center;
        color: #8492a6;
        font-size: 13px;
    }

    /* ── Logout item ── */
    #userDropdown .dropdown-menu .dropdown-item[logout-btn] .item-icon {
        color: #e8394b;
    }

    #userDropdown .dropdown-menu .dropdown-item[logout-btn]:hover {
        background: #fde8ea !important;
        color: #e8394b !important;
    }

        #userDropdown .dropdown-menu .dropdown-item[logout-btn]:hover .item-icon {
            color: #e8394b;
        }

/* ── Mobile: full-width bottom sheet (up to 480px) ── */
@media (max-width: 480px) {
    #userDropdown .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        min-width: 100vw;
        max-width: 100vw;
        padding-top: 2rem!important;
        border-radius: 18px 18px 0 0 !important;
        animation: userSlideUp 0.22s cubic-bezier(0.34, 1.4, 0.64, 1) both;
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    }

        /* Drag handle */
        #userDropdown .dropdown-menu::before {
            content: '';
            display: block;
            position: absolute;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
            width: 36px;
            height: 4px;
            border-radius: 2px;
            background: rgba(0, 0, 0, 0.12);
        }

    @keyframes userSlideUp {
        from {
            opacity: 0;
            transform: translateY(24px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .user-identity {
        position: relative;
        padding-top: 22px;
    }

    #userDropdown .dropdown-menu .dropdown-item {
        min-height: 48px;
        padding: 10px !important;
    }
}
