/* =========================================================
   Kuwait Online Ad Spend
   Page-specific parts only. Colours, fonts, buttons, nav,
   backdrop and footer all come from ../styles.css.
   ========================================================= */

.spend {
  /* Inter / Space Grotesk have no Arabic letters, so Arabic falls through to Noto Sans Arabic */
  --font-body: "Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Noto Sans Arabic", var(--font-body);
  color-scheme: dark;
}
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
main.wrap { padding-block: 0 96px; }

/* English beside Arabic */
.en { color: var(--text-muted); font-weight: 400; unicode-bidi: isolate; }
p.en { margin-top: 6px; direction: ltr; text-align: right; }
.nav__links a[aria-current="page"] { color: var(--text); }

/* ---------- Intro ---------- */
.intro { padding-block: 64px 40px; }
.intro h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.25; letter-spacing: 0; }
.intro__en { margin-top: 10px; font: 500 1.15rem/1.4 var(--font-display); color: var(--text-muted); text-align: right; }

/* ---------- Panels (same surface as the site's cards) ---------- */
.panel {
  position: relative; padding: 30px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* ---------- Note (always visible) ---------- */
.note {
  margin-bottom: 20px; padding: 16px 20px; border-radius: var(--radius);
  background: rgba(34, 211, 238, .06); border: 1px solid rgba(34, 211, 238, .22);
  border-inline-start: 3px solid var(--c1);
  font-size: .95rem; color: var(--text);
}

/* ---------- Fields ---------- */
.field { display: grid; gap: 8px; min-width: 0; }
.field__label { font-size: .88rem; font-weight: 600; color: var(--text); }
.field__label .en { font: 500 .7rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c1); margin-inline-start: 8px; }
.spend input, .spend select {
  width: 100%; height: 48px; padding: 0 14px;
  font: inherit; font-size: .95rem; color: var(--text);
  background: rgba(0, 0, 0, .3); border: 1px solid var(--border-strong); border-radius: 12px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.spend select { padding-inline-end: 30px; }
.spend select option { background: #0b0d16; color: var(--text); }
.spend input::placeholder { color: var(--text-faint); }
.spend input:hover, .spend select:hover { border-color: rgba(255,255,255,.3); }
.spend input:focus, .spend select:focus {
  outline: none; border-color: var(--c1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .18); background: rgba(0, 0, 0, .45);
}
.field--accent select { border-color: var(--c2); box-shadow: 0 0 24px -8px rgba(139, 92, 246, .7); font-weight: 600; }

/* ---------- Buttons (extend the site's .btn) ---------- */
.spend .btn { font-family: var(--font-body); }
.spend .btn .en { font-size: .8rem; font-weight: 600; color: inherit; opacity: .75; }
.spend .btn[disabled] { opacity: .6; cursor: progress; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--c1); cursor: pointer; }
.link:hover { text-decoration: underline; }
.link .en { color: inherit; opacity: .8; }

/* ---------- Sign-up ---------- */
.gate { max-width: 780px; margin-inline: auto; padding: 40px; overflow: hidden; }
.gate::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(520px 240px at 50% 0%, rgba(139, 92, 246, .22), transparent 70%);
}
.gate > * { position: relative; }
.gate__intro h2 { font-size: 1.7rem; line-height: 1.35; letter-spacing: 0; }
.gate__intro h2 .en { display: block; font: 500 1rem/1.4 var(--font-display); margin-top: 4px; }
.gate__intro p { margin-top: 14px; color: var(--text-muted); }
.gate__intro p.en { font-size: .93rem; color: var(--text-faint); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.form .consent, .form .msg, .form .btn { grid-column: 1 / -1; }
.consent { font-size: .84rem; color: var(--text-muted); }
.consent .en { display: block; margin-top: 2px; color: var(--text-faint); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Filters ---------- */
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: end; }
.field--wide { grid-column: span 2; }
.filters__actions { display: flex; gap: 10px; grid-column: span 2; }
.filters__actions .btn { height: 48px; }
.filters__actions .btn--primary { flex: 1; }

/* ---------- Results ---------- */
.results { margin-top: 20px; padding: 0; overflow: hidden; }
.results__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 30px 16px; }
.results__head h2 { font-size: 1.3rem; letter-spacing: 0; }
.results__head h2 .en { font: 500 .72rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c1); margin-inline-start: 10px; }
.results__meta { font-size: .86rem; color: var(--text-muted); }

.msg { padding: 20px 30px; color: var(--text-muted); }
.msg--error { color: #fca5a5; font-weight: 600; }
.form .msg { padding: 0; }
.empty { padding: 44px 30px 52px; text-align: center; }
.empty p:first-child { font-weight: 600; font-size: 1.08rem; }
.empty p.en { text-align: center; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
.spend table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 880px; }
.spend th, .spend td { padding: 13px 16px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.spend thead th {
  background: rgba(255,255,255,.04); color: var(--text);
  font-size: .82rem; font-weight: 600; white-space: nowrap;
}
.spend thead th .en { display: block; margin-top: 2px; font: 500 .66rem/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c1); }
.spend th.num { text-align: end; }
.spend td.num { direction: ltr; text-align: left; font-family: var(--font-mono); font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-muted); }
.spend td.rank { color: var(--text-faint); width: 1%; }
.spend td.label { font-weight: 600; unicode-bidi: plaintext; text-align: start; min-width: 200px; color: var(--text); }
.spend td.spend { color: var(--text); font-weight: 500; }
.spend tbody tr { transition: background .15s; }
.spend tbody tr:hover { background: rgba(139, 92, 246, .08); }
.spend tfoot td { font-weight: 600; background: rgba(255,255,255,.04); border-bottom: 0; border-top: 1px solid var(--border-strong); color: var(--text); }

.sharecell { display: flex; align-items: center; gap: 10px; direction: ltr; min-width: 150px; }
.sharecell__bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.sharecell__bar i { display: block; height: 100%; background: var(--grad-2); border-radius: 3px; box-shadow: 0 0 10px rgba(139, 92, 246, .6); }
.sharecell__val { width: 58px; text-align: right; font: .86rem var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }

.results__foot { padding: 18px 30px 22px; font-size: .84rem; color: var(--text-muted); border-top: 1px solid var(--border); background: rgba(0,0,0,.2); }
.results__foot p + p { margin-top: 4px; color: var(--text-faint); }
.results__foot .en { margin-inline-start: 8px; color: inherit; }
.results__foot strong { color: var(--text); }

.who { margin-top: 18px; font-size: .84rem; color: var(--text-faint); display: flex; gap: 12px; flex-wrap: wrap; }
.who #who-email { font-family: var(--font-mono); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .intro { padding-block: 40px 28px; }
  main.wrap { padding-bottom: 64px; }
  .panel { padding: 22px; }
  .gate { padding: 28px 22px; }
  .form, .filters { grid-template-columns: 1fr; }
  .field--wide, .filters__actions { grid-column: auto; }
  .results { padding: 0; }
  .results__head { padding: 20px 22px 14px; }
  .msg, .results__foot { padding-inline: 22px; }
}
