
/* Scoped with an --rg- prefix on purpose: this file is loaded on the real
   zibadis.ir homepage alongside tokens.css. These used to be hardcoded
   light/dark literals (duplicating tokens.css's own palette almost exactly);
   now they're aliases onto the shared tokens, so the homepage automatically
   follows the same site-wide theme toggle ([data-theme="dark"] on <html>,
   set by shell.js) as every other page instead of its own
   prefers-color-scheme media query. --rg-teal and --rg-ease have no shared
   equivalent and stay as local literals. */
:root {
  --rg-bg-0: var(--bg);
  --rg-bg-1: var(--bg-2);
  --rg-bg-2: var(--panel-3);
  --rg-ink: var(--text);
  --rg-muted: var(--muted);
  --rg-line: var(--line-2);
  --rg-line-2: var(--input-border);
  --rg-teal: #1fb3c4;
  --rg-purple: var(--violet);
  --rg-gold: var(--gold);
  --rg-gold-2: var(--gold-2);
  --rg-surface: var(--glass);
  --rg-surface-solid: var(--panel-2);
  --rg-shadow: var(--shadow);
  --rg-shadow-lg: var(--shadow-2);
  --rg-radius-pill: 0;
  --rg-ease: cubic-bezier(.2,.7,.2,1);
}

#rgRoot [hidden] { display: none !important; }

/* Flat/architectural look requested 2026-09-11, matching the sharp-cornered
   header icons and inputs used sitewide -- overrides every remaining literal
   border-radius in this file (search pill, camera panel, buttons, dropdowns,
   result panel, icon buttons) without hunting down each declaration. */
#rgRoot * { border-radius: 0 !important; }

#rgRoot {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  font-family: "YekanBakh", Tahoma, Arial, sans-serif;
  color: var(--rg-ink);
  background:
    radial-gradient(circle at 78% 10%, rgba(31,179,196,.09), transparent 32rem),
    radial-gradient(circle at 12% 18%, rgba(141,75,232,.07), transparent 26rem),
    linear-gradient(180deg, var(--rg-bg-0) 0%, var(--rg-bg-1) 45%, var(--rg-bg-2) 100%);
  transition: background .3s var(--rg-ease);
}

#rgRoot button, #rgRoot textarea, #rgRoot select, #rgRoot input { font: inherit; }
#rgRoot a { color: inherit; text-decoration: none; }

#rgRoot .mark-bg { color: var(--rg-ink); }
#rgRoot .mark-fg { fill: var(--rg-bg-1); }

/* ── Stage: centered like the Google homepage, shifts up once a result exists ── */
#rgRoot .stage {
  flex: 1;
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 0 8vh;
  transition: padding .45s var(--rg-ease);
}

#rgRoot.has-result .stage {
  justify-content: flex-start;
  padding-top: 4vh;
}

#rgRoot .brandmark {
  text-align: center;
  margin-bottom: 34px;
  transition: transform .45s var(--rg-ease), margin .45s var(--rg-ease), opacity .3s ease;
}

#rgRoot.has-result .brandmark {
  transform: scale(.72);
  margin-bottom: 14px;
}

#rgRoot .brandmark-logo { width: 56px; height: 56px; margin: 0 auto 14px; color: var(--rg-ink); }
#rgRoot .brandmark-logo .mark-fg { fill: var(--rg-bg-1); }

#rgRoot .brandmark h1 {
  margin: 0;
  direction: ltr;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(95deg, var(--rg-ink) 55%, var(--rg-purple) 85%, var(--rg-teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#rgRoot .brandmark h1 span { color: var(--rg-gold); -webkit-text-fill-color: var(--rg-gold); }

#rgRoot .tagline { margin: 10px 0 0; color: var(--rg-muted); font-size: 15px; }
#rgRoot.has-result .tagline { display: none; }

/* ── Quick menu: AI / NEWS / SIGNAL / DATA, above the search pill ── */
#rgRoot .quick-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
  transition: opacity .3s var(--rg-ease), margin .3s var(--rg-ease), height .3s var(--rg-ease);
}
#rgRoot .quick-menu-item {
  padding: 8px 18px;
  border-radius: var(--rg-radius-pill);
  border: 1px solid var(--rg-line);
  background: var(--rg-surface);
  color: var(--rg-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
#rgRoot .quick-menu-item:hover { box-shadow: var(--rg-shadow); border-color: var(--rg-line-2); }
#rgRoot .quick-menu-item:active { transform: translateY(1px); }

#rgRoot .quick-menu-item.is-current {
  background: linear-gradient(135deg, var(--rg-purple), var(--rg-teal));
  color: #fff;
  border-color: transparent;
}

#rgRoot .quick-menu-item.is-disabled {
  color: var(--rg-muted);
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 640px) {
  #rgRoot .quick-menu { gap: 6px; margin-bottom: 12px; }
  #rgRoot .quick-menu-item { padding: 7px 13px; font-size: 11px; }
}

/* ── Search pill ── */
#rgRoot .search-form { width: 100%; }

#rgRoot .search-pill {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 26px;
  border: 1px solid var(--rg-line);
  background: var(--rg-surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--rg-shadow);
  transition: box-shadow .2s var(--rg-ease), border-color .2s var(--rg-ease);
}

#rgRoot .search-pill:focus-within {
  box-shadow: var(--rg-shadow-lg);
  border-color: var(--rg-line-2);
}

#rgRoot .pill-icon {
  display: grid;
  place-items: center;
  color: var(--rg-muted);
  flex: 0 0 auto;
  padding-top: 3px;
}

#rgRoot .search-pill textarea {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  resize: none;
  color: var(--rg-ink);
  font-size: 16px;
  line-height: 1.7;
  min-height: 26px;
  max-height: 160px;
  padding: 2px 0;
}
#rgRoot .search-pill textarea::placeholder { color: var(--rg-muted); }

#rgRoot .pill-actions { display: flex; gap: 4px; flex: 0 0 auto; }

#rgRoot .pill-icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--rg-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
#rgRoot .pill-icon-btn:hover { background: var(--rg-line); color: var(--rg-ink); }
#rgRoot .pill-icon-btn.is-active { color: #d1453b; }

#rgRoot .hint-row {
  display: flex;
  gap: 14px;
  padding: 6px 18px 0;
  min-height: 18px;
}
#rgRoot .hint-text { color: var(--rg-muted); font-size: 11px; }
#rgRoot .hint-text:empty { display: none; }

/* ── Buttons: Google's twin-button row ── */
#rgRoot .button-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

#rgRoot .google-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--rg-surface);
  border-color: var(--rg-line);
  color: var(--rg-ink);
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
#rgRoot .google-btn:hover { box-shadow: var(--rg-shadow); border-color: var(--rg-line-2); }
#rgRoot .google-btn:active { transform: translateY(1px); }

#rgRoot .google-btn.primary {
  background: linear-gradient(135deg, var(--rg-purple), var(--rg-teal));
  color: #fff;
  border-color: transparent;
}
#rgRoot .google-btn.primary:hover { box-shadow: 0 10px 30px rgba(141,75,232,.3); }
#rgRoot .google-btn.primary:disabled { opacity: .6; cursor: default; }

#rgRoot .google-btn.ghost { background: transparent; }

#rgRoot .output-select select {
  border: 1px solid var(--rg-line);
  border-radius: 10px;
  background: var(--rg-surface);
  color: var(--rg-muted);
  padding: 11px 16px;
  outline: none;
}

/* ── Camera panel ── */
#rgRoot .camera-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--rg-line);
  border-radius: 20px;
  background: var(--rg-surface-solid);
}
#rgRoot .camera-panel video, #rgRoot .camera-panel img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
}
#rgRoot .camera-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ── Progress ── */
#rgRoot .progress-panel {
  width: 100%;
  margin-top: 28px;
  padding: 14px 22px;
  border-radius: 20px;
  background: var(--rg-ink);
  color: var(--rg-bg-1);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--rg-shadow);
}
#rgRoot .hourglass { font-size: 26px; animation: rg-spin 1.8s linear infinite; flex: 0 0 auto; }
@keyframes rg-spin { to { transform: rotate(360deg); } }
#rgRoot .progress-body { flex: 1; min-width: 0; }
#rgRoot .progress-body strong { display: block; line-height: 1.6; transition: opacity .2s ease; }
#rgRoot .dots { display: inline-flex; gap: 5px; margin-top: 8px; }
#rgRoot .dots span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: rg-pulse 1s infinite alternate; }
#rgRoot .dots span:nth-child(2) { animation-delay: .2s; }
#rgRoot .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes rg-pulse { to { opacity: .25; transform: translateY(-3px); } }

#rgRoot .progress-cancel {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: var(--rg-radius-pill);
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  animation: rg-cancel-in .25s ease both;
}
#rgRoot .progress-cancel:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.4); }
@keyframes rg-cancel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Result ── */
#rgRoot .result-panel {
  width: 100%;
  margin-top: 30px;
  padding: clamp(18px, 4vw, 30px);
  border-radius: 24px;
  border: 1px solid var(--rg-line);
  background: var(--rg-surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--rg-shadow);
  animation: rg-resultIn .35s var(--rg-ease) both;
}
@keyframes rg-resultIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

#rgRoot .result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#rgRoot .eyebrow { margin: 0 0 4px; color: var(--rg-gold-2); font-weight: 700; font-size: 12px; }
#rgRoot .result-head h2 { margin: 0; font-size: 22px; }
#rgRoot .job-id { font-size: 11px; color: var(--rg-muted); border: 1px solid var(--rg-line); border-radius: var(--rg-radius-pill); padding: 5px 10px; }

#rgRoot .pipeline { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
#rgRoot .pipeline span, #rgRoot .route-item {
  border: 1px solid var(--rg-line);
  border-radius: var(--rg-radius-pill);
  padding: 7px 12px;
  font-size: 12px;
  background: var(--rg-surface-solid);
}
#rgRoot .route-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#rgRoot .route-item em { color: var(--rg-gold-2); font-style: normal; margin-right: 6px; }

#rgRoot .result-content {
  white-space: pre-wrap;
  line-height: 1.85;
  background: var(--rg-surface-solid);
  border: 1px solid var(--rg-line);
  color: var(--rg-ink);
  border-radius: 16px;
  padding: 18px;
  overflow: auto;
}

#rgRoot details summary { cursor: pointer; color: var(--rg-muted); font-size: 13px; margin-top: 14px; }

/* .apps-grid-link / .apps-grid-icon rules removed 2026-09-11 along with the
   element itself -- see index.html comment at the same date. */

/* ── Contact/support avatar (bottom-left, opposite the social-fab) ── */
.contact-fab-2 {
  position: fixed;
  left: 22px;
  bottom: calc(var(--footer-h, 30px) + 24px);
  z-index: 240;
}
[dir="rtl"] .contact-fab-2 { left: auto; right: 22px; }

.contact-fab-2-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--line, rgba(16,16,20,.08));
  background: var(--panel, #f7f3ea);
  color: var(--ink, #101014);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.12));
}
.contact-fab-2-btn svg { width: 26px; height: 26px; }

.contact-fab-2-card {
  position: absolute;
  bottom: 62px;
  left: 0;
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line, rgba(16,16,20,.08));
  background: var(--panel, #fff);
  color: var(--ink, #101014);
  box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.16));
  display: none;
}
[dir="rtl"] .contact-fab-2-card { left: auto; right: 0; }
.contact-fab-2.open .contact-fab-2-card { display: block; }

.contact-fab-2-card strong { display: block; font-size: 14px; }
.contact-fab-2-card small { display: block; color: var(--muted, #756f61); font-size: 11px; margin: 2px 0 10px; }
.contact-fab-2-card a {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: inherit; text-decoration: none;
}
.contact-fab-2-card a + a { margin-top: 8px; }

@media (max-width: 640px) {
  #rgRoot .stage { padding: 4vh 0 6vh; }
  #rgRoot .brandmark { margin-bottom: 24px; }
  #rgRoot .brandmark-logo { width: 44px; height: 44px; margin-bottom: 10px; }
  #rgRoot .brandmark h1 { font-size: 30px; }

  #rgRoot .search-pill { border-radius: 20px; padding: 10px 12px; gap: 6px; }
  #rgRoot .search-pill textarea { font-size: 15px; }
  #rgRoot .pill-actions { gap: 0; }
  #rgRoot .pill-icon-btn { width: 30px; height: 30px; }
  #rgRoot .pill-icon-btn svg { width: 17px; height: 17px; }

  #rgRoot .button-row { flex-direction: column-reverse; align-items: stretch; gap: 10px; margin-top: 18px; }
  #rgRoot .output-select select {
    width: 100%; text-align: center;
    background: transparent; border-color: transparent;
    color: var(--rg-muted); font-size: 13px; padding: 6px 12px;
  }
  #rgRoot .google-btn.primary { width: 100%; text-align: center; justify-content: center; padding: 13px 22px; }

  .contact-fab-2, .social-fab { transform: scale(.86); bottom: 12px; }
  .contact-fab-2 { left: 6px; }
  [dir="rtl"] .contact-fab-2 { left: auto; right: 6px; }
  .social-fab { right: 6px; }
  [dir="rtl"] .social-fab { right: auto; left: 6px; }
}

/* Very short viewports: the fixed corner circles can collide with the
   centered form's bottom edge -- pull the form up a bit more of the time
   instead of letting them overlap. */
@media (max-height: 640px) {
  #rgRoot .stage { padding-top: 2vh; padding-bottom: 12vh; }
}

@media (max-width: 340px) {
  #rgRoot .search-pill textarea { font-size: 13px; }
}

/* ── Minimal header, requested 2026-09-11: only the Apps shortcut
   (top-left) and language/theme toggles (top-right) survive from the
   shared OS-shell header on the homepage -- everything else (home icon,
   back button, brand logo/title, breadcrumb, search box, Start/+,
   notifications, messages, settings, clock) is hidden. Scoped to this
   route only; every other page keeps the full header untouched. Bottom
   nav and footer (borrowed from the other OS-shell pages) are dropped
   entirely on the homepage. The elements stay in the DOM (just hidden)
   so shell.js's own renders never hit a missing-element error. ── */
body[data-route="search"] #bottomNav,
body[data-route="search"] #osFooter { display: none !important; }

/* Keep header-actions (language/theme toggle) physically on the right and
   the Apps shortcut physically on the left, as asked -- CSS Grid mirrors
   column order under RTL by default, which would otherwise swap them. */
body[data-route="search"] .os-header { direction: ltr; }
body[data-route="search"] .os-header .header-actions { direction: ltr; }

body[data-route="search"] .os-header .section-toggle,
body[data-route="search"] .os-header .back-button,
body[data-route="search"] .os-header .brand-lockup,
body[data-route="search"] .os-header .h-action[data-route="performance"],
body[data-route="search"] .os-header .breadcrumb,
body[data-route="search"] .os-header .header-search,
body[data-route="search"] .os-header .h-action[data-action="start-menu"],
body[data-route="search"] .os-header .h-action[data-route="notif"],
body[data-route="search"] .os-header .h-action[data-route="messages"],
body[data-route="search"] .os-header .h-action[data-route="settings"],
body[data-route="search"] .os-header .clock-chip { display: none !important; }

/* Static, outside shell.js's own header markup -- renderHeader() replaces
   #osHeader's entire innerHTML on every theme/language toggle, so anything
   meant to survive those re-renders has to live outside it. header-left's
   own content is hidden above, leaving this corner free. */
.apps-shortcut {
  position: fixed; top: 14px; left: 16px; z-index: 265;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line-2);
  background: var(--glass); backdrop-filter: blur(18px);
  color: var(--muted); text-decoration: none;
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  transition: border-color .18s, color .18s, background .18s;
}
.apps-shortcut:hover { border-color: var(--line-3); background: rgba(224,169,53,.06); color: var(--gold); }
.apps-shortcut svg { width: 14px; height: 14px; flex: 0 0 auto; }
@media (max-width: 640px) { .apps-shortcut { top: 10px; height: 30px; padding: 0 9px; font-size: 10px; } }
/* .taskbar-left (the desktop sidebar, which already has its own Apps icon)
   only hides below 980px -- see responsive.css. Above that width this
   floating shortcut duplicated it, both visible on the homepage at once. */
@media (min-width: 981px) { .apps-shortcut { display: none; } }
