@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');

/* ── Astrocamp Farben ─────────────────────────────────────────────────── */
:root {
  --ac-bg:        #293638;
  --ac-surface:   #1e2a2c;
  --ac-surface2:  #1a2426;
  --ac-border:    #3a5055;
  --ac-border2:   #4a6570;
  --ac-gold:      #009DD5;
  --ac-gold-dim:  #006e95;
  --ac-gold-glow: rgba(0,157,213,.15);
  --ac-text:      #FFF8E7;
  --ac-muted:     #a0b8bc;
  --ac-muted2:    #6a8a8e;
  --ac-blue:      #FF0000;
  --ac-blue-dim:  rgba(255,0,0,.12);
  --ac-green:     #7ec8a0;
  --ac-red:       #FF4444;
  --ac-mono:      'Space Mono', 'Courier New', monospace;
  --ac-sans:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ac-radius:    5px;
  --ac-font-base:  14px;
  --ac-font-label: 11px;
  --ac-font-input: 13px;
  --ac-font-btn:   13px;
  --ac-radius-lg: 5px;
  --row-h:        34px;
}

/* ── Wrapper ──────────────────────────────────────────────────────────── */
.astrodb-wrap {
  font-family: var(--ac-sans);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 900px;
  margin: 2em auto;
  color: inherit;
  box-shadow: none;
  position: relative;
  overflow: visible;
}
/* Sternfeld entfernt — Plugin integriert sich in Blog-Hintergrund */

/* ── Header ausgeblendet ──────────────────────────────────────────────── */
.astrodb-header {
  display: none;
}
.astrodb-icon {
  font-size: 1.6rem;
  color: var(--ac-gold);
  filter: drop-shadow(0 0 8px rgba(0,157,213,.5));
  animation: ac-pulse 4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes ac-pulse { 0%,100%{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.1)} }
.astrodb-header-text h2 {
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: .05em;
  margin: 0 0 2px;
  color: var(--ac-gold);
}
.astrodb-sub {
  font-family: var(--ac-mono);
  font-size: .8em;
  color: var(--ac-muted);
  margin: 0;
  letter-spacing: .05em;
}

/* ── Eingabezeile — ALLE Elemente gleich hoch ─────────────────────────── */
.astrodb-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.astrodb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.astrodb-field--object  { flex: 1 1 220px; }
.astrodb-field--catalog { flex: 0 1 270px; }

.astrodb-field label {
  font-size: var(--ac-font-label);
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #5a6e72;
}

/* Gemeinsame Basis für Input und Select */
.astrodb-field input,
.astrodb-field select {
  height: var(--row-h);
  box-sizing: border-box;
  font-family: var(--ac-sans);
  font-size: var(--ac-font-input);
  background: #FFF8E6;
  color: #2A3538;
  border: 1px solid #c8c0a8;
  border-radius: 5px;
  padding: 0 10px;
  outline: none;
  transition: border-color .2s, outline .2s;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.astrodb-field input::placeholder { color: #a0a896; }

/* Objektname-Textfeld explizit — verhindert Browser-Default-Weiss */
.astrodb-field input[type="text"]#astrodb-object {
  background: #FFF8E6 !important;
  color: #2A3538 !important;
  border: 1px solid #c8c0a8 !important;
  border-radius: 5px !important;
  font-size: 13px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}
.astrodb-field input:focus,
.astrodb-field select:focus {
  border-color: #009DD5;
  box-shadow: none;
  outline: 2px solid #009DD5;
  outline-offset: 1px;
}

.astrodb-field select {
  background-color: #FFF8E6;
  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='%232A3538' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
  color: #2A3538;
}

/* ── Button — gleiche Höhe ────────────────────────────────────────────── */
.astrodb-btn-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.astrodb-btn-wrap label {
  font-size: var(--ac-font-label);
  color: transparent;
  pointer-events: none;
  user-select: none;
  visibility: hidden;
}
.astrodb-btn {
  height: var(--row-h);
  box-sizing: border-box;
  font-family: var(--ac-sans);
  font-weight: 400;
  font-size: var(--ac-font-btn);
  background: #009DD4;
  color: #ffffff;
  border: 1px solid #009DD4;
  border-radius: 5px;
  padding: 6px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background .15s;
  box-shadow: none;
}
.astrodb-btn:hover  { background: #007fac; }
.astrodb-btn:active { background: #006a94; }
.astrodb-btn.loading .astrodb-btn-text { opacity: .5; }
.astrodb-spinner { display:none; width:14px; height:14px; border:2px solid rgba(255,255,255,.3); border-top-color:#ffffff; border-radius:50%; animation:ac-spin .7s linear infinite; }
@keyframes ac-spin { to { transform: rotate(360deg); } }
.astrodb-btn.loading .astrodb-spinner { display: block; }

/* ── Mode-Toggle (Raw / Formatiert) ────────────────────────────────────── */
.astrodb-mode-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.astrodb-mode-wrap label.mode-label {
  font-size: var(--ac-font-label);
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #5a6e72;
}
.astrodb-mode-toggle {
  height: var(--row-h);
  box-sizing: border-box;
  display: flex;
  background: var(--ac-surface2);
  border: 1px solid #c8c0a8;
  border-radius: var(--ac-radius);
  overflow: hidden;
  flex-shrink: 0;
}
.astrodb-mode-toggle button {
  flex: 1;
  background: none;
  border: none;
  color: #5a6e72;
  font-family: var(--ac-sans);
  font-size: var(--ac-font-btn);
  font-weight: 400;
  cursor: pointer;
  padding: 0 14px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.astrodb-mode-toggle button.active {
  background: #009DD5;
  color: #FFF8E7;
  font-weight: 700;
}
.astrodb-mode-toggle button:not(.active):hover {
  background: #e8dfc8;
  color: #2A3538;
}

/* ── Catalog Info ─────────────────────────────────────────────────────── */
.astrodb-catalog-info {
  font-family: var(--ac-sans);
  font-size: var(--ac-font-label);
  color: #FFF8E6;
  background: rgba(0,157,213,.06);
  border: 1px solid rgba(0,157,213,.18);
  border-radius: var(--ac-radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.55;
  min-height: 36px;
}
.astrodb-catalog-info strong { color: #009DD5; }

/* ── Output-Bereich ───────────────────────────────────────────────────── */
.astrodb-output-wrap {
  border: 1px solid #c8c0a8;
  border-radius: 5px;
  overflow: hidden;
}
.astrodb-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0eddf;
  border-bottom: 1px solid #c8c0a8;
  padding: 9px 16px;
  gap: 10px;
}
#astrodb-output-label {
  font-size: .85em;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ac-gold);
}
.astrodb-source-tag {
  font-family: var(--ac-mono);
  font-size: .8em;
  color: var(--ac-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Formatierte Tabelle ──────────────────────────────────────────────── */
.astrodb-output-table {
  background: var(--ac-bg);
  padding: 4px 0 12px;
}
.astrodb-section-heading {
  font-family: var(--ac-sans);
  font-size: .8em;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ac-gold);
  padding: 16px 20px 6px;
  border-top: 1px solid #c8c0a8;
  margin-top: 4px;
}
.astrodb-output-table .astrodb-section-heading:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 14px;
}
.astrodb-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ac-sans);
}
.astrodb-table tr {
  border-bottom: 1px solid rgba(200,192,168,.5);
  transition: background .12s;
}
.astrodb-table tr:last-child { border-bottom: none; }
.astrodb-table tr:hover { background: rgba(0,157,213,.04); }
.astrodb-td-label {
  color: var(--ac-muted);
  font-size: .9em;
  padding: 8px 16px 8px 20px;
  width: 38%;
  vertical-align: top;
  white-space: nowrap;
}
.astrodb-td-value {
  color: #FFF8E6;
  padding: 8px 20px 8px 0;
  vertical-align: top;
  word-break: break-word;
}
.astrodb-td-value.astrodb-empty { color: var(--ac-muted2); font-style: italic; }
.astrodb-td-value a { color: var(--ac-gold); text-decoration: none; }
.astrodb-td-value a:hover { text-decoration: underline; }

/* ── Raw-Ausgabe ──────────────────────────────────────────────────────── */
.astrodb-output-raw {
  font-family: var(--ac-mono);
  font-size: .9em;
  line-height: 1.65;
  background: #f5f2e8;
  color: rgba(255,248,230,.4);
  padding: 18px 20px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* ── Fehler ───────────────────────────────────────────────────────────── */
.astrodb-error {
  font-family: var(--ac-mono);
  font-size: .9em;
  color: var(--ac-red);
  padding: 20px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ── Hinweis ausgeblendet ─────────────────────────────────────────────── */
.astrodb-hint { display: none; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .astrodb-wrap { padding: 20px 16px; }
  .astrodb-input-row { flex-direction: column; }
  .astrodb-field--catalog,
  .astrodb-field--object { flex: 1 1 100%; }
  .astrodb-btn { width: 100%; justify-content: center; }
  .astrodb-mode-toggle { width: 100%; }
  .astrodb-td-label { width: 44%; font-size: .85em; white-space: normal; }
}

/* ── Berechnete Felder / Calculated fields ────────────────────────────── */
.astrodb-calc-legend {
  font-family: var(--ac-mono);
  font-size: .8em;
  color: var(--ac-muted);
  padding: 10px 20px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.astrodb-calc-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #009DD5;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 4px;
}
.astrodb-calc-badge {
  display: inline-block;
  margin-left: 8px;
  color: #009DD5;
  font-size: .85em;
  font-weight: 700;
  vertical-align: middle;
  cursor: default;
}
.astrodb-row-calc {
  background: rgba(0,157,213,.05);
}
.astrodb-row-calc .astrodb-td-label {
  color: #009DD5;
}
.astrodb-calc-value {
  color: #009DD5 !important;
  font-style: italic;
}
