/* css/style.css
   -------------------------------------------------------------------
   Design tokens
   Color   — night #101826 (brand/header), paper #F1F0EA (background),
             ink #1B1B1E (text), outage #D6483F (red), restored #1E9E5A
             (green), unknown #DB9A34 (amber), line #DEDCD2 (hairline).
   Type    — one system stack throughout; brand mark uses tight tracking
             + heavier weight as its only distinguishing treatment.
   Layout  — single narrow column (max 440px), centered, no cards-within-
             cards. The status block is the one bold visual moment; the
             report buttons are the one large physical target.
   ------------------------------------------------------------------- */

:root {
  --night: #101826;
  --paper: #F1F0EA;
  --ink: #1B1B1E;
  --muted: #6E6F68;
  --line: #DEDCD2;
  --outage: #D6483F;
  --outage-ink: #7A211C;
  --restored: #1E9E5A;
  --restored-ink: #0F5C34;
  --unknown: #DB9A34;
  --unknown-ink: #7A5717;
  --surface: #FFFFFF;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 20px 28px;
}

/* ---- Header -------------------------------------------------------- */

.brand {
  padding: 22px 0 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand__mark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--night);
}

.brand__tag {
  font-size: 13px;
  color: var(--muted);
}

.banner {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 12px;
}

.banner--warn {
  background: #FBEFE0;
  color: var(--unknown-ink);
  border: 1px solid #EBD3A8;
}

.banner--mock {
  background: #EEEEE8;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ---- Area line ------------------------------------------------------- */

.area {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0 18px;
  flex-wrap: wrap;
}

.area__pin { font-size: 18px; }

.area__name {
  font-size: 19px;
  font-weight: 700;
}

.area__state {
  font-size: 13.5px;
  color: var(--muted);
}

/* ---- Status card ------------------------------------------------------ */

.status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.status-card__emoji {
  font-size: 40px;
  line-height: 1;
  display: block;
  margin-bottom: 10px;
}

.status-card__label {
  font-size: 22px;
  font-weight: 800;
}

.status-card.status--outage {
  background: #FBEDEC;
  border-color: #F0C6C2;
}
.status-card.status--outage .status-card__label { color: var(--outage-ink); }

.status-card.status--working {
  background: #EBF6EF;
  border-color: #C3E5D1;
}
.status-card.status--working .status-card__label { color: var(--restored-ink); }

.status-card.status--unknown {
  background: #FBF3E5;
  border-color: #EFD9AC;
}
.status-card.status--unknown .status-card__label { color: var(--unknown-ink); }

.status-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0 24px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Report buttons -----------------------------------------------------
   Structural guarantee: "جات" (restored) MUST render on the RIGHT and
   "قطعت" (outage) MUST render immediately to its LEFT, in this RTL
   document. We do not rely on source order for that guarantee — each
   button is placed explicitly via `order`, which is resolved against the
   inline-start/inline-end axis of the *document* direction (rtl), so
   order:1 sits at the visual right and order:2 sits at the visual left.
   ------------------------------------------------------------------- */

.report-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.report-btn {
  flex: 1 1 0;
  min-height: 76px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.report-btn:active { transform: scale(0.97); }

.report-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.report-btn:focus-visible {
  outline: 3px solid var(--night);
  outline-offset: 3px;
}

.report-btn__icon { font-size: 22px; }

.report-btn--restored {
  order: 1; /* visual right in RTL */
  background: var(--restored);
}
.report-btn--restored:hover:not(:disabled) { background: #1a8a4f; }

.report-btn--outage {
  order: 2; /* visual left in RTL */
  background: var(--outage);
}
.report-btn--outage:hover:not(:disabled) { background: #c23c33; }

.feedback {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
}

.feedback--pending { background: #EEEEE8; color: var(--muted); }
.feedback--ok { background: #EBF6EF; color: var(--restored-ink); }
.feedback--warn { background: #FBEFE0; color: var(--unknown-ink); }

/* ---- Secondary controls ------------------------------------------------ */

.secondary {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.link-btn {
  background: none;
  border: none;
  font-family: var(--font);
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
  cursor: pointer;
}
.link-btn:hover { color: var(--ink); }
.link-btn:focus-visible { outline: 2px solid var(--night); outline-offset: 2px; border-radius: 6px; }

.footer-links {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}
.footer-links a {
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

.disclaimer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

/* ---- Dialogs ------------------------------------------------------------ */

dialog {
  border: none;
  border-radius: var(--radius);
  max-width: 380px;
  width: calc(100% - 40px);
  padding: 20px;
  font-family: var(--font);
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(16, 24, 38, 0.45);
}

dialog h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

dialog p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}

dialog button {
  margin-top: 8px;
  background: var(--night);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
}

/* ---- Small screens ------------------------------------------------------ */

@media (max-width: 360px) {
  .report-btn { font-size: 17px; min-height: 68px; }
  .status-card__label { font-size: 20px; }
}

/* ---- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .report-btn { transition: none; }
}
