/* =============================================================================
 * File:        public/css/main.css
 * Created:     10.10.26 RUN_256 by Claude
 * Purpose:     Core styles for PWA landing + shared components
 * Design:      Mobile-first, RTL-ready, dark theme default
 * Brand:       #0078d7 accent, matching App.css --color-accent (RED_WARNINGS)
 * LinkedCodes: public/index.html, public/pages/*.html
 * ===========================================================================*/

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette — synced with 05_frontend_dashboard App.css */
  --accent:        #0078d7;
  --accent-deep:   #005c9e;
  --accent-light:  #4fc3f7;
  --brand-gradient: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 40%, var(--accent-light) 100%);

  /* Surfaces (dark) */
  --bg:           #0a0e1a;
  --bg-elev-1:    #121829;
  --bg-elev-2:    #1a2338;
  --border:       #2a3454;

  /* Text */
  --text:         #e8edf7;
  --text-dim:     #9aa5c0;
  --text-faint:   #5d6a8a;

  /* Semantic */
  --success:      #22c55e;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         var(--accent-light);

  /* Spacing scale */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px; --s-6: 32px;  --s-7: 48px;  --s-8: 64px;

  /* Radii + shadows */
  --r-sm: 6px;  --r-md: 10px; --r-lg: 16px; --r-xl: 24px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 4px 12px rgba(0,0,0,.4);
  --shadow-3: 0 12px 32px rgba(0,0,0,.5);

  /* Typography */
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans Hebrew', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
}

/* Light mode */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #f6f8fc;
    --bg-elev-1: #ffffff;
    --bg-elev-2: #ffffff;
    --border:    #e2e8f0;
    --text:      #0f172a;
    --text-dim:  #475569;
    --text-faint:#94a3b8;
    --shadow-1:  0 1px 2px rgba(15,23,42,.08);
    --shadow-2:  0 4px 12px rgba(15,23,42,.1);
    --shadow-3:  0 12px 32px rgba(15,23,42,.15);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--accent-light); text-decoration: none; }

/* ---------- Layout ---------- */
.wrap { max-width: 480px; margin: 0 auto; padding: var(--s-5); }

.hero {
  text-align: center;
  padding: var(--s-7) var(--s-4) var(--s-6);
  background: var(--brand-gradient);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  margin-bottom: var(--s-6);
  color: #fff;
  box-shadow: var(--shadow-2);
}
.hero__logo { width: 72px; height: 72px; margin: 0 auto var(--s-4); border-radius: var(--r-md); background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 32px; }
.hero__title { font-size: 28px; font-weight: 700; margin: 0 0 var(--s-2); letter-spacing: -0.02em; }
.hero__subtitle { font-size: 15px; opacity: .9; margin: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--s-4);
}
.card__title { font-size: 17px; font-weight: 600; margin: 0 0 var(--s-3); }
.card__body { color: var(--text-dim); font-size: 14px; margin: 0; }

/* ---------- Features list ---------- */
.features { list-style: none; padding: 0; margin: var(--s-4) 0 0; display: grid; gap: var(--s-3); }
.features li { display: flex; align-items: start; gap: var(--s-3); font-size: 14px; }
.features li::before {
  content: "";
  width: 20px; height: 20px; flex-shrink: 0;
  margin-top: 2px;
  background: var(--accent);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" fill="black"/></svg>') no-repeat center / contain;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" fill="black"/></svg>') no-repeat center / contain;
}

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
  margin-bottom: var(--s-3);
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-1); }
.btn--primary:hover { background: #0085ef; box-shadow: var(--shadow-2); }
/* RUN_263 (11.10.26) WAS: border faint on light mode (same as bg). NOW: 2px accent-tinted border + inner glow. */
.btn--ghost {
  background: var(--bg-elev-1);
  color: var(--text);
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0,120,215,0.1);
}
.btn--ghost:hover {
  background: var(--bg-elev-2);
  box-shadow: 0 4px 12px rgba(0,120,215,0.25), inset 0 0 0 1px rgba(0,120,215,0.2);
  transform: translateY(-1px);
}
.btn--telegram { background: #0088cc; color: #fff; }
.btn--telegram:hover { background: #0099dd; }

/* ---------- Install banner (shown when PWA installable) ---------- */
.install-banner {
  display: none;
  position: fixed;
  bottom: var(--s-4);
  left: var(--s-4);
  right: var(--s-4);
  max-width: 448px;
  margin: 0 auto;
  padding: var(--s-4);
  background: var(--bg-elev-2);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  z-index: 50;
}
.install-banner.show { display: flex; align-items: center; gap: var(--s-3); }
.install-banner__text { flex: 1; font-size: 14px; }
.install-banner__close { background: transparent; border: 0; color: var(--text-dim); font-size: 20px; padding: var(--s-1) var(--s-2); }

/* ---------- Footer ---------- */
.footer { text-align: center; font-size: 12px; color: var(--text-faint); margin-top: var(--s-6); padding-bottom: var(--s-5); }
.footer a { color: var(--text-dim); }

/* ---------- Utilities ---------- */
.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; }

/* ---------- RTL fine-tuning (Hebrew default) ---------- */
html[dir="rtl"] .features li { text-align: right; }


/* =============================================================================
 * RUN_259 (10.10.26) — Theme toggle button + SEO/accessibility nits
 * ===========================================================================*/
.theme-toggle {
  position: fixed;
  top: var(--s-3);
  inset-inline-end: var(--s-3);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: 18px;
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 100;
  backdrop-filter: blur(8px);
  transition: transform .2s;
}
.theme-toggle:hover { transform: scale(1.1); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* =============================================================================
 * RUN_263 (11.10.26) — Language picker (floating pill, top-left)
 * =========================================================================*/
.lang-picker {
  position: fixed;
  top: var(--s-3);
  inset-inline-start: var(--s-3);
  z-index: 100;
}
.lang-picker__btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.3);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 6px;
  transition: transform .2s;
}
.lang-picker__btn:hover { transform: scale(1.05); }
.lang-picker__list {
  position: absolute;
  top: 110%;
  inset-inline-start: 0;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: var(--s-2);
  min-width: 280px;
  max-width: 320px;
  display: none;
}
.lang-picker.open .lang-picker__list { display: block; }
.lang-picker__search {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: 14px;
  margin-bottom: var(--s-2);
  outline: none;
}
.lang-picker__search:focus { border-color: var(--accent); }
.lang-picker__results {
  max-height: 50vh;
  overflow-y: auto;
}
.lang-picker__flag, .lang-picker__item-flag {
  width: 20px; height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.lang-picker__item {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  display: flex; align-items: center;
  gap: 10px;
}
.lang-picker__item:hover { background: var(--bg-elev-2); }
.lang-picker__item.active { background: var(--accent); color: #fff; }
.lang-picker__item.active .lang-picker__item-name,
.lang-picker__item.active .lang-picker__code { color: #fff; opacity: .9; }
.lang-picker__item-native { flex: 1; font-weight: 500; }
.lang-picker__item-name { font-size: 11px; color: var(--text-dim); }
.lang-picker__code { font-size: 11px; opacity: .6; font-family: var(--font-mono); text-transform: uppercase; }


/* =============================================================================
 * RUN_269 (11.10.26) — Site brand (logo + wordmark) with clickable home link
 * =========================================================================*/
.site-brand {
  /* 11.10.26 RUN_270 — WAS: inline-block broke child centering. NOW: block with text-align center so img + title stack centered. */
  display: block;
  width: fit-content;
  margin: 0 auto;
  text-align: center;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .18s ease, transform .18s ease;
}
.site-brand:hover { opacity: .9; transform: scale(1.02); }
.site-brand:active { transform: scale(0.98); }
.site-brand:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: 4px; border-radius: var(--r-md); }

.hero__logo-img {
  /* 11.10.26 RUN_271 — Logo is 1026x773 (ratio 1.327) with transparent BG.
     WAS: 100x100 solid white BG distorted the logo + solid white felt heavy.
     NOW: natural aspect preserved, translucent frosted band, bigger size for impact. */
  display: block;
  margin: 0 auto var(--s-4);
  width: 220px;
  height: auto;
  max-width: 70vw;
  aspect-ratio: 1026 / 773;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  padding: 12px 20px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Brand bar (slim top bar for sub-pages) */
.brand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--s-4);
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 100%);
  color: #fff;
  text-decoration: none;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.brand-bar:active { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); }
.brand-bar__logo {
  /* 11.10.26 RUN_271 — keep aspect, translucent, no heavy white box */
  height: 34px;
  width: auto;
  aspect-ratio: 1026 / 773;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.brand-bar__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* =============================================================================
 * RUN_273 (11.10.26) — Unified hero sizing across all pages.
 * .hero         (default — index.html): large logo + title, generous padding
 * .hero--compact (all sub-pages):       smaller logo + title, tighter padding
 * =========================================================================*/
.hero--compact {
  padding: 24px var(--s-4) 20px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  margin-bottom: var(--s-5);
}
.hero--compact .hero__logo-img {
  width: 120px;         /* was 160; balanced vs 20px h1 */
  padding: 8px 14px;
  margin-bottom: var(--s-3);
}
.hero--compact .hero__title {
  font-size: 20px;
  margin-top: var(--s-2);
}
.hero--compact .hero__subtitle {
  font-size: 13px;
}

/* Mobile tightening */
@media (max-width: 420px) {
  .hero__logo-img       { width: 180px; padding: 10px 16px; }
  .hero--compact .hero__logo-img { width: 100px; padding: 7px 12px; }
  .hero__title          { font-size: 24px; }
  .hero--compact .hero__title { font-size: 18px; }
}


/* =============================================================================
 * RUN_274 (11.10.26) — Package mini-cards on landing (info only, no checkout).
 * =========================================================================*/
.pkg-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
@media (max-width: 420px) {
  .pkg-mini { grid-template-columns: 1fr; }
}
.pkg-mini__item {
  padding: var(--s-3);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  position: relative;
  /* 11.10.26 RUN_280 - ADD: hover feedback (nothing removed) */
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pkg-mini__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.14);
  border-color: var(--accent);
}
.pkg-mini__item--free {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(34,197,94,0.08), var(--bg-elev-2));
}
.pkg-mini__item--featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(0,120,215,0.1), var(--bg-elev-2));
  box-shadow: 0 4px 16px rgba(0,120,215,0.15);
}
.pkg-mini__item--featured::after {
  content: "⭐";
  position: absolute;
  top: 8px;
  inset-inline-end: 10px;
  font-size: 14px;
}
.pkg-mini__name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.pkg-mini__price {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}
.pkg-mini__item--free .pkg-mini__price,
.pkg-mini__item--free::after {
  color: var(--success);
}
.pkg-mini__body {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.pkg-mini__cta {
  margin-top: var(--s-4);
  padding: var(--s-3);
  background: var(--bg-elev-2);
  border-radius: var(--r-sm);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ADD 11.10.26 RUN_277 - Broadcast banner + mandatory modal */
.broadcast-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #0a84ff; color: #fff; padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 14px; line-height: 1.4;
}
.broadcast-banner[hidden] { display: none; }
.broadcast-banner__content { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.broadcast-banner__title { font-weight: 600; }
.broadcast-banner__body { opacity: 0.95; }
.broadcast-banner__close {
  background: transparent; border: 0; color: #fff; font-size: 22px;
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.broadcast-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.broadcast-modal[hidden] { display: none; }
.broadcast-modal__backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.65);
}
.broadcast-modal__dialog {
  position: relative; background: var(--bg-card, #fff); color: var(--text, #222);
  padding: 24px; border-radius: 12px; max-width: 480px; width: 92%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.broadcast-modal__title { margin: 0 0 12px 0; font-size: 18px; font-weight: 700; }
.broadcast-modal__body { margin: 0 0 20px 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
/* END RUN_277 */
