/* ===========================================================
   PureFit GYM – עיצוב בסיסי (עברית, מימין לשמאל, Mobile First)
   =========================================================== */

:root {
    --bg: #0B1220;
    --bg-soft: #111A2E;
    --card: #16213A;
    --card-border: #24314F;
    --text: #F1F5FB;
    --text-dim: #9AA8C2;
    --primary: #3B82F6;
    --primary-strong: #2563EB;
    --accent: #FF6B2C;
    --success: #22C55E;
    --danger: #EF4444;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --font: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 800; }
p { margin: 0 0 1rem; }
h1:focus { outline: none; }

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- כפתורים ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 48px;
    padding: 0 1.25rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform .08s ease, background-color .2s ease, opacity .2s ease;
    user-select: none;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary-strong); color: #fff; }
.btn-primary:hover { background: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--card-border); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.1rem; padding: 0 1.75rem; }

/* ---------- כרטיסים ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.badge {
    display: inline-block;
    padding: .2rem .7rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    background: rgba(255, 107, 44, .15);
    color: var(--accent);
}

.muted { color: var(--text-dim); }

/* ---------- מסך טעינה (לפני ש-Blazor עולה) ---------- */
.boot {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--bg);
}
.boot-logo { width: 88px; height: 88px; border-radius: 22px; }
.boot-title { font-size: 1.5rem; font-weight: 900; letter-spacing: .5px; }
.boot-text { color: var(--text-dim); font-size: .9rem; }
.boot-text::after { content: " " var(--blazor-load-percentage-text, ""); }
.boot-bar { width: 160px; height: 6px; border-radius: 99px; background: var(--card); overflow: hidden; }
.boot-bar span {
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .1s ease;
}

/* ---------- שגיאות Blazor ---------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1000;
    padding: .8rem 1.25rem calc(.8rem + var(--safe-bottom));
    background: #7F1D1D;
    color: #fff;
    font-weight: 500;
}
#blazor-error-ui .reload { color: #FFE4D6; font-weight: 700; margin-inline-start: .75rem; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; left: 1rem; top: .7rem; }

.blazor-error-boundary {
    background: #7F1D1D;
    color: #fff;
    padding: 1rem;
    border-radius: var(--radius-sm);
}
.blazor-error-boundary::after { content: "אירעה שגיאה בחלק זה של המסך."; }


/* ===========================================================
   נגישות (0.9.0) – תקן ישראלי 5568 / WCAG 2.1 AA / EN 301 549
   =========================================================== */
.skip-link {
    position: absolute; inset-inline-start: 12px; top: -60px; z-index: 1000;
    background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid #FFD54A; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

html.a11y-text-1 { font-size: 18px; }
html.a11y-text-2 { font-size: 20px; }
html.a11y-text-3 { font-size: 22px; }
html.a11y-contrast {
    --bg: #000; --bg-soft: #000; --card: #0A0A0A; --card-border: #FFFFFF;
    --text: #FFFFFF; --text-dim: #E6E6E6; --primary: #66B3FF; --primary-strong: #66B3FF; --accent: #FFB020;
}
html.a11y-contrast .muted, html.a11y-contrast small { color: #E6E6E6 !important; }
html.a11y-contrast img, html.a11y-contrast svg { filter: none; }
html.a11y-links a, html.a11y-links .link { text-decoration: underline !important; text-underline-offset: 3px; outline: 1px dashed currentColor; outline-offset: 2px; }
html.a11y-font, html.a11y-font body { --font: Arial, "Segoe UI", system-ui, sans-serif; letter-spacing: .02em; word-spacing: .08em; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.sep { border: 0; border-top: 1px solid var(--card-border); margin: 4px 0; width: 100%; }

/* ---------- מצב כיס (1.8.7): מסך שחור, הקשה כפולה לחזרה ---------- */
.pocket {
    position: fixed; inset: 0; z-index: 10000; background: #000; color: #555;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
    padding: 24px 16px; text-align: center; touch-action: manipulation; user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.pocket-info { display: flex; flex-direction: column; gap: .4rem; font-size: 1.1rem; }
.pocket-time { font-size: 3.2rem; font-weight: 700; color: #6a6a6a; font-variant-numeric: tabular-nums; }
.pocket-mic { font-size: .9rem; color: #444; }
.pocket-exit { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); font-size: .85rem; color: #3a3a3a; }

/* ---------- השירים שלי (1.8.9) ---------- */
.song-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.song { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--card-border); border-radius: 10px; }
.song.cur { border-color: var(--accent); }
.song-name { flex: 1; min-width: 0; text-align: start; background: none; border: 0; color: inherit; font: inherit; padding: 4px 0; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-name span { display: inline-block; min-width: 1.6em; color: var(--text-dim); }
.song-act { display: flex; gap: 2px; flex-shrink: 0; }
.song-act .btn-icon { width: 34px; height: 34px; padding: 0; font-size: .95rem; }
.danger-text { color: var(--danger); }
