/* Dark-theme overrides on top of ConciseCSS CDN — matches frontend/public/index.html palette */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.06);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --accent-blue: #4f8fff;
  --accent-cyan: #00d4ff;
  --accent-purple: #a855f7;
  --accent-green: #22c55e;
  --accent-orange: #f97316;
  --accent: var(--accent-blue);
  --accent-hover: var(--accent-cyan);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
}

body {
  margin: 0;
  padding: 1rem;
  background-color: var(--bg-primary);
  color: var(--text);
}

/* ── SPA Layout ── */
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text);
  min-height: 100vh;
}

/* ── Constellation Canvas ── */
#constellation-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Page background overlay ── */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(14,18,34,0.4) 0%, var(--bg-primary) 70%);
}

/* ── Page wrapper with fade-in ── */
.page-wrapper {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(12px);
  animation: pageIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Nav ── */

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  background: rgba(10,10,15,0.6);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
}

.container {
  max-width: 960px;
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.site-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  color: var(--accent);
}

.site-header p {
  margin: 0;
  color: var(--muted);
}

input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.search-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: stretch;
}

.search-form input[type="text"] {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.search-form button {
  padding: 0.85rem 1.25rem;
  font-size: 1.1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.search-form button:hover,
.search-form button:focus {
  background: var(--accent-hover);
}

.hint {
  color: var(--muted);
  text-align: center;
  margin-top: 2rem;
}

.htmx-indicator {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  color: var(--muted);
}

.htmx-request .htmx-indicator,
.htmx-indicator.htmx-request {
  display: flex;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.result-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.citation {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.llm-response {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.llm-response h1,
.llm-response h2,
.llm-response h3 {
  color: var(--accent-hover);
  margin-top: 0;
}

.llm-response p:last-child {
  margin-bottom: 0;
}

.svg-frame {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  margin: 0.75rem 0;
  overflow: auto;
}

.svg-frame object {
  width: 100%;
  min-height: 600px;
  display: block;
}

.reg-snippet {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text);
  overflow-x: auto;
  max-height: 400px;
}

details {
  margin-top: 1rem;
}

summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.site-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

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

.site-footer a:hover {
  text-decoration: underline;
}

.adminer-creds {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.adminer-creds strong {
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
