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

:root {
  --bg: #0f1117;
  --bg-surface: #1a1d27;
  --bg-hover: #232733;
  --text: #e2e4ea;
  --text-muted: #8b8fa3;
  --accent: #34d399;
  --accent-dim: #059669;
  --accent-glow: rgba(52, 211, 153, 0.15);
  --accent-blue: #818cf8;
  --border: #2a2e3a;
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.1);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.1);
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* Nav */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--border);
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.credits-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}
.credits-badge a, .upgrade-link { color: var(--accent-blue); text-decoration: none; font-weight: 500; }
.credits-badge a:hover, .upgrade-link:hover { color: var(--accent); }
.credits-zero { color: var(--error); font-weight: 500; }
.credits-replenish { font-size: 0.7rem; color: var(--text-muted); }

/* Main */
main {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  flex: 1;
}

.hero { text-align: center; margin-bottom: 1.5rem; }

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.subtitle { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.25rem; }

h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin-bottom: 0.5rem; }

/* Form */
form#search-form { margin-bottom: 1.5rem; }

.form-field { margin-bottom: 0.75rem; }
.form-field label, .field-label { display: block; font-weight: 500; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.25rem; }

textarea, input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.15s;
}
textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea::placeholder, input::placeholder { color: var(--text-muted); }

.char-count { text-align: right; font-size: 0.75rem; color: var(--text-muted); margin-top: -0.25rem; }

/* TLD selector */
.tld-selector { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }

.tld-btn {
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.tld-btn:hover { border-color: var(--accent-blue); color: var(--text); }
.tld-btn.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

/* Style selector */
.style-selector { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.75rem; }

.style-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.style-btn:hover { border-color: var(--accent-blue); color: var(--text); }
.style-btn.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

/* Length slider */
.length-slider-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.25rem; }
.length-display { font-size: 0.8rem; color: var(--text-muted); }

.length-slider {
  position: relative;
  height: 2rem;
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  user-select: none;
  touch-action: none;
}
.slider-track {
  position: absolute;
  left: 0; right: 0;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
}
.slider-fill {
  position: absolute;
  height: 100%;
  background: var(--accent-blue);
  border-radius: 3px;
}
.slider-thumb {
  position: absolute;
  width: 18px; height: 18px;
  background: var(--text);
  border: 2px solid var(--accent-blue);
  border-radius: 50%;
  transform: translateX(-50%);
  cursor: grab;
  z-index: 2;
  transition: transform 0.1s;
}
.slider-thumb:hover, .slider-thumb:active { transform: translateX(-50%) scale(1.15); }

/* Controls row */
.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.control-group { display: flex; align-items: center; gap: 0.35rem; }
.control-group .field-label { margin-bottom: 0; }

select {
  padding: 0.35rem 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
}
select:focus { outline: none; border-color: var(--accent); }

.toggle-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.toggle-btn.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

.filter-toggle {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0;
}
.filter-toggle:hover { color: var(--accent); }

/* Advanced filters */
#advanced-filters { margin-bottom: 0.75rem; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Buttons */
.button-row { display: flex; gap: 0.5rem; }

.primary-btn {
  flex: 1;
  padding: 0.65rem 1.5rem;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.primary-btn:hover { background: #6366f1; }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.secondary-btn {
  padding: 0.65rem 1rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.secondary-btn:hover { border-color: var(--accent); color: var(--text); }

/* Error / Success */
.error {
  color: var(--error);
  padding: 0.6rem 0.85rem;
  background: var(--error-bg);
  border-radius: 0.5rem;
  border: 1px solid rgba(248, 113, 113, 0.2);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.success {
  color: var(--accent);
  padding: 0.6rem 0.85rem;
  background: var(--accent-glow);
  border-radius: 0.5rem;
  border: 1px solid rgba(52, 211, 153, 0.2);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.info-banner {
  padding: 0.6rem 0.85rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.5rem;
  color: var(--accent-blue);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

/* Generating indicator */
.gen-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}
.gen-indicator p { color: var(--accent-blue); font-weight: 500; font-size: 0.9rem; margin: 0; }

.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(129, 140, 248, 0.3);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.spinner.small { width: 14px; height: 14px; border-width: 2px; }

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

/* Checking names */
.checking-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.name-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }

.name-tag {
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  animation: fadeIn 0.3s ease-out both;
}
.name-tag.pending { background: rgba(99, 102, 241, 0.15); color: var(--accent-blue); }
.name-tag.checked { background: var(--bg-hover); color: var(--text-muted); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Results */
.results-header {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

.tld-heading { color: var(--text-muted); margin-top: 1rem; margin-bottom: 0.35rem; }

.domain-list { list-style: none; margin-bottom: 0.5rem; }

.domain-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.domain-list li:hover { background: var(--bg-hover); }

.domain-left { display: flex; align-items: center; gap: 0.5rem; }

.domain-name { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 500; }

.fav-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
  transition: transform 0.15s;
}
.fav-btn:hover { transform: scale(1.15); }
.fav-btn.active { color: var(--warn); }

.register-btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 0.35rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
}
.register-btn:hover { background: var(--accent); color: var(--bg); }
.register-btn.small { font-size: 0.75rem; padding: 0.2rem 0.6rem; }

.no-results { text-align: center; color: var(--text-muted); padding: 2rem 0; }

/* Quick check */
.panel { margin-bottom: 0.75rem; }

.quick-check-row {
  display: flex;
  gap: 0.5rem;
}
.quick-check-row input {
  flex: 1;
}
.quick-check-row button {
  padding: 0.5rem 1rem;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.quick-check-row button:disabled { opacity: 0.5; }

.qc-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}
.qc-result.available { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.2); }
.qc-result.taken { background: var(--error-bg); border: 1px solid rgba(248, 113, 113, 0.2); }
.qc-left { display: flex; align-items: center; gap: 0.5rem; }
.qc-status { font-size: 0.8rem; font-weight: 500; }
.qc-result.available .qc-status { color: var(--accent); }
.qc-result.taken .qc-status { color: var(--error); }

/* Favorites panel */
.panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
}
.fav-toggle { background: var(--warn-bg); border-color: rgba(251, 191, 36, 0.3); color: var(--warn); }

.panel-body { padding: 0.5rem 0; }
.panel-body.collapsed { display: none; }

.fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.fav-left { display: flex; align-items: center; gap: 0.5rem; }

.arrow { color: var(--text-muted); font-size: 0.7rem; }

/* Session history */
.session-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin: 0.5rem 0 0.25rem 0.75rem; }
.session-label.available { color: var(--accent); }
.session-label.taken { color: var(--text-muted); }

.session-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0 0.75rem; margin-bottom: 0.5rem; }
.session-tag { padding: 0.15rem 0.5rem; border-radius: 0.25rem; font-size: 0.7rem; font-family: var(--font-mono); text-decoration: none; }
.session-tag.available { background: rgba(52, 211, 153, 0.1); color: var(--accent); }
.session-tag.available:hover { background: rgba(52, 211, 153, 0.2); }
.session-tag.taken { background: var(--bg-hover); color: var(--text-muted); text-decoration: line-through; }

/* Pricing (inline panel) */
.pricing-inline {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}
.pricing-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.pricing-header h2 { margin: 0; font-size: 1.15rem; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0; }
.close-btn:hover { color: var(--text); }

.pricing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.pricing-cards .card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-cards .card.featured { border-color: var(--accent-blue); }
.pricing-cards .card .badge {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-blue);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.card-header { text-align: center; margin-bottom: 0.5rem; }
.card-name { font-size: 0.9rem; font-weight: 600; }
.card .price { font-size: 1.75rem; font-weight: 700; }
.pricing-cards ul { list-style: none; margin-bottom: 0.75rem; flex: 1; }
.pricing-cards li { font-size: 0.75rem; color: var(--text-muted); padding: 0.15rem 0; }
.pricing-cards li::before { content: '\2713 '; color: var(--accent); font-weight: 600; }
.pricing-cards button {
  width: 100%;
  padding: 0.5rem;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.pricing-cards button:hover { background: #6366f1; }

.coupon-section { text-align: center; margin-top: 0.5rem; }
.link-btn { background: none; border: none; color: var(--accent-blue); font-size: 0.8rem; cursor: pointer; text-decoration: underline; font-family: var(--font-body); }
.coupon-row { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.5rem; }
.coupon-input { width: 10rem; text-align: center; font-family: var(--font-mono); text-transform: uppercase; font-size: 0.85rem; }
.coupon-row button { padding: 0.4rem 0.75rem; background: var(--accent-blue); color: #fff; border: none; border-radius: 0.4rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: var(--font-body); }
.coupon-error { color: var(--error); font-size: 0.8rem; margin-top: 0.25rem; }
.coupon-success { color: var(--accent); font-size: 0.8rem; margin-top: 0.25rem; }

/* Pricing page (standalone) */
.pricing-cards:not(.compact) { max-width: 720px; margin: 2rem auto; }
.pricing-cards:not(.compact) .card { padding: 1.5rem; }

.card h3 { margin-top: 0; font-size: 1.2rem; }
.card .price { margin-bottom: 0.5rem; }
.card ul { list-style: none; margin-bottom: 1rem; }
.card ul li { padding: 0.2rem 0; color: var(--text-muted); font-size: 0.85rem; }
.card ul li::before { content: '+ '; color: var(--accent); font-weight: 600; }
.card button, .card .btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.card button:hover, .card .btn:hover { background: var(--accent-dim); color: var(--text); }

.fine-print { text-align: center; color: var(--text-muted); font-size: 0.8rem; }

/* Agent & API sections */
.agents-section, .api-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.section-header { text-align: center; margin-bottom: 1.5rem; }
.section-header h2 { margin-bottom: 0.25rem; }

.agent-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.agent-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.agent-card h3 { font-size: 0.9rem; margin-bottom: 0.5rem; }
.agent-card p { font-size: 0.85rem; color: var(--text-muted); }
.agent-card pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  overflow-x: auto;
  margin-top: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.agent-card code { font-family: var(--font-mono); font-size: 0.75rem; }

.agent-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}
.agent-features strong { font-size: 0.85rem; }
.muted { color: var(--text-muted); font-size: 0.8rem; }

.api-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
}
.api-label { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.api-url { display: inline-block; background: var(--bg); border: 1px solid var(--border); padding: 0.35rem 0.75rem; border-radius: 0.5rem; font-size: 0.85rem; margin-bottom: 0.75rem; }

.api-endpoints { margin: 0.75rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.api-endpoints > div { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.85rem; }
.method { font-size: 0.7rem; font-family: var(--font-mono); font-weight: 600; padding: 0.15rem 0.4rem; border-radius: 0.25rem; }
.method.post { background: rgba(99, 102, 241, 0.15); color: var(--accent-blue); }
.method.get { background: rgba(52, 211, 153, 0.15); color: var(--accent); }

.api-card code { font-family: var(--font-mono); font-size: 0.8rem; }
.api-card p { font-size: 0.85rem; color: var(--text-muted); }

/* API docs page */
.api-docs pre {
  font-family: var(--font-mono); font-size: 0.8rem;
  background: var(--bg-surface); padding: 0.75rem 1rem;
  border-radius: 0.5rem; overflow-x: auto; margin-bottom: 0.75rem;
  border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word;
}
.api-docs code { font-family: var(--font-mono); font-size: 0.8rem; background: var(--bg-surface); padding: 0.1rem 0.3rem; border-radius: 0.2rem; }
.api-docs ul { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.api-docs li { margin-bottom: 0.25rem; }
.api-docs hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.api-docs table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.api-docs td { padding: 0.4rem 0.65rem; border: 1px solid var(--border); }
.api-docs td:first-child { font-family: var(--font-mono); font-weight: 600; width: 50px; }
.api-docs h2 { margin-top: 2rem; }
.api-docs h3 { margin-top: 1.25rem; }

/* Footer */
footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  max-width: 960px;
  width: 100%;
  margin: 2rem auto 0;
  text-align: center;
}
footer p { color: var(--text-muted); font-size: 0.8rem; }
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* Mobile */
@media (max-width: 640px) {
  nav, main, footer { padding-left: 1rem; padding-right: 1rem; }
  h1 { font-size: 1.4rem; }
  .pricing-cards { grid-template-columns: 1fr; }
  .agent-cards { grid-template-columns: 1fr; }
  .agent-features { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .controls-row { gap: 0.35rem; }
}
