/* ═══════════════════════════════════════════════════════════════════════
   DomainSpectre — app.css
   Global component styles (Tailwind utilities are in index.html config)
   ══════════════════════════════════════════════════════════════════════ */

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

:root {
  --brand: #2bffad;
  --surface-900: #0a0a0b;
  --surface-800: #111113;
  --surface-700: #18181b;
  --surface-600: #27272a;
}

html { scroll-behavior: smooth; }

body {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Light mode overrides */
html:not(.dark) body {
  background-color: #f4f4f5;
  color: #18181b;
}
html:not(.dark) .card { background: #ffffff; border-color: #e4e4e7; }
html:not(.dark) .card { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
html:not(.dark) textarea,
html:not(.dark) input[type="text"] {
  background: #f9f9fa;
  border-color: #d4d4d8;
  color: #18181b;
}
html:not(.dark) textarea::placeholder,
html:not(.dark) input[type="text"]::placeholder { color: #a1a1aa; }
html:not(.dark) .results-table thead tr { background: #f4f4f5; }
html:not(.dark) .results-table tbody tr:hover { background: #f9f9fa; }
html:not(.dark) .metric-card { background: #ffffff; border-color: #e4e4e7; }
html:not(.dark) .nav-tab.active { color: #0a0a0b; }
html:not(.dark) #app-header { background: rgba(255,255,255,0.85); border-color: #e4e4e7; }
html:not(.dark) .btn-ghost { border-color: #d4d4d8; color: #52525b; }
html:not(.dark) .btn-ghost:hover { border-color: #a1a1aa; color: #18181b; background: #f4f4f5; }

/* ─── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: #111113;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 20px;
}

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #2bffad, #00c975);
  color: #0a0a0b;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 0 0 0 rgba(43,255,173,0);
  white-space: nowrap;
  user-select: none;
}
.btn-primary:hover  { opacity: 0.92; box-shadow: 0 0 20px rgba(43,255,173,0.25); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: transparent;
  color: #a1a1aa;
  font-size: 0.813rem;
  font-weight: 500;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  user-select: none;
}
.btn-ghost:hover  { border-color: #71717a; color: #e4e4e7; background: #18181b; }
.btn-ghost:active { transform: scale(0.97); }

/* ─── Nav Tabs ──────────────────────────────────────────────────────── */
.nav-tab {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 0.813rem;
  font-weight: 500;
  color: #71717a;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  user-select: none;
}
.nav-tab:hover  { color: #e4e4e7; background: #27272a; }
.nav-tab.active { color: #fff; background: #27272a; }

.nav-tab-mobile {
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #71717a;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
  user-select: none;
  width: 100%;
}
.nav-tab-mobile:hover  { color: #e4e4e7; background: #27272a; }
.nav-tab-mobile.active { color: #fff; background: #27272a; }

/* ─── Section Title ─────────────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e4e4e7;
  letter-spacing: -0.01em;
}

/* ─── Metric Cards ──────────────────────────────────────────────────── */
.metric-card {
  background: #111113;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 14px 16px;
}
.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  color: #fff;
  margin-bottom: 4px;
}
.metric-label {
  font-size: 0.75rem;
  color: #71717a;
  font-weight: 500;
}

/* ─── Results Table ─────────────────────────────────────────────────── */
.results-table { border-collapse: collapse; }
.results-table tbody tr {
  border-bottom: 1px solid #27272a;
  transition: background 0.1s;
}
.results-table tbody tr:last-child { border-bottom: none; }
.results-table tbody tr:hover { background: #18181b; }

/* ─── Status Badges ─────────────────────────────────────────────────── */
.badge-avail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(43,255,173,0.12);
  border: 1px solid rgba(43,255,173,0.3);
  border-radius: 999px;
  color: #2bffad;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-taken {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 999px;
  color: #f87171;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 999px;
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(161,161,170,0.1);
  border: 1px solid rgba(161,161,170,0.2);
  border-radius: 999px;
  color: #71717a;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-error {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 999px;
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── SEO Score Ring ─────────────────────────────────────────────────── */
.seo-ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}
.seo-ring-wrap svg { transform: rotate(-90deg); }
.seo-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Scoring Bar ────────────────────────────────────────────────────── */
.score-bar-track {
  width: 100%;
  height: 6px;
  background: #27272a;
  border-radius: 999px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Coupon Cards ──────────────────────────────────────────────────── */
.coupon-card {
  background: #111113;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.coupon-card:hover {
  border-color: #52525b;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.coupon-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.coupon-card.porkbun::before  { background: linear-gradient(90deg, #ff6b9d, #ff8c42); }
.coupon-card.cloudflare::before { background: linear-gradient(90deg, #f38020, #fbad41); }
.coupon-card.namecheap::before { background: linear-gradient(90deg, #de4200, #ff6b00); }
.coupon-card.spaceship::before { background: linear-gradient(90deg, #5b5ef4, #8b5cf6); }
.coupon-card.google::before   { background: linear-gradient(90deg, #4285f4, #34a853); }
.coupon-card.dynadot::before  { background: linear-gradient(90deg, #0ea5e9, #22d3ee); }

.coupon-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  background: #27272a;
  border: 1px dashed #52525b;
  border-radius: 6px;
  padding: 6px 12px;
  color: #2bffad;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.coupon-code:hover { background: #3f3f46; border-color: #71717a; }

/* ─── Hosting Cards ─────────────────────────────────────────────────── */
.hosting-card {
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s;
}
.hosting-card:hover { border-color: #52525b; }

/* ─── Pricing Table ─────────────────────────────────────────────────── */
.pricing-table { border-collapse: collapse; width: 100%; }
.pricing-table th, .pricing-table td {
  padding: 10px 14px;
  font-size: 0.813rem;
  text-align: left;
  border-bottom: 1px solid #27272a;
}
.pricing-table thead th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #71717a;
  background: #18181b;
}
.pricing-table tbody tr:last-child td { border-bottom: none; }
.pricing-table tbody tr:hover td { background: #18181b; }

/* ─── RDAP Detail Grid ───────────────────────────────────────────────── */
.rdap-field { display: flex; flex-direction: column; gap: 3px; }
.rdap-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #52525b; font-weight: 600; }
.rdap-value { font-size: 0.8rem; font-family: 'JetBrains Mono', monospace; color: #e4e4e7; word-break: break-all; }

/* ─── Audit Result ───────────────────────────────────────────────────── */
.audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.audit-cell {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 12px;
}
.audit-cell-label { font-size: 0.7rem; color: #52525b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.audit-cell-value { font-size: 0.85rem; font-family: 'JetBrains Mono', monospace; color: #e4e4e7; }

/* ─── Alt TLD Cards ─────────────────────────────────────────────────── */
.alt-tld-card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.alt-tld-card:hover { border-color: #52525b; background: #1c1c1f; }
.alt-tld-card.avail { border-color: rgba(43,255,173,0.3); background: rgba(43,255,173,0.05); }
.alt-tld-card.taken { border-color: rgba(239,68,68,0.25); background: rgba(239,68,68,0.04); }

/* ─── Spinner ────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #3f3f46;
  border-top-color: #2bffad;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111113; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* ─── Selection ──────────────────────────────────────────────────────── */
::selection { background: rgba(43,255,173,0.25); color: #fff; }

/* ─── Tooltip ────────────────────────────────────────────────────────── */
.tooltip-wrap { position: relative; }
.tooltip-content {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1c1c1f;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 200px;
  max-width: 280px;
  font-size: 0.75rem;
  color: #d4d4d8;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 999;
  white-space: normal;
}
.tooltip-wrap:hover .tooltip-content { opacity: 1; }

/* ─── Promo Badge ────────────────────────────────────────────────────── */
.promo-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fbbf24;
}
.promo-badge.hot {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #f87171;
}
.promo-badge.new {
  background: rgba(43,255,173,0.12);
  border-color: rgba(43,255,173,0.3);
  color: #2bffad;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card { padding: 14px; }
  .metric-value { font-size: 1.4rem; }
  .results-table th:nth-child(5),
  .results-table td:nth-child(5),
  .results-table th:nth-child(6),
  .results-table td:nth-child(6) { display: none; }
}
