/* ==========================================================================
   Nav User Dropdown — WolfK / Arsha Theme
   Overrides Arsha's .navbar a and .navbar ul defaults
   ========================================================================== */

.navbar .nav-user-dropdown {
    list-style-type: none;
}

/* ---- Trigger Button ---- */
/* Reset Arsha's .navbar a { padding: 10px 0 10px 30px; justify-content: space-between } */
.navbar .nav-user-dropdown > a.nav-user-btn,
.navbar .nav-user-dropdown > a.nav-user-btn:focus {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px;
    padding: 6px 12px 6px 8px !important;
    margin-left: 20px;
    border-radius: 50px;
    background: rgba(71, 171, 78, 0.18);
    border: 1.5px solid rgba(71, 228, 117, 0.35);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
    color: #fff !important;
    white-space: nowrap;
    line-height: 1;
}

.navbar .nav-user-dropdown > a.nav-user-btn:hover {
    background: rgba(71, 171, 78, 0.30) !important;
    border-color: rgba(71, 228, 117, 0.6);
    color: #fff !important;
}

/* avatar */
.nav-user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.7);
    flex-shrink: 0;
    display: block;
}

.nav-user-avatar-placeholder {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
}

/* text info — 2 dòng tên + số dư */
.nav-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
}

.nav-user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff !important;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.nav-user-balance {
    font-size: 0.7rem;
    color: #47e475 !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.nav-user-balance i { font-size: 0.7rem; line-height: 1; }

.nav-chevron {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.6);
    transition: transform 0.25s;
    flex-shrink: 0;
    line-height: 1;
    display: block !important;
}

.nav-user-dropdown:hover .nav-chevron {
    transform: rotate(180deg);
}

/* ---- Dropdown Menu ---- */
/* Override Arsha's .navbar ul { display:flex; align-items:center } */
.navbar .nav-user-dropdown ul.nav-user-menu {
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: 100% !important;
    padding-top: 8px !important;
    min-width: 230px;
    background: #fff !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13) !important;
    padding: 6px 0 !important;
    border: 1px solid rgba(0,0,0,0.07) !important;
    z-index: 9999;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: none;
}

.navbar .nav-user-dropdown:hover ul.nav-user-menu {
    display: flex !important;
    animation: dropFade 0.18s ease;
}

@keyframes dropFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Reset Arsha's .navbar a for menu items */
.nav-user-menu li {
    position: static !important;
    width: 100%;
}

.nav-user-menu li a,
.nav-user-menu li a:focus,
.nav-user-menu li button {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px;
    padding: 9px 16px !important;
    font-size: 0.855rem !important;
    font-weight: 500 !important;
    color: #37423d !important;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    width: 100%;
    transition: background 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.nav-user-menu li a i,
.nav-user-menu li button i,
.nav-user-menu li a:focus i {
    font-size: 1rem !important;
    color: #6c757d;
    width: 18px;
    flex-shrink: 0;
    line-height: 1;
    margin-left: 0 !important;
}

.nav-user-menu li a:hover,
.nav-user-menu li button:hover {
    background: #f4fbf5 !important;
    color: #2d8b3d !important;
}

.nav-user-menu li a:hover i,
.nav-user-menu li button:hover i { color: #47ab4e; }

/* logout */
.nav-user-menu li .nav-user-logout,
.nav-user-menu li .nav-user-logout:focus { color: #e53935 !important; }
.nav-user-menu li .nav-user-logout i   { color: #e53935 !important; }
.nav-user-menu li .nav-user-logout:hover {
    background: #fdecea !important;
    color: #c62828 !important;
}

/* divider */
.nav-user-menu-divider {
    height: 1px !important;
    background: #f0f0f0 !important;
    margin: 4px 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* header section */
.nav-user-menu-header {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    padding: 12px 16px !important;
    width: 100%;
}

.menu-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0f0e3;
    flex-shrink: 0;
    display: block;
}

.menu-avatar-placeholder {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #e8f5e9;
    border: 2px solid #c8e6c9;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.15rem;
    color: #2d8b3d;
    flex-shrink: 0;
    line-height: 1;
}

.menu-user-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #37423d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 155px;
    display: block;
}

.menu-user-email {
    font-size: 0.74rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 155px;
    display: block;
}

/* ---- Mobile ---- */
@media (max-width: 991px) {
    .navbar .nav-user-dropdown > a.nav-user-btn,
    .navbar .nav-user-dropdown > a.nav-user-btn:focus {
        margin-left: 0;
        margin-top: 8px;
    }

    .navbar .nav-user-dropdown ul.nav-user-menu {
        position: static !important;
        box-shadow: none !important;
        border: 1px solid #e0f0e3 !important;
        border-radius: 10px !important;
        margin: 6px 0 0 !important;
    }

    .nav-user-name { max-width: 100px; }
}
