/* ─────────────────────────────────────────────────────────────────────────
   ZoodUp — shared design tokens & components
   Used by: index.html · room.html · share.html · share-msg.html
   ───────────────────────────────────────────────────────────────────────── */

/* ── Vazirmatn — Persian script font (vendored, no CDN) ── */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens — dark (default) ── */
:root {
  --bg: #080b12;
  --surface: #0f1320;
  --surface2: #161c2d;
  --border: #1e2a40;
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --text: #e2e8f0;
  --muted: #64748b;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 10px;
  --nav-bg: rgba(8,11,18,0.85);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-fa: 'Vazirmatn', system-ui, sans-serif;
}

/* ── Light theme — system preference ── */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f4f8;
    --surface: #ffffff;
    --surface2: #eceff5;
    --border: #dde2ec;
    --text: #111827;
    --nav-bg: rgba(248,249,252,0.92);
  }
}

/* ── Forced dark ── */
html[data-theme="dark"] {
  --bg: #080b12; --surface: #0f1320; --surface2: #161c2d;
  --border: #1e2a40; --text: #e2e8f0; --muted: #64748b;
  --nav-bg: rgba(8,11,18,0.85);
}

/* ── Forced light ── */
html[data-theme="light"] {
  --bg: #f3f4f8; --surface: #ffffff; --surface2: #eceff5;
  --border: #dde2ec; --text: #111827; --muted: #64748b;
  --nav-bg: rgba(248,249,252,0.92);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Logo / wordmark — gradient text ── */
.logo, .logo-link {
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Theme toggle button (system / dark / light cycle) ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .35rem .6rem;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: border-color .2s, color .2s;
  font-family: inherit;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── Share-page: body layout ── */
.share-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

/* ── Share-page: header ── */
.share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 52px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-sub { font-size: .78rem; color: var(--muted); }

/* ── Share-page: main content area ── */
.share-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Share-page: content card ── */
.share-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── State boxes (loading / error / not-found) ── */
.state-box { padding: 3rem 1.5rem; text-align: center; }
.state-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.state-title { font-size: 1.1rem; font-weight: 600; margin-bottom: .4rem; }
.state-sub { color: var(--muted); font-size: .85rem; }

/* ── Share-link row (input + copy button) ── */
.share-row { display: flex; gap: .4rem; margin-bottom: 1rem; align-items: stretch; }
.share-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .45rem .7rem;
  color: var(--text);
  font-size: .8rem;
  font-family: monospace;
  min-width: 0;
  cursor: text;
}
.share-input:focus { outline: none; border-color: var(--accent); }
.btn-copy {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: .45rem .7rem;
  cursor: pointer;
  font-size: .85rem;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-copy:hover { color: var(--accent); border-color: var(--accent); }

/* ── RTL (Persian) — shared overrides ── */

/* Apply Vazirmatn when document is RTL */
html[dir="rtl"] bod, html[dir="rtl"] .join-row input {
  font-family: var(--font-fa);
}

/* URLs, room codes, and monospace values stay LTR even in RTL pages */
html[dir="rtl"] .share-input,
html[dir="rtl"] .join-row input,
html[dir="rtl"] .room-code,
html[dir="rtl"] code,
html[dir="rtl"] pre {
  direction: ltr;
  text-align: left;
}

/* Room-list secondary info: in LTR it right-aligns; in RTL it should left-align */
html[dir="rtl"] .room-item-right { text-align: left; }

/* Online dot spacing flips with text direction */
html[dir="rtl"] .online-dot { margin-right: 0; margin-left: 3px; }
