/* ============================================================================
   athlete/css/athlete-switcher.css — canonical CSS for the header dropdown
   that lets a parent switch the active kid + team. Owns BOTH the trigger
   button (.athlete-switcher) AND the dropdown menu rows (.am-*).

   Cascade contract: loaded AFTER shared.css / dark.css / page.css on every
   page that hosts the switcher (index, profile, messages, schedule, settings).
   Loading position alone guarantees this stylesheet wins — NO !important
   required. Previous version of these styles lived in athlete-switcher.js's
   injectAthleteSwitcherCss() and used 30+ !important declarations to fight
   per-page drift; killing the JS injection + leveraging cascade order is the
   enterprise fix.

   What lives here:
     - .athlete-switcher trigger button (pill shape, team-color eyebrow, tap)
     - .athlete-switcher-* internals (dot, meta, name, sub, caret)
     - .am-* dropdown rows (logo, info, team name, athlete name, jersey, check)
     - .am-add / .am-divider / .am-header chrome inside the dropdown

   What does NOT live here:
     - The HTML scaffold (built by athlete/modules/app-header.js)
     - Dropdown OPEN/positioning behavior (handled in JS — sets inline styles
       on .athlete-menu when the user taps the trigger)
     - Dark-mode overrides (TODO: tokenize hardcoded colors below + add
       html[data-theme="dark"] block in a follow-up)
   ========================================================================== */

/* ─── Trigger button: neutral pill + team-color accent eyebrow ────────────── */

.athlete-switcher {
    /* Geometry was previously duplicated in 5 page CSS files (now stripped).
       Owning it here means the pill renders correctly on every page. */
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 5px;
    border-radius: 999px;
    cursor: pointer;
    min-width: 0;
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding-top: 8px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.athlete-switcher:hover {
    background: var(--bg);
    border-color: var(--border-strong);
    filter: none;
}
.athlete-switcher:active {
    transform: scale(0.97);
}
.athlete-switcher::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--team-primary, #1d4ed8), var(--team-secondary, #f59e0b));
    pointer-events: none;
}

/* Avatar circle inside the trigger — solid team gradient with white initials. */
.athlete-switcher-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--team-primary, #1d4ed8), var(--team-secondary, #f59e0b));
    color: #ffffff;
    font-family: 'Saira Condensed', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10);
}
.athlete-switcher-dot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.athlete-switcher-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.05;
    min-width: 0;
}

.athlete-switcher-name {
    font-family: "Saira Condensed", sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1.05;
    text-shadow: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 108px;
}
.athlete-switcher-sub {
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ink-muted);
    text-transform: none;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 108px;
}
.athlete-switcher-caret {
    color: var(--ink-faint);
    margin-left: -2px;
    flex-shrink: 0;
}
.athlete-switcher-caret svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.4;
}

/* ─── Dropdown menu chrome ────────────────────────────────────────────────── */
/* Positioning lives in athlete/css/theme.css (.athlete-menu — top, left, max-width,
   open/closed visibility). Visual chrome below was previously duplicated in each
   page CSS file; now lives here as the single source of truth. */
.athlete-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
    padding: 6px;
}

/* ─── Dropdown rows ───────────────────────────────────────────────────────── */

.am-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.am-row:hover {
    background: #f4f4f5;
}
.am-row.active {
    background: color-mix(in srgb, var(--team-primary, #1d4ed8) 8%, transparent);
}

/* Team logo container. Active row gets a team-colored ring instead of the
   neutral border so the selected athlete reads at a glance. */
.am-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.am-row.active .am-logo {
    box-shadow: 0 0 0 2px var(--team-primary, #1d4ed8);
    border-color: transparent;
}
.am-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.am-logo-fallback {
    font-family: "Saira Condensed", sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.am-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Team name = Saira Condensed, uppercase, brand treatment. */
.am-team {
    font-family: "Saira Condensed", sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Athlete name = Manrope, regular case, secondary. */
.am-athlete {
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-muted);
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.am-jersey {
    font-family: "Saira Condensed", sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: var(--team-primary, #1d4ed8);
    padding: 4px 10px;
    border-radius: 999px;
    flex-shrink: 0;
    min-width: 46px;
    text-align: center;
}
.am-row.active .am-jersey {
    background: var(--team-primary, #1d4ed8);
}

.am-check {
    color: var(--team-primary, #1d4ed8);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.am-row.active .am-check {
    opacity: 1;
}
.am-check svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* ─── Dropdown chrome (add-athlete CTA, divider, header) ──────────────────── */

.am-add {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--ink-muted);
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    transition: background 0.15s ease;
}
.am-add:hover {
    background: #f4f4f5;          /* Slightly grayer than --bg; no exact token match yet. */
    color: var(--ink);
}
.am-add svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.am-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 8px;
}

.am-header {
    font-family: "Saira Condensed", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding: 10px 14px 6px;
}
