/* ── Tablet Login – Avatar Widget ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

.tl-avatar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: 'Nunito', sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ── Button ── */
.tl-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 2px solid var(--tl-color, #307439);
    border-radius: 50px;
    padding: 5px 10px 5px 5px;
    cursor: pointer;
    transition: box-shadow .18s, transform .15s;
    touch-action: manipulation;
    min-height: 44px;
}
.tl-avatar-btn:hover, .tl-avatar-btn:focus {
    box-shadow: 0 4px 16px rgba(0,0,0,.13);
    outline: none;
    transform: translateY(-1px);
}
.tl-avatar-btn:active { transform: scale(.97); }

.tl-avatar-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.tl-avatar-letter {
    font-size: 16px; font-weight: 900; color: #fff;
    line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.tl-avatar-label {
    display: flex; flex-direction: column; align-items: flex-start;
}
.tl-avatar-team  { font-size: 13px; font-weight: 800; color: #1e293b; line-height: 1.2; }
.tl-avatar-grade { font-size: 11px; font-weight: 600; color: #64748b; line-height: 1.2; }

/* SVG caret — precisely aligned */
.tl-avatar-caret {
    width: 10px; height: 6px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform .2s;
    display: block;
    margin-left: 2px;
    /* optical alignment — sits exactly on the vertical midpoint */
    position: relative;
    top: 1px;
}
.tl-avatar-wrap.open .tl-avatar-caret { transform: rotate(180deg); top: -1px; }

/* ── Popup ── */
.tl-avatar-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 236px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 36px rgba(0,0,0,.16);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(.97);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 99999;
}
.tl-avatar-wrap.open .tl-avatar-popup {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* header */
.tl-popup-header {
    padding: 18px 16px 14px;
    text-align: center; color: #fff;
}
.tl-popup-avatar-big {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 900; color: #fff;
    border: 2.5px solid rgba(255,255,255,.5);
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
    margin: 0 auto 8px;
}
.tl-popup-name { font-size: 16px; font-weight: 800; }
.tl-popup-sub  { font-size: 11.5px; color: rgba(255,255,255,.82); margin-top: 2px; font-weight: 600; }

/* body rows */
.tl-popup-body { padding: 12px 14px 14px; }
.tl-popup-row {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 8px; border-radius: 9px;
    font-size: 13px; font-weight: 700; color: #334155;
    transition: background .14s;
}
.tl-popup-row:hover { background: #f8fafc; }

/* SVG icons in rows */
.tl-popup-icon {
    width: 28px; height: 28px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
}
.tl-popup-icon svg { width: 15px; height: 15px; }
.tl-pi-school { background: #eaf3eb; color: #307439; }
.tl-pi-grade  { background: #fef9ee; color: #d97706; }
.tl-pi-group  { background: #f0f0f0; }
/* group dot inherits --tl-color from parent via style attribute */

/* "Change Team" button */
.tl-switch-btn {
    width: 100%;
    margin-top: 10px;
    background: #307439;
    color: #fff; border: none; border-radius: 10px;
    padding: 11px 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 13px; font-weight: 800;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .16s;
    touch-action: manipulation; min-height: 42px;
    box-shadow: 0 3px 10px rgba(48,116,57,.28);
}
.tl-switch-btn:hover { background: #245a2c; transform: translateY(-1px); box-shadow: 0 5px 16px rgba(48,116,57,.36); }
.tl-switch-btn:active { transform: scale(.97); }

/* ── Login button (logged-out state) ── */
.tl-avatar-login-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: #307439; color: #fff !important;
    border-radius: 50px; padding: 9px 18px 9px 14px;
    text-decoration: none !important;
    font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800;
    transition: all .16s; min-height: 42px; touch-action: manipulation;
    box-shadow: 0 3px 10px rgba(48,116,57,.28);
}
.tl-avatar-login-btn:hover { background: #245a2c; transform: translateY(-1px); box-shadow: 0 5px 16px rgba(48,116,57,.36); }

/* ── Mobile: slide up from bottom ── */
@media (max-width: 480px) {
    .tl-avatar-popup {
        position: fixed;
        bottom: 0; left: 0; right: 0; top: auto;
        width: 100%; border-radius: 20px 20px 0 0;
        transform: translateY(16px);
    }
    .tl-avatar-wrap.open .tl-avatar-popup { transform: translateY(0); }
    .tl-avatar-wrap.open::before {
        content: ''; position: fixed; inset: 0;
        background: rgba(0,0,0,.32); z-index: 99998;
        backdrop-filter: blur(2px);
    }
    .tl-avatar-popup { z-index: 99999; }
}
