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

:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.5);
  --accent: #ec4899;
  --accent-glow: rgba(236, 72, 153, 0.5);
  --cyan: #06b6d4;
  --surface: rgba(30, 41, 59, 0.65);
  --surface-hover: rgba(51, 65, 85, 0.85);
  --bg: #0f172a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --ok: #10b981;
  --warn: #ef4444;
  --border: rgba(148, 163, 184, 0.15);
  --border-highlight: rgba(148, 163, 184, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}

/* Add a subtle pulsing animation to the background orbs */
@keyframes pulseGlow {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% -20%, rgba(6, 182, 212, 0.1), transparent 40%);
  pointer-events: none;
  z-index: -1;
  animation: pulseGlow 8s ease-in-out infinite alternate;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--cyan);
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: #fff;
  text-shadow: none;
}

.brand .logo {
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
  transition: transform 0.3s ease;
}

.brand:hover .logo {
  transform: rotate(-10deg) scale(1.05);
}

.nav {
  display: flex;
  gap: 24px;
  font-weight: 600;
}

.nav a {
  color: var(--muted);
}

.nav a:hover, .nav a.active {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.main {
  padding: 40px 0 80px;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  border-color: var(--border-highlight);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.muted {
  color: var(--muted);
  font-size: 1.1rem;
}

form.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

form.grid .full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.95rem;
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}

input,
textarea,
select,
button {
  font: inherit;
  outline: none;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text);
  padding: 14px 16px;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
}

input::placeholder,
textarea::placeholder {
  color: #475569;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 15px var(--primary-glow);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  letter-spacing: 0.02em;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px var(--primary-glow);
  color: #fff;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-highlight);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn.accent {
  background: linear-gradient(135deg, var(--accent), #db2777);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn.accent:hover {
  box-shadow: 0 8px 25px var(--accent-glow);
}

.btn.danger {
  background: linear-gradient(135deg, var(--warn), #dc2626);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.icon-link,
.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.icon-link svg,
.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

.icon-link:hover,
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-highlight);
  background: var(--surface-hover);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.bookmark-link {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.1);
}

.bookmark-link.saved {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.bookmark-link:hover, .bookmark-link.saved:hover {
  filter: brightness(1.2);
}

.delete-link {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
}

.delete-link:hover {
  color: #fff;
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.inline-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.alert {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert.success {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.sort-panel {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-panel select {
  width: auto;
  max-width: 240px;
}

.domain-card {
  display: flex;
  flex-direction: column;
}

.domain-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.domain-meta {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.status-list {
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  flex-grow: 1;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.4);
}

.pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill.available {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.pill.unavailable,
.pill.regthroughothers,
.pill.taken {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 14px 12px;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metrics {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.metric {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: rgba(30, 41, 59, 0.7);
}

.metric .label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric .value {
  margin-top: 8px;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer {
  margin-top: 60px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding-bottom: 20px;
}

code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  color: var(--cyan);
}

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

  .topbar-inner {
    min-height: 60px;
  }

  .nav {
    gap: 16px;
    font-size: 0.95rem;
  }
}

.api-lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.lab-card form {
  display: grid;
  gap: 14px;
}

.code-block {
  margin: 12px 0 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: #020617;
  color: #cbd5e1;
  padding: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  min-height: 140px;
  overflow: auto;
  font-family: monospace;
}

.lab-status {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.lab-status.ok {
  color: #34d399;
}

.lab-status.err {
  color: #f87171;
}

/* Animations loading state etc */
.loading {
  position: relative;
  opacity: 0.8;
  pointer-events: none;
}
.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}
