/* © 2026 אבישי פנחס (Avishay Pinchas). All rights reserved. */
/* טוקנים ומחלקות ליבה של העיצוב.
   הצבעים בחלק הראשון מוחלפים לכל פרויקט. כל השאר קבוע.

   גופנים: נטענים מקומית מקבצי הפרויקט, לא מרשת בזמן ריצה.
   @font-face { font-family: 'Rubik'; src: url('/fonts/Rubik-Variable.woff2') format('woff2'); font-weight: 700 900; font-display: block; }
   @font-face { font-family: 'Heebo'; src: url('/fonts/Heebo-Variable.woff2') format('woff2'); font-weight: 300 700; font-display: block; }

   ב‑<head>:  <html lang="he" dir="rtl">
   כיווניות: מאפיינים לוגיים בלבד (inline-start / inline-end). */

:root {
  /* ---- Colors: SAMPLED from Avishay's final reference image (2026-12-03,
     mockup/shots/רפרנס/ממשק קהילתי כחול כהה בעברית.png). Flat look: see flat.css. ---- */
  --bg-primary: #020A0F;          /* sampled: page background */
  --bg-surface: #051016;          /* sampled: inside the cards */
  --bg-elevated: #08161E;         /* derived: one step lighter, for dialogs and menus */
  --accent: #6BC8FD;              /* sampled: the sky blue (title, date, names, frames) */
  --accent-rgb: 107, 200, 253;
  --reflection: #39718D;          /* sampled: the muted card frame (birthday card) */
  --reflection-rgb: 57, 113, 141;
  --line-light: #A8D8EF;          /* sampled: the divider inside the duty card */
  --text-main: #FFFFFF;           /* sampled: the white */
  --text-muted: #8A9AA3;          /* derived: quiet text (placeholders, dimmed rows) */
  --text-soft: #D5DDE1;           /* derived: small secondary text, near the white */
  --text-rgb: 255, 255, 255;
  --bg-rgb: 2, 10, 15;
  --surface-rgb: 5, 16, 22;
  --core: #FFFFFF;

  /* Status colors: for status only */
  --success: #4F9A6A;
  --warning: #C98A2E;
  --danger: #F83E3C;              /* sampled: the red of the muted bell */

  /* ---- אור: קבוע ---- */
  --glow-opacity: 0.22;
  --glow-blur: 14px;
  --glow: rgba(var(--accent-rgb), var(--glow-opacity));
  --glow-strong: rgba(var(--accent-rgb), 0.55);
  --reflection-opacity: 0.16;

  /* ---- תנועה: קבוע ---- */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.3s;
  --t-card: 0.4s;

  /* ---- גופנים: בעברית ---- */
  --font-display: 'Rubik', sans-serif;
  --font-body: 'Heebo', sans-serif;

  /* ---- טיפוגרפיה ---- */
  --h1-size: 104px;
  --h1-leading: 0.94;
  --h1-tracking: -0.02em;        /* ריווח הדוק — מותר רק כאן */
  --label-size: 11px;
  --label-tracking: 0.08em;      /* ריווח מוגדל — מותר רק בתוויות */
  --body-leading: 1.65;

  /* ---- טלפון ואנדרואיד: אותם צבעים, מידות מותאמות ---- */
  --nav-height: 72px;            /* סרגל ניווט תחתון */
  --fab-size: 56px;              /* כפתור צף */
  --touch-min: 48px;             /* יעד מגע מינימלי */
  --h1-size-mobile: 44px;
  --glow-blur-mobile: 11px;
}

@media (max-width: 480px) {
  :root {
    --h1-size: var(--h1-size-mobile);
    --glow-blur: var(--glow-blur-mobile);
  }
  .card:nth-child(even) { margin-top: 0; }            /* אין היסט בעמודה אחת */
  .card::before { background: radial-gradient(260px circle at var(--mouse-x, 85%) var(--mouse-y, 0%), rgba(var(--reflection-rgb), 0.10), transparent 55%); opacity: 1; }
  .card:hover { transform: none; }
  .card:active { transform: translateY(1px); }
}

/* ---- בסיס בהיר: רק לפי בקשה. אותו עיקרון, צל צבעוני במקום זוהר ---- */
:root[data-base="light"] {
  --bg-primary: #F6F6F2;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FCFCF9;
  --text-main: #141412;
  --text-muted: #6E6E68;
  --text-soft: #4A4A45;
  --text-rgb: 20, 20, 18;
  --bg-rgb: 246, 246, 242;
  --surface-rgb: 255, 255, 255;
  --glow-opacity: 0.18;
  --reflection-opacity: 0.10;
}

html { direction: rtl; }

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: var(--body-leading);
  -webkit-font-smoothing: antialiased;
  text-align: start;
}

h1, h2, h3, .font-display { font-family: var(--font-display); margin: 0; }

h1 {
  font-size: var(--h1-size);
  line-height: var(--h1-leading);
  letter-spacing: var(--h1-tracking);
  font-weight: 900;
}

.label {
  font-size: var(--label-size);
  letter-spacing: var(--label-tracking);
  color: var(--text-muted);
}

/* מספרים, מחירים, טלפונים: מבודדים כיוונית בתוך טקסט עברי */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* גרעין פילם על כל המסך */
.film-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* טקסט בצבע הראשי — ליבה חדה, הילה מרוסנת */
.accent-text {
  color: var(--accent);
  text-shadow:
    0 0 2px rgba(var(--accent-rgb), 0.85),
    0 0 var(--glow-blur) var(--glow),
    0 0 calc(var(--glow-blur) * 2.2) rgba(var(--reflection-rgb), 0.22);
}

/* קו מפריד מואר */
.divider {
  height: 1px; width: 100%; position: relative;
  background: linear-gradient(90deg,
    rgba(var(--accent-rgb), 0) 0%,
    rgba(var(--reflection-rgb), 0.35) 20%,
    var(--accent) 50%,
    rgba(var(--reflection-rgb), 0.35) 80%,
    rgba(var(--accent-rgb), 0) 100%);
  box-shadow: 0 0 var(--glow-blur) var(--glow), 0 0 2px var(--accent);
}

/* כפתור ראשי — שלט מואר */
.btn-primary {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding-inline: 28px;
  background: rgba(var(--accent-rgb), 0.05);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 0 var(--glow-blur) var(--glow),
    0 0 calc(var(--glow-blur) * 2) rgba(var(--reflection-rgb), 0.14),
    inset 0 0 10px rgba(var(--accent-rgb), 0.22);
  text-shadow: 0 0 4px rgba(var(--accent-rgb), 0.45);
  transition: all var(--t-fast) var(--ease);
}
.btn-primary::before {
  content: ''; position: absolute; inset: 3px; border-radius: inherit; pointer-events: none;
  border: 1px solid rgba(var(--text-rgb), 0.35); opacity: 0.55;
}
.btn-primary::after {
  content: ''; position: absolute; bottom: -20px; inset-inline: 12%; height: 12px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(var(--reflection-rgb), 0.36) 0%, transparent 75%);
  filter: blur(6px);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent); color: var(--bg-primary); text-shadow: none; transform: translateY(-2px);
  box-shadow:
    0 0 calc(var(--glow-blur) * 1.3) var(--glow-strong),
    0 0 calc(var(--glow-blur) * 2.8) rgba(var(--reflection-rgb), 0.35),
    inset 0 0 8px var(--core);
}
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg-primary), 0 0 0 5px var(--accent), 0 0 calc(var(--glow-blur) * 1.3) var(--glow-strong); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; text-shadow: none; transform: none; }

/* כפתור משני — שקט, מקבל אור רק בריחוף */
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding-inline: 24px;
  background: transparent;
  border: 1px solid rgba(var(--text-rgb), 0.15);
  color: var(--text-main);
  font-family: var(--font-display); font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 var(--glow-blur) var(--glow);
}
.btn-secondary:focus-visible { outline: none; }

/* אייקון קו מואר — לקטגוריות וניווט בלבד */
.icon-lit {
  stroke: var(--accent);
  filter: drop-shadow(0 0 2px rgba(var(--accent-rgb), 0.7)) drop-shadow(0 0 calc(var(--glow-blur) * 0.7) var(--glow));
}

/* כרטיס */
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--bg-elevated) 0%, var(--bg-surface) 50%, var(--bg-primary) 100%);
  border: 1px solid rgba(var(--text-rgb), 0.08);
  transition: transform var(--t-card) var(--ease), border-color var(--t-card) ease, box-shadow var(--t-card) ease;
}
.card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0.4;
  background: radial-gradient(420px circle at var(--mouse-x, 100%) var(--mouse-y, 0%), rgba(var(--reflection-rgb), 0.14), transparent 50%);
  transition: opacity var(--t-card) ease;
}
.card:hover, .card:focus-within {
  border-color: rgba(var(--accent-rgb), 0.75);
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 var(--glow-blur) var(--glow), inset 0 0 14px rgba(var(--reflection-rgb), 0.08);
}
.card:hover::before, .card:focus-within::before { opacity: 1; }
.card:nth-child(even) { margin-top: 16px; }

/* פס אור צדדי בכרטיס — הצד מתחלף (לוגי: התחלה / סוף) */
.card-tube {
  position: absolute; top: 14%; bottom: 28%; width: 2.5px; border-radius: 99px; z-index: 4; opacity: 0.75;
  background: var(--accent);
  box-shadow: 0 0 4px var(--core), 0 0 var(--glow-blur) var(--glow), 0 0 calc(var(--glow-blur) * 2) rgba(var(--reflection-rgb), 0.28);
  transition: opacity var(--t-card) ease, box-shadow var(--t-card) ease;
}
.card:nth-child(odd) .card-tube { inset-inline-start: 12px; }
.card:nth-child(even) .card-tube { inset-inline-end: 12px; }
.card:hover .card-tube {
  opacity: 1;
  box-shadow: 0 0 6px var(--core), 0 0 calc(var(--glow-blur) * 1.2) var(--accent), 0 0 calc(var(--glow-blur) * 2.4) var(--glow-strong);
}

/* רצפה מבריקה והשתקפות */
.floor {
  position: relative;
  background: linear-gradient(180deg, rgba(var(--bg-rgb), 0.98) 0%, rgba(var(--reflection-rgb), 0.06) 25%, rgba(var(--surface-rgb), 0.99) 55%, var(--bg-primary) 100%);
  border-top: 1px solid rgba(var(--reflection-rgb), 0.28);
}
.reflection {
  pointer-events: none;
  transform: perspective(450px) rotateX(32deg) scaleY(-0.52) translateY(-100%);
  transform-origin: top center;
  filter: blur(1.8px) sepia(28%) saturate(70%) brightness(0.75);
  opacity: var(--reflection-opacity);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.18) 45%, transparent 82%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.18) 45%, transparent 82%);
  transition: opacity var(--t-card) ease, filter var(--t-card) ease;
}
.card:hover .reflection { opacity: calc(var(--reflection-opacity) * 1.55); filter: blur(1.4px) sepia(20%) saturate(80%) brightness(0.85); }

/* תאורת קצה שקופה מעל צילום מוצר — במקום ציור. הצד תואם לפס האור */
.rim-light {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background:
    radial-gradient(circle at 88% 42%, rgba(var(--accent-rgb), 0.30) 0%, rgba(var(--reflection-rgb), 0.12) 34%, transparent 68%);
}
.card:nth-child(even) .rim-light {
  background:
    radial-gradient(circle at 12% 42%, rgba(var(--accent-rgb), 0.30) 0%, rgba(var(--reflection-rgb), 0.12) 34%, transparent 68%);
}

/* תאורת סביבה */
.ambient { position: absolute; pointer-events: none; border-radius: 9999px; background: var(--reflection); filter: blur(95px); opacity: 0.065; }
.ambient-top { position: absolute; top: 0; inset-inline-start: 50%; transform: translateX(-50%); width: 820px; height: 110px; pointer-events: none; background: var(--reflection); filter: blur(65px); opacity: 0.03; }

/* הבהוב מיקרו */
@keyframes tubePulse { 0%,100%{opacity:1} 50%{opacity:.95} 52%{opacity:.99} 54%{opacity:.93} }
.flicker { animation: tubePulse 8s infinite ease-in-out; }

/* שדה קלט מואר במיקוד */
.input-lit {
  background: var(--bg-surface);
  border: 1px solid rgba(var(--text-rgb), 0.10);
  color: var(--text-main);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.input-lit:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 var(--glow-blur) var(--glow), inset 0 0 8px rgba(var(--reflection-rgb), 0.12);
}
input[type="email"], input[type="tel"], input[type="url"], input[type="password"], input[type="number"] {
  direction: ltr; text-align: end;
}

/* מחיר */
.price { font-family: var(--font-display); font-weight: 900; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; text-align: end; white-space: nowrap; }

/* ---- גרפים ---- */
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 2px rgba(var(--accent-rgb), 0.8)) drop-shadow(0 0 8px rgba(var(--reflection-rgb), 0.55)); }
.chart-area { fill: url(#chart-area-fill); }                 /* linearGradient: reflection 35% -> 0% */
.chart-grid { stroke: rgba(var(--text-rgb), 0.06); stroke-width: 1; }
.chart-end-dot { fill: var(--accent); filter: drop-shadow(0 0 4px var(--accent)) drop-shadow(0 0 10px var(--glow)); }
.chart-axis { font-size: 11px; fill: var(--text-muted); direction: ltr; }
.bar { fill: rgba(var(--reflection-rgb), 0.35); transform-origin: bottom; }
.bar.top { fill: var(--accent); filter: drop-shadow(0 0 8px var(--glow)); }
.ring-track { fill: none; stroke: rgba(var(--text-rgb), 0.08); }
.ring-fill { fill: none; stroke: var(--accent); stroke-linecap: round; filter: drop-shadow(0 0 6px var(--glow)); }
.live-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 6px var(--accent), 0 0 12px rgba(var(--reflection-rgb), 0.6); }
.table-row { border-bottom: 1px solid rgba(var(--text-rgb), 0.08); }
.status-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-inline-end: 6px; }
.status-dot.ok { background: var(--success); } .status-dot.warn { background: var(--warning); } .status-dot.bad { background: var(--danger); }

@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes growBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-line.animate { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: drawLine 1.6s var(--ease) forwards; }
.bar.animate { animation: growBar 0.6s var(--ease) both; }

/* ---- רכיבי טלפון ---- */
.bottom-nav {
  position: sticky; bottom: 0; z-index: 40; height: var(--nav-height);
  display: grid; grid-auto-flow: column; align-items: center; justify-items: center;
  background: rgba(var(--bg-rgb), 0.92); backdrop-filter: blur(18px);
  border-top: 1px solid rgba(var(--accent-rgb), 0.18);
}
.nav-dest {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: var(--touch-min); min-height: var(--touch-min); justify-content: center;
  font-size: 11px; color: var(--text-muted); position: relative;
}
.nav-dest.active { color: var(--accent); text-shadow: 0 0 4px rgba(var(--accent-rgb), 0.45); }
.nav-dest.active svg { filter: drop-shadow(0 0 2px rgba(var(--accent-rgb), 0.7)) drop-shadow(0 0 8px var(--glow)); }
.nav-badge {
  position: absolute; top: 4px; inset-inline-end: 2px;
  min-width: 18px; height: 18px; padding-inline: 5px; border-radius: 99px;
  background: var(--accent); color: var(--bg-primary);
  font-family: var(--font-display); font-weight: 800; font-size: 11px; line-height: 18px; text-align: center;
  box-shadow: 0 0 8px var(--glow);
}
.fab {
  width: var(--fab-size); height: var(--fab-size); border-radius: 50%; margin-top: -28px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--bg-primary);
  box-shadow: 0 0 calc(var(--glow-blur) * 1.4) var(--glow-strong), 0 0 calc(var(--glow-blur) * 3) rgba(var(--reflection-rgb), 0.35), 0 10px 24px rgba(0,0,0,0.9);
}
.switch {
  width: 44px; height: 24px; border-radius: 99px; position: relative; flex: none;
  background: var(--bg-elevated); border: 1px solid rgba(var(--text-rgb), 0.2);
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.switch::after {
  content: ''; position: absolute; top: 2px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-muted); transition: inset-inline-start var(--t-fast) var(--ease), background var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.switch.on { background: rgba(var(--accent-rgb), 0.16); border-color: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.25); }
.switch.on::after { inset-inline-start: calc(100% - 21px); background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-surface); border: 1px solid rgba(var(--text-rgb), 0.08); }
.segment { flex: 1; min-height: 40px; display: grid; place-items: center; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.segment.active { background: var(--accent); color: var(--bg-primary); font-weight: 700; box-shadow: 0 0 var(--glow-blur) var(--glow); }
.toast {
  position: fixed; bottom: calc(var(--nav-height) + 12px); inset-inline: 16px; z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--bg-surface); border: 1px solid var(--accent);
  box-shadow: 0 12px 32px rgba(0,0,0,0.9), 0 0 var(--glow-blur) var(--glow);
}
.device-shell {
  width: 430px; max-width: 100%; height: 915px; max-height: 96vh; margin: auto;
  border-radius: 44px; overflow: hidden; position: relative; display: flex; flex-direction: column;
  background: var(--bg-primary);
  border: 2px solid rgba(var(--accent-rgb), 0.30);
  box-shadow: 0 30px 90px rgba(0,0,0,0.98), 0 0 28px rgba(var(--reflection-rgb), 0.16), inset 0 0 20px rgba(var(--reflection-rgb), 0.06);
}

/* מיקוד מקלדת כללי */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* תנועה מופחתת: האור והעומק נשארים, התנועה נעצרת */
@media (prefers-reduced-motion: reduce) {
  .flicker { animation: none; }
  .card:hover, .btn-primary:hover { transform: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
