/* ── AstroDB Queries – Stylesheet ─────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;600;800&display=swap');

:root {
  --adb-bg:        #0a0c14;
  --adb-surface:   #111522;
  --adb-border:    #1e2540;
  --adb-accent:    #5b8dee;
  --adb-accent2:   #a78bfa;
  --adb-gold:      #f0c060;
  --adb-text:      #cdd6f4;
  --adb-muted:     #6c7a9c;
  --adb-green:     #a6e3a1;
  --adb-radius:    10px;
  --adb-mono:      'Space Mono', monospace;
  --adb-sans:      'Syne', sans-serif;
}

/* Container */
.astrodb-wrap {
  font-family: var(--adb-sans);
  background: var(--adb-bg);
  border: 1px solid var(--adb-border);
  border-radius: 16px;
  padding: 36px 40px 32px;
  max-width: 860px;
  margin: 2em auto;
  color: var(--adb-text);
  box-shadow: 0 0 0 1px var(--adb-border), 0 24px 64px rgba(0,0,0,.55);
  position: relative;
  overflow: hidden;
}

/* Starfield background dot */
.astrodb-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 34%, rgba(255,255,255,.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 44% 72%, rgba(255,255,255,.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 91% 81%, rgba(255,255,255,.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 5%  55%, rgba(255,255,255,.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 61% 11%, rgba(255,255,255,.18) 0%, transparent 100%),
    radial-gradient(2px 2px at 33% 90%, rgba(160,180,255,.20) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.astrodb-wrap > * { position: relative; z-index: 1; }

/* Header */
.astrodb-header {
  text-align: center;
  margin-bottom: 32px;
}
.astrodb-icon {
  display: inline-block;
  font-size: 2rem;
  color: var(--adb-gold);
  filter: drop-shadow(0 0 8px rgba(240,192,96,.6));
  animation: adb-pulse 3s ease-in-out infinite;
}
@keyframes adb-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .7; transform: scale(1.12); }
}
.astrodb-header h2 {
  font-family: var(--adb-sans);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: .08em;
  margin: .25em 0 .2em;
  background: linear-gradient(120deg, var(--adb-accent), var(--adb-accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.astrodb-sub {
  color: var(--adb-muted);
  font-size: .875rem;
  margin: 0;
  font-family: var(--adb-mono);
}

/* Input row */
.astrodb-input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 14px;
}
.astrodb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 240px;
}
.astrodb-field--catalog { flex: 0 1 280px; }

.astrodb-field label {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--adb-muted);
}

.astrodb-field input,
.astrodb-field select {
  font-family: var(--adb-mono);
  font-size: .9rem;
  background: var(--adb-surface);
  color: var(--adb-text);
  border: 1px solid var(--adb-border);
  border-radius: var(--adb-radius);
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.astrodb-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c7a9c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.astrodb-field input:focus,
.astrodb-field select:focus {
  border-color: var(--adb-accent);
  box-shadow: 0 0 0 3px rgba(91,141,238,.2);
}
.astrodb-field input::placeholder { color: var(--adb-muted); }

/* Button */
.astrodb-btn {
  font-family: var(--adb-sans);
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .06em;
  background: linear-gradient(135deg, var(--adb-accent), var(--adb-accent2));
  color: #fff;
  border: none;
  border-radius: var(--adb-radius);
  padding: 11px 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: opacity .2s, transform .15s;
  align-self: flex-end;
  position: relative;
}
.astrodb-btn:hover  { opacity: .88; transform: translateY(-1px); }
.astrodb-btn:active { transform: translateY(0); }
.astrodb-btn.loading .astrodb-btn-text { opacity: .5; }

/* Spinner */
.astrodb-spinner {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: adb-spin .7s linear infinite;
}
@keyframes adb-spin { to { transform: rotate(360deg); } }
.astrodb-btn.loading .astrodb-spinner { display: block; }

/* Catalog info badge */
.astrodb-catalog-info {
  font-family: var(--adb-mono);
  font-size: .78rem;
  color: var(--adb-muted);
  background: rgba(91,141,238,.07);
  border: 1px solid rgba(91,141,238,.15);
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 34px;
  margin-bottom: 18px;
  line-height: 1.5;
  transition: opacity .3s;
}

/* Output area */
.astrodb-output-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--adb-border);
  border-radius: var(--adb-radius);
  overflow: hidden;
}
.astrodb-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--adb-surface);
  border-bottom: 1px solid var(--adb-border);
  padding: 8px 14px;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--adb-muted);
}
.astrodb-copy-btn {
  font-family: var(--adb-mono);
  font-size: .75rem;
  background: none;
  border: 1px solid var(--adb-border);
  color: var(--adb-muted);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.astrodb-copy-btn:hover { color: var(--adb-accent); border-color: var(--adb-accent); }

.astrodb-output {
  font-family: var(--adb-mono);
  font-size: .82rem;
  line-height: 1.65;
  background: #080b12;
  color: var(--adb-green);
  border: none;
  width: 100%;
  min-height: 280px;
  padding: 18px 20px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  white-space: pre;
  overflow-x: auto;
}
.astrodb-output::placeholder { color: #2e3850; }

/* Hint */
.astrodb-hint {
  font-family: var(--adb-mono);
  font-size: .75rem;
  color: var(--adb-muted);
  margin-top: 14px;
  text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
  .astrodb-wrap { padding: 24px 18px; }
  .astrodb-input-row { flex-direction: column; }
  .astrodb-field--catalog { flex: 1 1 100%; }
  .astrodb-btn { width: 100%; justify-content: center; }
}
