/* =========================================================================
   User Badge — Header avatar+name capsule (trainee / instructor / marketer)
   Loaded after modern-ui.css to take precedence over .greenBg.
   ========================================================================= */

/* Reset legacy greenBg whenever the new .user-badge structure is present */
.menu-cnt a.greenBg.user-badge,
a.greenBg.user-badge,
.user-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 10px !important;
    background: linear-gradient(135deg, var(--mu-navy-800), var(--mu-navy-700)) !important;
    color: #fff !important;
    padding: 6px 14px 6px 6px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.10);
    font-weight: 600;
    font-size: 14px !important;
    line-height: 1;
    text-decoration: none !important;
    transition: all .25s var(--mu-ease, cubic-bezier(.2,.7,.2,1));
    box-shadow: 0 6px 16px rgba(15, 26, 58, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}
.user-badge::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 164, 55, 0.0), rgba(212, 164, 55, 0.18));
    opacity: 0;
    transition: opacity .25s var(--mu-ease, cubic-bezier(.2,.7,.2,1));
    pointer-events: none;
}
.user-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 26, 58, 0.28), inset 0 0 0 1px rgba(232, 185, 74, 0.30);
    border-color: rgba(232, 185, 74, 0.35);
    color: #fff !important;
}
.user-badge:hover::before { opacity: 1; }
.user-badge:hover .user-badge-chevron {
    transform: translateY(2px);
    color: var(--mu-gold-300, #f9dd96) !important;
}

/* Avatar circle */
.user-badge .user-badge-avatar {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--mu-gold-500, #e8b94a), var(--mu-gold-700, #b88a1a));
    padding: 2px;
    box-shadow: 0 4px 12px rgba(212, 164, 55, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.user-badge .user-badge-avatar img,
.user-badge .user-badge-initial {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--mu-navy-900, #23386a);
    color: var(--mu-gold-300, #f9dd96);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif;
    line-height: 1;
}
/* Online dot */
.user-badge .user-badge-avatar::after {
    content: "";
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--mu-navy-800, #2a4477);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* Name + greeting stack */
.user-badge .user-badge-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    gap: 2px;
    min-width: 0;
}
.user-badge .user-badge-greeting {
    font-size: 10px !important;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--mu-gold-300, #f9dd96) !important;
    text-transform: none;
    line-height: 1;
}
.user-badge .user-badge-name {
    font-size: 13.5px !important;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1.1;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Chevron */
.user-badge .user-badge-chevron {
    color: rgba(255, 255, 255, 0.65) !important;
    font-size: 12px !important;
    transition: all .25s var(--mu-ease, cubic-bezier(.2,.7,.2,1));
    margin-right: 2px;
    flex-shrink: 0;
}

/* When the dropdown parent <li> is open */
.dropdown:hover > .user-badge .user-badge-chevron,
.dropdown.open > .user-badge .user-badge-chevron {
    transform: rotate(180deg);
    color: var(--mu-gold-300, #f9dd96) !important;
}

/* Hide the legacy <a class="greenBg"> green default if no user-badge structure */
.menu-cnt a.greenBg:not(.user-badge) {
    background: var(--mu-grad-gold) !important;
    color: var(--mu-navy-900) !important;
    padding: 8px 16px !important;
    border-radius: 999px !important;
    font-weight: 700;
}

/* Improve dropdown menu items (icon + label) */
#main-menu .dropdown > ul li a i,
.menu-cnt .dropdown > ul li a i {
    color: var(--mu-gold-700, #945c17) !important;
    width: 22px;
    text-align: center;
    margin-left: 6px;
    font-size: 13px;
    transition: transform .2s var(--mu-ease, cubic-bezier(.2,.7,.2,1));
}
#main-menu .dropdown > ul li a:hover i,
.menu-cnt .dropdown > ul li a:hover i {
    transform: translateX(-2px);
    color: var(--mu-navy-700, #34548c) !important;
}
/* Highlight logout in red */
#main-menu .dropdown > ul li a[onclick*="logout-form"],
.menu-cnt .dropdown > ul li a[onclick*="logout-form"] {
    color: #b91c1c !important;
    font-weight: 600 !important;
}
#main-menu .dropdown > ul li a[onclick*="logout-form"] i,
.menu-cnt .dropdown > ul li a[onclick*="logout-form"] i {
    color: #ef4444 !important;
}
#main-menu .dropdown > ul li a[onclick*="logout-form"]:hover,
.menu-cnt .dropdown > ul li a[onclick*="logout-form"]:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #991b1b !important;
}

/* Mobile compact mode */
@media (max-width: 991.98px) {
    .user-badge {
        padding: 4px 10px 4px 4px !important;
        gap: 8px !important;
    }
    .user-badge .user-badge-avatar { width: 30px; height: 30px; }
    .user-badge .user-badge-greeting { display: none; }
    .user-badge .user-badge-name { font-size: 13px !important; max-width: 80px; }
}
@media (max-width: 575.98px) {
    .user-badge .user-badge-name { max-width: 60px; }
}
