/* --- Variables: Light Theme (Default) --- */
:root {
  --bg: #f8f9fa;
  --card: #ffffff;
  --card-soft: #f1f3f5;
  --border: #dee2e6;
  --text: #1a1d21;
  --text-muted: #64748b;
  --accent: #0d6efd;
  --accent-soft: rgba(13, 110, 253, 0.1);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* --- Automatischer Dark Mode (System-Default) & Manuelles Override --- */
@media (prefers-color-scheme: dark) {
  :root:not(.light-theme) {
    --bg: #0b0d10;
    --card: #141821;
    --card-soft: #1a2030;
    --border: #262c3a;
    --text: #e6e8ee;
    --text-muted: #94a3b8;
    --accent: #6ea8ff;
    --accent-soft: rgba(110, 168, 255, 0.15);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

/* Falls der User explizit Dark wählt (über JS Klasse) */
.dark-theme {
  --bg: #0b0d10;
  --card: #141821;
  --card-soft: #1a2030;
  --border: #262c3a;
  --text: #e6e8ee;
  --text-muted: #94a3b8;
  --accent: #6ea8ff;
  --accent-soft: rgba(110, 168, 255, 0.15);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  transition: background-color 0.3s ease;
  line-height: 1.5;
}

.wrap {
  padding-top: 10vh;
  padding-bottom: 20vh;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Typography --- */
header {
  margin-bottom: 20px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}

.progress {
  font-weight: 500;
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  /* Weichere Bento-Ecken */
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card.soft {
  background: var(--card-soft);
  border-style: dashed;
}

.card h3 {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
}

/* --- Forms --- */
label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 8px 4px;
  display: block;
}

select,
textarea,
.bento-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
}

/* Dropdown Arrow for Select & Bento Input */
select,
.bento-input {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

select:focus,
textarea:focus,
.bento-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--card);
}

/* --- Button Basis-Styling --- */
button {
  width: 100%;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Standard Light Mode */
  background: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.2);
  color: var(--accent);
  /* Hier stellen wir sicher, dass der Text blau ist */
}

button:hover:not(:disabled) {
  background: rgba(13, 110, 253, 0.15);
  border-color: var(--accent);
}

/* --- Dark Mode Anpassungen --- */
@media (prefers-color-scheme: dark) {
  :root:not(.light-theme) button {
    background: rgba(110, 168, 255, 0.1);
    border-color: rgba(110, 168, 255, 0.3);
    color: var(--accent);
    /* Nutzt das hellere Blau aus dem Dark-Theme */
  }
}

/* Explizites Dark-Theme Override */
.dark-theme button {
  background: rgba(110, 168, 255, 0.1);
  border-color: rgba(110, 168, 255, 0.3);
  color: var(--accent);
}

/* --- Der Primär-Button (Simulation) --- */
/* Dieser soll sich abheben, daher bekommt er einen soliden Hintergrund */
#simulate {
  background: var(--accent);
  color: #ffffff;
  /* Immer weißer Text auf blauem Grund */
  border: none;
  margin-top: 10px;
}

#simulate:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.1);
  box-shadow: 0 4px 12px var(--accent-soft);
}

#simulate:disabled {
  background: var(--card-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
  opacity: 0.6;
}

/* --- Specialized Components --- */
.pill {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.hint {
  margin-top: 12px;
  padding: 12px;
  background: var(--card-soft);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: auto;
  padding: 10px 18px;
  font-size: 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 100;
}

/* Debug Button Styling */
#debug-btn {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}

.dark #debug-btn {
  background: #422006;
  color: #fef08a;
  border-color: #713f12;
}

/* Custom Output Styling */
#out {
  font-family: inherit;
  font-size: 1rem;
}

.hidden {
  display: none;
}

/* Output Component Styles - extracted from inline styles */
.output-meta {
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 10px;
}

.output-section {
  padding: 12px;
  border: 1px solid rgba(110, 168, 255, 0.35);
  background: rgba(110, 168, 255, 0.10);
  border-radius: 12px;
}

.output-section-label {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.output-section-content {
  font-size: 1rem;
  line-height: 1.4;
}

.output-list {
  margin: 0 0 0 18px;
}

.output-list-spaced {
  margin: 10px 0 0 18px;
  color: var(--text-muted);
}

.output-block {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.output-block-spaced {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 10px;
}

.output-block-label {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.output-block-label-bold {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.output-section-spaced {
  margin-top: 14px;
}

.output-hint {
  margin-top: 10px;
}

/* Debug Button - additional positioning */
#debug-btn {
  right: 120px;
  background: #ffeaa7;
  color: #2d3436;
  border-color: #fdcb6e;
}

/* Utility spacers */
.spacer-sm {
  height: 12px;
}

.spacer-md {
  height: 20px;
}

/* Pre output */
.pre-output {
  white-space: pre-wrap;
  margin: 0;
  color: var(--text);
}


/* Versteckt den Standard-Pfeil der Datalist komplett */
.bento-input::-webkit-calendar-picker-indicator {
  display: none !important;
  opacity: 0;
}

/* Verhindert zusätzliche Pfeile in Edge */
.bento-input::-ms-expand {
  display: none;
}

/* Verhindert den Pfeil in Firefox (falls vorhanden) */
.bento-input {
  -moz-appearance: textfield;
}
