:root {
  --bg: #0b1220;
  --bg-elevated: #121c30;
  --border: #223049;
  --text: #e7edf7;
  --text-muted: #8ea0bd;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
}

.bolt {
  color: #fbbf24;
}

.badge {
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.hero {
  text-align: center;
  padding: 24px 0 12px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.hero p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.5;
}

.search-section {
  margin: 24px 0;
}

#search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
}

#search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.category h2 {
  font-size: 1rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

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

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s, border-color 0.15s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 1.6rem;
}

.card-body h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.card-body .route {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.card-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.try-btn {
  margin-top: auto;
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.try-btn:hover {
  background: var(--accent-hover);
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

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

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
}

.field-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 12px 0 6px;
}

.url-preview {
  background: #0b1424;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--text-muted);
}

#modal-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1424;
  color: var(--text);
  font-size: 0.95rem;
}

#modal-input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.btn-small {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.response-box {
  background: #0b1424;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.78rem;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 6px 0 0;
  color: #c9d6e8;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
}

.category {
  margin-bottom: 28px;
}
