/* Astrabase — static frontend styles */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --base: #1b1b1b;
  --surface: #202020;
  --surface-2: #262626;
  --line: #2e2e2e;
  --ink: #ededed;
  --muted: #9a9a9a;
  --brand: #3ecf8e;
  --brand-dark: #2bbd7e;
  --danger: #ef4444;
  --amber: #f59e0b;
}

* {
  border-color: var(--line);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--base);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(62, 207, 142, 0.25);
  color: #fff;
}

/* Scrollbars */
.scrollbar-thin::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 9999px;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* ---------- Decorative backgrounds ---------- */
.bg-grid {
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 55%, transparent 100%);
}
.glow-green {
  box-shadow: 0 0 0 1px rgba(62, 207, 142, 0.2), 0 8px 40px -8px rgba(62, 207, 142, 0.35);
}
.text-gradient {
  background: linear-gradient(135deg, var(--ink) 30%, var(--brand) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Code window ---------- */
.code-window {
  background: #141414;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
}
.code-window pre {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}
.tok-muted { color: #6b7280; }
.tok-sky { color: #38bdf8; }
.tok-emerald { color: #34d399; }
.tok-pink { color: #f472b6; }
.tok-amber { color: #fbbf24; }
.tok-sky2 { color: #7dd3fc; }

/* ---------- Reusable component styles ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--brand);
  color: #0a1f14;
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
}
.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}
.btn-sm {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
}
.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

.input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--base);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input::placeholder {
  color: var(--muted);
}
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(62, 207, 142, 0.2);
}
.input-mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.badge-default { background: rgba(62, 207, 142, 0.12); color: var(--brand); }
.badge-success { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: var(--amber); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.badge-outline { border-color: var(--line); color: var(--muted); background: transparent; }

/* Switch */
.switch {
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 9999px;
  background: var(--ink);
  transition: transform 0.15s;
}
.switch[data-on="true"] {
  background: var(--brand);
  border-color: var(--brand);
}
.switch[data-on="true"]::after {
  transform: translateX(1rem);
  background: #0a1f14;
}

/* ---------- Animations ---------- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fade-in 0.5s ease-out both;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.ping-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: currentColor;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 240px;
  max-width: 360px;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: fade-in 0.2s ease-out;
}
.toast-success { border-color: rgba(62, 207, 142, 0.4); }
.toast-error { border-color: rgba(239, 68, 68, 0.4); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in 0.15s ease-out;
}
.modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-lg { max-width: 880px; }

/* Table data grid */
.data-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.data-grid th,
.data-grid td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-grid thead th {
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
  position: sticky;
  top: 0;
}
.data-grid tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.data-grid td.mono {
  font-family: "JetBrains Mono", monospace;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-null {
  color: #555;
}

/* Lucide icon sizing default */
[data-lucide] {
  width: 1rem;
  height: 1rem;
}
