/* ===== Observatory Edge — DNS Module ===== */
/* Design system mirrors the booking app for visual consistency */

/* ===== Design Tokens ===== */
:root {
  --bg-dark: #0f172a;
  --bg-surface: #1e293b;
  --bg-inset: #111827;
  --border: #334155;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-subtle: rgba(59, 130, 246, 0.08);
  --success: #22c55e;
  --success-subtle: rgba(34, 197, 94, 0.15);
  --error: #ef4444;
  --error-subtle: rgba(239, 68, 68, 0.15);
  --warning: #eab308;
  --warning-subtle: rgba(234, 179, 8, 0.15);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-on-accent: #ffffff;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius-sm: 4px;
  --radius-card: 12px;
  --radius-button: 8px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);

  --z-header: 100;
  --z-toast: 10000;

  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;

  --container-max: 1200px;
}

/* ===== Light Theme ===== */
[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-surface: #ffffff;
  --bg-inset: #eef2f7;
  --border: #d1d9e6;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --success: #15803d;
  --success-subtle: rgba(22, 163, 74, 0.12);
  --error: #dc2626;
  --error-subtle: rgba(220, 38, 38, 0.1);
  --warning: #a16207;
  --warning-subtle: rgba(161, 98, 7, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #475569;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--font-mono); font-size: 0.875em; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-secondary { color: var(--text-secondary); }

/* ===== Skip to Content ===== */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-button);
  z-index: 10001;
  font-weight: 600;
}
.skip-to-content:focus { top: 1rem; }

/* ===== Header ===== */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-button);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.nav-btn:hover { background: var(--accent-subtle); color: var(--text-primary); text-decoration: none; }
.nav-btn--active { color: var(--accent); }
.nav-btn--icon { padding: 0.375rem; }
.nav-btn__icon { flex-shrink: 0; }

.nav-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--border);
  margin: 0 0.25rem;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .main-nav.nav-open { display: flex; }
  .nav-divider { display: none; }
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 3rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-align: center;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-button);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }

.btn-secondary {
  background: var(--bg-inset);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-surface); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--bg-inset); color: var(--text-primary); }

.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}
.btn-danger:hover { opacity: 0.9; }

.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.125rem 0.5rem; font-size: 0.75rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== Forms ===== */
.input {
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition-fast);
}
.input:focus { border-color: var(--accent); }
.input--select { min-width: 80px; }
.input--sm { width: 80px; }

.form-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ===== Panels ===== */
.portal-hero {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}
.portal-hero h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }

.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.panel--wide { grid-column: 1 / -1; }

.panel__title {
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-inset);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-inset);
}
.panel__header .panel__title { padding: 0; border: none; background: none; }

.panel__body { padding: 1rem; }

.panel__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .portal-grid { grid-template-columns: 1fr; }
}

/* ===== Tables ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tbody tr:hover { background: var(--accent-subtle); }
.data-table--compact th,
.data-table--compact td { padding: 0.25rem 0.5rem; }

.content-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kv-table {
  width: 100%;
  font-size: 0.8125rem;
}
.kv-table td {
  padding: 0.375rem 0;
  vertical-align: top;
}
.kv-table td:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  width: 140px;
  white-space: nowrap;
  padding-right: 1rem;
}

/* ===== Record Type Badge ===== */
.record-type-badge {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ===== Status Dots ===== */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
}
.status-dot--green { background: var(--success); }
.status-dot--yellow { background: var(--warning); }
.status-dot--red { background: var(--error); }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge--success { background: var(--success-subtle); color: var(--success); }
.badge--warning { background: var(--warning-subtle); color: var(--warning); }
.badge--error { background: var(--error-subtle); color: var(--error); }

/* ===== Result Box ===== */
.result-box {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
}
.result-box--success { border-color: var(--success); background: var(--success-subtle); }
.result-box--error { border-color: var(--error); background: var(--error-subtle); }

/* ===== Loading ===== */
.loading-spinner {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 1rem 0;
}
.loading-spinner::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Error ===== */
.error { color: var(--error); }

/* ===== Dig Result ===== */
.dig-result { font-size: 0.8125rem; }
.dig-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* ===== Demo Page ===== */
.demo-hero {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-inset) 100%);
  padding: 4rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.demo-hero h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.demo-subtitle {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-secondary);
  line-height: 1.7;
}

.demo-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.demo-metadata {
  padding: 3rem 0;
}
.demo-metadata h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.metadata-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1rem;
}
.metadata-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.metadata-card__value {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  word-break: break-all;
}
.metadata-card__desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ===== Explanation Section ===== */
.demo-explanation {
  padding: 3rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}
.demo-explanation h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.step {
  padding: 1.25rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--text-on-accent);
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.step h3 {
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
}
.step p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.demo-cta {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.625rem 1rem;
  border-radius: var(--radius-button);
  font-size: 0.8125rem;
  font-weight: 500;
  animation: toast-in 0.2s ease, toast-out 0.3s ease 3.5s forwards;
  box-shadow: var(--shadow-md);
}
.toast--info { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-primary); }
.toast--success { background: var(--success); color: #fff; }
.toast--error { background: var(--error); color: #fff; }

@keyframes toast-in { from { transform: translateY(1rem); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(1rem); opacity: 0; } }

/* ===== Details ===== */
details summary {
  cursor: pointer;
  font-size: 0.8125rem;
  padding: 0.375rem 0;
}
details summary:hover { color: var(--text-primary); }
