/* Shared styles for Azure Regional Availability Tracker */

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}

/* ── Header ─────────────────────────────────────────── */
header {
  background: #0f172a;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
header h1 { margin: 0; font-size: 1.25rem; }

/* ── Nav ─────────────────────────────────────────────── */
nav {
  background: #1e293b;
  padding: 0.5rem 2rem;
  display: flex;
  gap: 1.5rem;
}
nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
nav a:hover, nav a.active { color: white; border-bottom-color: #60a5fa; }

/* ── Main content ────────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── Footer ──────────────────────────────────────────── */
footer {
  padding: 2rem;
  color: #64748b;
  font-size: 0.85rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
footer p { margin: 0 0 0.75rem; text-align: center; }
footer p:last-child { margin-bottom: 0; }
footer .disclaimer {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  text-align: left;
}
footer code {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}

/* ── Overview / region cards ─────────────────────────── */
.intro { color: #475569; max-width: 700px; margin-bottom: 0.5rem; }
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.region-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.1s;
  display: block;
}
.region-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.region-card h3 { margin: 0 0 1rem; font-size: 1.1rem; color: #1d4ed8; }
.region-stats { display: flex; gap: 1rem; }
.stat { flex: 1; }
.stat .value { font-size: 1.3rem; font-weight: 700; color: #0f172a; }
.stat .label { font-size: 0.75rem; color: #64748b; margin-top: 0.2rem; }
.last-updated { font-size: 0.75rem; color: #94a3b8; margin-top: 1rem; }
.no-data { color: #f59e0b; font-size: 0.8rem; margin-top: 0.5rem; }

/* ── Per-region page ─────────────────────────────────── */
h2 { margin-top: 0; }
.breadcrumb { color: #64748b; font-size: 0.9rem; margin-bottom: 1rem; }
.breadcrumb a { color: #2563eb; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
}
.tab {
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; font-weight: 600; }
.tab:hover { color: #1d4ed8; }

.section { display: none; }
.section.visible { display: block; }

/* ── Loading / error states ──────────────────────────── */
.loading { color: #64748b; font-style: italic; padding: 2rem 0; }
.error { color: #dc2626; padding: 2rem 0; }

/* ── Stats grid (retail prices) ──────────────────────── */
.meta { color: #64748b; font-size: 0.85rem; margin-bottom: 1.5rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: #2563eb; }
.stat-card .label { font-size: 0.8rem; color: #64748b; margin-top: 0.25rem; }

/* ── Search bar ───────────────────────────────────────── */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.search-input {
  flex: 1 1 260px;
  min-width: 200px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #1e293b;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder { color: #94a3b8; }
.search-input:hover { border-color: #cbd5e1; }
.search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-input[type="search"] { -webkit-appearance: none; appearance: none; }

.expand-all-btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.expand-all-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1d4ed8;
}
.expand-all-btn:active { background: #e2e8f0; }

.diff-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.diff-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
  cursor: pointer;
}

/* ── Family sections ─────────────────────────────────── */
.family-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.family-section.expanded { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

.family-toggle {
  font-size: 1rem;
  background: #f1f5f9;
  padding: 0.6rem 1rem;
  margin: 0;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.1s;
}
.family-toggle:hover { background: #e2e8f0; }
.family-section.expanded > .family-toggle { border-bottom: 1px solid #e2e8f0; }

.family-toggle .chevron {
  color: #64748b;
  font-size: 0.8rem;
  width: 0.9rem;
  flex-shrink: 0;
}
.family-toggle .family-name { flex: 1; }
.family-toggle .count { font-size: 0.8rem; color: #64748b; font-weight: 400; }
.family-toggle .diff-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.family-body { padding: 1rem; }
.family-body table { margin-bottom: 0; box-shadow: none; }

/* ── Pagination ───────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}
.page-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.page-btn:hover:not(:disabled) { background: #eff6ff; border-color: #bfdbfe; }
.page-btn:disabled { color: #cbd5e1; cursor: not-allowed; }
.page-info { font-size: 0.78rem; color: #64748b; }

/* ── Tables ──────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
}
th {
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}
td { padding: 0.4rem 0.75rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.price { font-variant-numeric: tabular-nums; text-align: right; }
.empty-msg { color: #94a3b8; font-style: italic; margin-top: 1rem; }

/* ── Compute SKU availability badges ─────────────────── */
.restriction-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: #475569;
}
.legend-item { display: flex; align-items: center; gap: 0.4rem; }

.capacity-note {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  color: #1e40af;
  line-height: 1.5;
}
.capacity-note code {
  background: rgba(255,255,255,0.6);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}
.badge-available {
  background: #dcfce7;
  color: #15803d;
}
.badge-restricted {
  background: #fef3c7;
  color: #b45309;
}
.badge-unavailable {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-not-listed {
  background: #f1f5f9;
  color: #64748b;
}
.badge-unknown {
  background: #e0e7ff;
  color: #4338ca;
}
.restriction-detail {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

/* ── Compare page ─────────────────────────────────────── */
.compare-table th:not(:first-child),
.compare-table td:not(:first-child) {
  text-align: center;
}
.cmp-cell { white-space: nowrap; }
.cmp-cell.cmp-missing {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.78rem;
}
.cmp-name { font-weight: 600; color: #1e293b; }
.cmp-sub { font-size: 0.76rem; color: #64748b; margin-top: 0.1rem; }

tr.diff-row td { background: #fffbeb; }
tr.diff-row:hover td { background: #fef3c7; }
