/* מצגות פרומותאוס — שפת העיצוב של Myday (טוקנים לבהיר וכהה, RTL, Rubik) */

:root {
  --bg-page: #F1F5F9; --bg-card: #FFFFFF; --bg-sunken: #F8FAFC; --bg-hover: #F1F5F9;
  --border: #E2E8F0; --border-strong: #CBD5E1;
  --text: #0F172A; --text-secondary: #475569; --text-muted: #94A3B8;
  --accent: #4F46E5; --accent-tint: #EEF2FF; --accent-grad: linear-gradient(135deg, #6366F1, #8B5CF6);
  --success: #059669; --success-bg: #ECFDF5;
  --warning: #B45309; --warning-bg: #FFFBEB;
  --danger: #DC2626;  --danger-bg: #FEF2F2;
  --radius-control: 6px; --radius-field: 8px; --radius-card: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 12px -4px rgba(15, 23, 42, .12);
  --shadow-pop: 0 12px 32px -8px rgba(15, 23, 42, .28);
  --h-control: 32px; --h-field: 36px;
  --font: "Rubik", "Heebo", "Assistant", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg-page: #202124; --bg-card: #2D2E31; --bg-sunken: #26272A; --bg-hover: #35373A;
  --border: #3C4043; --border-strong: #5F6368;
  --text: #E8EAED; --text-secondary: #DADCE0; --text-muted: #80868B;
  --accent: #A5B4FC; --accent-tint: #312E81;
  --success: #34D399; --success-bg: #064E3B;
  --warning: #FBBF24; --warning-bg: #78350F;
  --danger: #F87171;  --danger-bg: #7F1D1D;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 12px -4px rgba(0, 0, 0, .5);
  --shadow-pop: 0 12px 32px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-page: #202124; --bg-card: #2D2E31; --bg-sunken: #26272A; --bg-hover: #35373A;
    --border: #3C4043; --border-strong: #5F6368;
    --text: #E8EAED; --text-secondary: #DADCE0; --text-muted: #80868B;
    --accent: #A5B4FC; --accent-tint: #312E81;
    --success: #34D399; --success-bg: #064E3B;
    --warning: #FBBF24; --warning-bg: #78350F;
    --danger: #F87171;  --danger-bg: #7F1D1D;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { background: var(--bg-page); }
body { margin: 0; color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ─── כותרת עליונה ─── */
.topbar { border-bottom: 1px solid var(--border); background: var(--bg-card); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 20px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { font-weight: 700; font-size: 15px; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.page { max-width: 1200px; margin: 0 auto; padding: 20px 24px 48px; }
.section-title { font-size: 15px; font-weight: 600; margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }

/* ─── כפתורים ─── (hard rule 1: inline-flex + leading-none בכל אלמנט בגובה קבוע) */
.btn, .btn-primary, .btn-icon, .chip, .seg button, .tab {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; white-space: nowrap;
}
.btn {
  height: var(--h-control); padding: 0 14px; gap: 6px; border-radius: var(--radius-control);
  background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-strong);
  font-weight: 500; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--bg-hover); color: var(--text); }
.btn:disabled, .btn-primary:disabled, .btn-icon:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-primary {
  height: var(--h-control); padding: 0 16px; gap: 6px; border-radius: var(--radius-control); border: 0;
  background: var(--accent-grad); color: #fff; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); transition: opacity .15s;
}
.btn-primary:hover { opacity: .9; }
.btn-primary.lg, .btn.lg { height: 44px; padding: 0 24px; font-size: 16px; border-radius: var(--radius-field); }
.btn-icon {
  width: 32px; height: 32px; border-radius: var(--radius-field); border: 0; background: transparent;
  color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s; flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--accent); }
.btn-icon.lg { width: 44px; height: 44px; }
.btn-icon.active { color: var(--accent); background: var(--accent-tint); }

/* ─── שדות ─── */
.input {
  height: var(--h-control); padding: 0 10px; border-radius: var(--radius-control); outline: none;
  background: var(--bg-sunken); color: var(--text); border: 1px solid var(--border); transition: border-color .15s;
}
.input:focus { border-color: #818CF8; }
.input.lg { height: 44px; font-size: 16px; border-radius: var(--radius-field); padding: 0 14px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* ─── כרטיסים ─── */
.card { background: var(--bg-card); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); transition: box-shadow .15s; overflow: hidden; }
.card.lift:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 14px 16px; }
.stripe-active.stripe-active { border-right: 4px solid #059669 !important; }
.stripe-free.stripe-free { border-right: 4px solid #6366F1 !important; }
.stripe-revoked.stripe-revoked { border-right: 4px solid #94A3B8 !important; }
:root[data-theme="dark"] .stripe-active.stripe-active { border-right-color: #34D399 !important; }
:root[data-theme="dark"] .stripe-free.stripe-free { border-right-color: #A5B4FC !important; }
:root[data-theme="dark"] .stripe-revoked.stripe-revoked { border-right-color: #5F6368 !important; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ─── צ'יפים ─── */
.chip { height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 500; gap: 4px; background: var(--bg-sunken); color: var(--text-secondary); border: 1px solid var(--border); }
.chip.success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.chip.warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.chip.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.chip.accent { background: var(--accent-tint); color: var(--accent); border-color: transparent; }

/* ─── בורר מקטעים ─── */
.seg { display: inline-flex; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-field); padding: 2px; gap: 2px; }
.seg button { height: 26px; padding: 0 12px; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 13px; font-weight: 500; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg-card); color: var(--accent); box-shadow: var(--shadow-sm); }
.seg button.on.danger { color: var(--danger); }

/* ─── ספינר, מצבים ריקים, הודעות ─── */
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; color: var(--accent); }
.spinner.lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 16px; text-align: center; color: var(--text-secondary); }
.center-state svg.illus { color: var(--accent); opacity: .85; }
.center-state h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.center-state p { margin: 0; max-width: 420px; }

.toast-wrap { position: fixed; bottom: 20px; left: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-card); color: var(--text); border-radius: var(--radius-field); box-shadow: var(--shadow-pop); padding: 10px 14px; font-size: 13px; display: flex; gap: 8px; align-items: center; max-width: 360px; animation: toastIn .2s ease-out; }
.toast.error { color: var(--danger); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ─── מודאל ─── */
.backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .4); backdrop-filter: blur(3px); }
.modal { background: var(--bg-card); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); width: 520px; max-width: 94vw; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ─── שקופית ממוזערת ─── */
.thumb { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-field); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .badge { position: absolute; top: 6px; right: 6px; }
.thumb .idx { position: absolute; bottom: 6px; left: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: #80868B; font-size: 12px; }

.link-box { display: flex; align-items: center; gap: 8px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-field); padding: 0 4px 0 10px; height: var(--h-field); min-width: 0; }
.link-box .url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-secondary); }

/* ─── במה ─── (התוכן עצמו תמיד על רקע שחור, בשתי ערכות הנושא) */
.stage { position: relative; background: #000; overflow: hidden; }
.stage > img, .stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.stage > img:not([src]) { visibility: hidden; }
.stage > video { opacity: 0; transition: opacity .12s; pointer-events: none; }
.stage > video.active.visible { opacity: 1; }
