/* ============================================================
   JR Account Menu — settings-panel style dropdown
   v1.0 · 2026-06-28
   ============================================================ */

.jr-am{
    width: 320px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 10px 30px rgba(15, 23, 42, 0.10),
        0 25px 50px -12px rgba(124, 58, 237, 0.10);
    border: 1px solid rgba(15, 23, 42, 0.06);
    overflow: hidden;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    color: #0f172a;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 60;
}

/* ---------- Header (avatar + name) ---------- */
.jr-am-head{
    position: relative;
    padding: 18px 18px 16px;
    background:
        radial-gradient(circle at 0% 0%, rgba(126, 34, 206, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(219, 39, 119, 0.10) 0%, transparent 55%),
        linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.jr-am-head-row{
    display: flex;
    align-items: center;
    gap: 12px;
}
.jr-am-avatar{
    position: relative;
    flex-shrink: 0;
}
.jr-am-avatar img{
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow:
        0 0 0 2px transparent,
        0 0 0 4px rgba(126, 34, 206, 0.0);
    background: linear-gradient(135deg, #7e22ce, #db2777);
    background-clip: padding-box;
}
.jr-am-avatar::before{
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #7e22ce 0%, #c026d3 50%, #db2777 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}
.jr-am-avatar-dot{
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #ffffff;
}
.jr-am-id{
    min-width: 0;
    flex: 1;
}
.jr-am-name{
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jr-am-email{
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.jr-am-edit{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s ease;
}
.jr-am-edit:hover{
    background: #f8fafc;
    border-color: #7e22ce;
    color: #7e22ce;
}

/* ---------- Scroll body ---------- */
.jr-am-body{
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px 0 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.jr-am-body::-webkit-scrollbar{ width: 6px; }
.jr-am-body::-webkit-scrollbar-thumb{ background: #cbd5e1; border-radius: 3px; }
.jr-am-body::-webkit-scrollbar-track{ background: transparent; }

/* ---------- Sections ---------- */
.jr-am-section{
    padding: 8px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.04);
}
.jr-am-section:first-child{ border-top: none; }
.jr-am-label{
    padding: 4px 18px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

/* ---------- Items ---------- */
.jr-am-item{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    margin: 1px 8px;
    border-radius: 10px;
    text-decoration: none !important;
    color: #0f172a !important;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.15s ease, transform 0.15s ease;
    position: relative;
    cursor: pointer;
}
.jr-am-item:hover{
    background: #f8fafc;
    color: #0f172a !important;
}
.jr-am-item:hover .jr-am-chev{
    opacity: 1;
    transform: translateX(0);
}
.jr-am-item:hover .jr-am-icon{
    transform: scale(1.06);
}

/* Colored icon container (iOS Settings style) */
.jr-am-icon{
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #ffffff;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
}

.jr-am-icon--orange   { background: linear-gradient(135deg, #fb923c, #f97316); }
.jr-am-icon--indigo   { background: linear-gradient(135deg, #818cf8, #6366f1); }
.jr-am-icon--sky      { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.jr-am-icon--emerald  { background: linear-gradient(135deg, #34d399, #10b981); }
.jr-am-icon--pink     { background: linear-gradient(135deg, #f472b6, #ec4899); }
.jr-am-icon--amber    { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.jr-am-icon--rose     { background: linear-gradient(135deg, #fb7185, #f43f5e); }
.jr-am-icon--slate    { background: linear-gradient(135deg, #94a3b8, #64748b); }
.jr-am-icon--teal     { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }
.jr-am-icon--gold     { background: linear-gradient(135deg, #fbbf24, #d97706); }
.jr-am-icon--blue     { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.jr-am-icon--red      { background: linear-gradient(135deg, #f87171, #dc2626); }
.jr-am-icon--violet   { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

.jr-am-label-text{
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chevron hint on hover */
.jr-am-chev{
    color: #cbd5e1;
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Inline badge (counts) */
.jr-am-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px #ffffff;
    margin-left: 4px;
}
.jr-am-badge--zero{
    background: #f1f5f9;
    color: #94a3b8;
    box-shadow: none;
}
.jr-am-pill{
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-left: 4px;
    text-transform: uppercase;
}

/* ---------- Logout footer ---------- */
.jr-am-foot{
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: #fafafa;
}
.jr-am-logout{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: #dc2626 !important;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.15s ease;
}
.jr-am-logout:hover{
    background: #fef2f2;
    border-color: #dc2626;
    color: #b91c1c !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -2px rgba(220, 38, 38, 0.15);
}
.jr-am-logout i{ font-size: 0.85rem; }

/* ---------- Mobile drawer variant (full-width sheet) ---------- */
@media (max-width: 768px){
    .jr-am{
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        border: none;
        position: static;
    }
    .jr-am-body{ max-height: none; }
}

/* RTL */
[dir="rtl"] .jr-am-chev{ transform: translateX(4px) scaleX(-1); }
[dir="rtl"] .jr-am-item:hover .jr-am-chev{ transform: translateX(0) scaleX(-1); }
