/* ============================================================
   BloodLink - style.css
   One stylesheet for the whole site.
   Palette: deep red for the brand, warm sand background,
   near-black ink for text.
   ============================================================ */

:root {
  --red: #c1272d;
  --red-dark: #a5212b;
  --ink: #251f21;
  --ink-2: #585254;
  --hairline: #eae9ea;
  --sand: #f4efec;
  --white: #ffffff;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-family: inherit; font-weight: 700; }
h1 { font-size: 2.4rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.6rem; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
p  { margin: 0 0 1rem; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.section { padding: 32px 0 8px; }
.lead { color: var(--ink-2); font-size: 1.1rem; }
.hidden { display: none !important; }

/* ---------- Header / navigation ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  margin-inline-end: auto;
  direction: ltr;
}
.drop {
  width: 14px;
  height: 14px;
  background: var(--red);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 8px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active { box-shadow: inset 0 -2px 0 var(--ink); }
.nav-links a.btn-nav { color: var(--white); }
.nav-links a.btn-nav:hover { color: var(--white); background: var(--red-dark); }
.nav-toggle {
  display: none;
  font-size: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--red-dark); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-nav { padding: 8px 16px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 48px 20px 24px;
}
.hero-text p { color: var(--ink-2); }
.hero-text .lead { color: var(--red); font-weight: 600; }
.hero-image img {
  width: 100%;
  border-radius: 16px;
  display: block;
}
.hero-image figcaption {
  color: var(--ink-2);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ---------- Cards (why it matters) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card p { margin: 0; color: var(--ink-2); }

/* ---------- Steps ---------- */
.steps { padding-inline-start: 22px; }
.steps li { margin-bottom: 12px; }

/* ---------- Call to action band ---------- */
.cta {
  background: var(--white);
  border-radius: var(--radius);
  text-align: center;
  padding: 40px 20px;
  margin: 32px auto;
}

/* ---------- Facts table (about / contact) ---------- */
.facts { border-collapse: collapse; width: 100%; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.facts th, .facts td { text-align: start; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.facts td[dir="ltr"] { text-align: left; }
.facts th { color: var(--ink-2); font-weight: 400; width: 180px; }

/* ---------- Checklist (about) ---------- */
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 8px 0; padding-inline-start: 28px; position: relative; }
.checklist li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 14px;
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 14px;
  max-width: 480px;
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.field { display: grid; gap: 6px; }
.field label { color: var(--ink-2); font-size: 0.95rem; }
.field input, .field textarea, .field select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid rgba(193, 39, 45, 0.25);
  border-color: var(--red);
}
.field textarea { min-height: 110px; resize: vertical; }

/* ---------- Tabs (sign in / sign up) ---------- */
.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tab {
  font: inherit;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--white);
  color: var(--ink-2);
  cursor: pointer;
}
.tab.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* ---------- Notices ---------- */
.notice {
  background: var(--white);
  border-inline-start: 4px solid var(--red);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 16px 0;
}
.notice-warning { background: #fdf6ee; border-inline-start-color: #e0a458; }
.notice a { color: var(--red); }

/* ---------- Blood types table ---------- */
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); }
.types-table { border-collapse: collapse; width: 100%; min-width: 560px; }
.types-table th, .types-table td { text-align: start; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.types-table td[dir="ltr"] { text-align: left; }
.types-table thead th { color: var(--ink-2); font-weight: 400; font-size: 0.9rem; }
.types-table .type { font-weight: 700; font-size: 1.1rem; }
.types-table .tag { color: var(--red); font-weight: 600; }

/* ---------- Simulated SMS confirmation ----------
   A phone screen shown after sign up and after a donation request.
   Pure front-end demo, no real SMS is sent. */
.sms-phone {
  width: 300px;
  max-width: 100%;
  margin: 22px auto 6px;
  background: #1c1a1b;
  border-radius: 34px;
  padding: 10px;
  box-shadow: 0 12px 28px rgba(37, 31, 33, 0.22);
  text-align: start;
}
.sms-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  padding: 2px 12px 8px;
}
.sms-icons { display: inline-flex; align-items: center; gap: 6px; }
.sms-signal {
  width: 14px;
  height: 9px;
  background: rgba(255, 255, 255, 0.85);
  clip-path: polygon(0 100%, 20% 100%, 20% 60%, 40% 60%, 40% 35%, 60% 35%, 60% 15%, 80% 15%, 80% 0, 100% 0, 100% 100%);
}
.sms-battery {
  width: 18px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  position: relative;
}
.sms-battery::after {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  inset-inline-start: 1px;
  width: 60%;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
}
.sms-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f5f4;
  padding: 10px 14px;
  border-radius: 24px 24px 0 0;
  border-bottom: 1px solid var(--hairline);
}
.sms-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drop-white { background: var(--white); width: 11px; height: 11px; }
.sms-sender { font-weight: 600; font-size: 0.9rem; }
.sms-header .sms-time { margin-inline-start: auto; color: var(--ink-2); font-weight: 400; font-size: 0.75rem; }
.sms-body { background: var(--white); padding: 14px 12px 18px; border-radius: 0 0 24px 24px; }
.sms-bubble {
  background: #e9f3ee;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 12px 6px;
  font-size: 0.92rem;
  line-height: 1.75;
  white-space: pre-wrap;
}
.sms-meta { display: block; margin-top: 4px; text-align: end; color: #6d8a79; font-size: 0.68rem; }
.sms-caption { color: rgba(255, 255, 255, 0.6); font-size: 0.7rem; text-align: center; padding: 8px 0 2px; }

.field input[dir="ltr"] { text-align: left; direction: ltr; }

/* ---------- Team list (about page) ---------- */
.team-list { list-style: none; padding: 0; }
.team-list li {
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 48px;
  padding: 24px 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  background: var(--white);
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .nav { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 4px;
    padding-bottom: 12px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; }
  .nav-links a.btn-nav { text-align: center; }
  .facts th { width: auto; display: block; border: none; padding-bottom: 0; }
  .facts td { display: block; padding-top: 4px; }
}

/* ---------- Hospitals page - صفحة المستشفيات المتاحة ---------- */
.filters {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.filters .field label { font-size: 0.9rem; }
.results-count { color: var(--ink-2); font-size: 0.95rem; margin: 14px 0 12px; }
.hospital-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.hospital-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}
.hospital-card h3 { margin-bottom: 4px; }
.hospital-meta { color: var(--ink-2); font-size: 0.92rem; margin: 0 0 6px; }
.hospital-meta .ltr { direction: ltr; unicode-bidi: embed; }
.status-chip {
  align-self: flex-start;
  font-size: 0.82rem;
  padding: 3px 12px;
  border-radius: 999px;
  margin: 6px 0 12px;
  background: #eef4ee;
  color: #2f6b3c;
  border: 1px solid #d5e6d7;
}
.status-chip.urgent { background: #fdecec; color: var(--red-dark); border-color: #f3c9c9; font-weight: 600; }
.chip-label { color: var(--ink-2); font-size: 0.85rem; margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.chip {
  font-size: 0.85rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--ink-2);
  border: 1px solid var(--hairline);
  direction: ltr;
  unicode-bidi: embed;
}
.chip.urgent { background: #fdecec; border-color: #f3c9c9; color: var(--red-dark); font-weight: 600; }
.chip.low { background: #fdf6ee; border-color: #f0dcc2; color: #8a5f1f; }
.hospital-card .btn { margin-top: auto; text-align: center; }
.empty-state {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--ink-2);
}

/* ---------- Points page - صفحة نقاطي ومكافآتي ---------- */
.points-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.points-top {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.points-total {
  font-size: 3rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}
.points-total span { font-size: 1rem; font-weight: 400; color: var(--ink-2); }
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sand);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.9rem;
  font-weight: 600;
}
.progress { height: 12px; background: var(--sand); border-radius: 999px; overflow: hidden; margin: 16px 0 8px; }
.progress-bar { height: 100%; background: var(--red); border-radius: 999px; transition: width 0.4s ease; }
.progress-note { color: var(--ink-2); font-size: 0.9rem; margin: 0; }
.badges {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.badges li {
  background: var(--sand);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.badges li.earned { background: #fdecec; color: var(--red-dark); font-weight: 600; }
.points-mini {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--sand);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.points-mini a { color: var(--red); font-weight: 600; }
