@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Sora:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #ff6b35;
  --primary-glow: rgba(255, 107, 53, 0.3);
  --secondary: #004e89;
  --accent: #1a1a2e;
  --surface: #16213e;
  --surface-strong: #101b38;
  --surface-light: rgba(148, 163, 184, 0.1);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Sora', sans-serif;
  background-color: #0b1120;
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  filter: blur(0);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -140px;
  left: -120px;
  background: radial-gradient(circle at center, rgba(255, 107, 53, 0.35), transparent 70%);
}

body::after {
  bottom: -180px;
  right: -140px;
  background: radial-gradient(circle at center, rgba(0, 78, 137, 0.35), transparent 70%);
}

.font-display {
  font-family: 'Space Grotesk', sans-serif;
}

.bg-surface {
  background-color: var(--surface);
}

.bg-surface-strong {
  background-color: var(--surface-strong);
}

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

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

.border-surface {
  border-color: rgba(148, 163, 184, 0.15);
}

.glass-card {
  background: rgba(22, 33, 62, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.15);
  backdrop-filter: blur(12px);
}

.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -24px rgba(255, 107, 53, 0.6);
}

.gradient-text {
  background: linear-gradient(135deg, #ff6b35 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glass-effect {
  background: rgba(22, 33, 62, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-primary {
  background-color: var(--primary);
}

.bg-primary\/20 {
  background-color: rgba(255, 107, 53, 0.2);
}

.border-primary {
  border-color: var(--primary);
}

.focus\:border-primary:focus {
  border-color: var(--primary);
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes slideUp {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.sidebar-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 768px) {
  .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  color: var(--muted);
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #f8fafc;
}

.nav-link.is-active {
  background: rgba(255, 107, 53, 0.15);
  color: #f97316;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.3);
}

.nav-link.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-dark {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f8fafc;
}

.input-dark::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.ahrefs-mode-card {
  box-shadow: inset 0 0 0 1px transparent;
}

.ahrefs-mode-card.is-selected {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35), 0 0 22px rgba(59, 130, 246, 0.18);
}

.ahrefs-mode-card.is-selected .ahrefs-mode-indicator {
  background: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.55);
}

.ahrefs-mode-card.is-selected .ahrefs-mode-indicator-dot {
  opacity: 1;
}

.ahrefs-mode-card[data-mode-card="pool_shadow"].is-selected {
  border-color: rgba(245, 158, 11, 0.75);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.32), 0 0 22px rgba(245, 158, 11, 0.16);
}

.ahrefs-mode-card[data-mode-card="pool_shadow"].is-selected .ahrefs-mode-indicator {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.55);
}

.ahrefs-mode-card[data-mode-card="pool"].is-selected {
  border-color: rgba(16, 185, 129, 0.75);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.32), 0 0 22px rgba(16, 185, 129, 0.16);
}

.ahrefs-mode-card[data-mode-card="pool"].is-selected .ahrefs-mode-indicator {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.55);
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b35 0%, #f59e0b 100%);
  color: #0b1120;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -20px rgba(255, 107, 53, 0.8);
}

.btn-outline {
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 10px 18px;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: rgba(255, 107, 53, 0.5);
  color: #f97316;
}

.table-dark {
  width: 100%;
  border-collapse: collapse;
}

.table-dark th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 12px 16px;
}

.table-dark td {
  padding: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.table-dark tr:hover {
  background: rgba(148, 163, 184, 0.06);
}

/* Scrollbar styling */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: rgba(148, 163, 184, 0.55);
}

.scrollbar-surface::-webkit-scrollbar-track {
  background-color: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
}

@media (max-width: 640px) {
  .hide-sm {
    display: none;
  }
}
/* Utilities for premium design */
.tabular-nums { font-variant-numeric: tabular-nums; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-widest { letter-spacing: 0.1em; }
.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shadow-glow-primary {
  box-shadow: 0 0 20px var(--primary-glow);
}

.ring-1 { box-shadow: 0 0 0 1px currentColor; }
.ring-offset-slate-900 { --tw-ring-offset-width: 2px; --tw-ring-offset-color: #0f172a; }

.transition-all { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-transform { transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-opacity { transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1); }

.shrink-0 { flex-shrink: 0; }

.appearance-none {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Custom components */
.details-row {
  transition: all 0.3s ease;
}

.details-row.hidden {
  display: none;
}

/* Grid & Layout helpers if missing */
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }

.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }

.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-24 { width: 6rem; }

.bg-orange-500\/10 { background-color: rgba(249, 115, 22, 0.1); }
.bg-sky-500\/10 { background-color: rgba(14, 165, 233, 0.1); }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-slate-900\/30 { background-color: rgba(15, 23, 42, 0.3); }
.bg-slate-900\/40 { background-color: rgba(15, 23, 42, 0.4); }
.bg-slate-900\/50 { background-color: rgba(15, 23, 42, 0.5); }
.bg-slate-900\/60 { background-color: rgba(15, 23, 42, 0.6); }
.bg-slate-900\/80 { background-color: rgba(15, 23, 42, 0.8); }

.border-orange-500\/20 { border-color: rgba(249, 115, 22, 0.2); }
.border-sky-500\/20 { border-color: rgba(14, 165, 233, 0.2); }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }
.border-red-500\/20 { border-color: rgba(239, 68, 68, 0.2); }
.border-amber-500\/20 { border-color: rgba(245, 158, 11, 0.2); }
.border-surface\/50 { border-color: rgba(148, 163, 184, 0.07); }

.text-orange-400 { color: #fb923c; }
.text-orange-500 { color: #f97316; }
.text-sky-300 { color: #7dd3fc; }
.text-sky-400 { color: #38bdf8; }
.text-emerald-300 { color: #6ee7b7; }
.text-red-400 { color: #f87171; }
.text-amber-400 { color: #fbbf24; }

.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:opacity-20 { opacity: 0.2; }
