/* assets/style.css */
/* Basis */
:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-contrast: #ffffff;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 1px 2px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --spacing: 16px;
  --spacing-sm: 8px;
  --spacing-lg: 24px;
  --font-sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1217;
    --surface: #141923;
    --text: #eef2ff;
    --muted: #a3a9b7;
    --primary: #3b82f6;
    --primary-contrast: #0b1020;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #252b37;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--spacing-lg);
}
.text-muted {
  color: var(--muted);
  font-style: italic;
}

.stack > * + * { margin-top: var(--spacing); }
.stack-sm > * + * { margin-top: var(--spacing-sm); }
.grid {
  display: grid;
  gap: var(--spacing);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Header/Nav */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--spacing) var(--spacing);
}
.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.nav a.active {
  background: var(--primary);
  color: var(--primary-contrast);
}

.nav a:hover { background: rgba(0,0,0,0.05); }
@media (prefers-color-scheme: dark) {
  .nav a:hover { background: rgba(255,255,255,0.06); }
}
/* Accordion Styles */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.accordion-item {
  border-top: 1px solid var(--border);
}

.accordion-header {
  background: var(--surface);
  padding: var(--spacing-sm);
  cursor: pointer;
  display: flex;
  justify-content: space-between; /* Text links, Pfeil rechts */
  align-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.accordion-header:hover {
  background: var(--surface-hover);
}

/* Pfeil-Icon */
.accordion-header::after {
  content: "▸"; /* kleiner Pfeil nach rechts */
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

/* Wenn aktiv: Pfeil nach unten + andere Farbe */
.accordion-item.active .accordion-header::after {
  transform: rotate(90deg);
}

.accordion-item.active .accordion-header {
  background: var(--primary);   /* aktive Hintergrundfarbe */
  color: #fff;                  /* Textfarbe weiß */
}

.accordion-content {
  display: none;
  padding: var(--spacing-sm);
}

.accordion-item.active .accordion-content {
  display: block;
}


/* Typografie */
h1, h2, h3 { margin: 0 0 var(--spacing-sm); line-height: 1.25; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; color: var(--muted); }
p { margin: 0; }
.lead { color: var(--muted); }

/* Formular */
form { display: block; }
.label { display: block; font-weight: 600; margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: var(--primary);
}
.help { color: var(--muted); font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-danger {
  background: var(--danger);
  color: var(--primary-contrast);
  border-color: transparent;
}

/* Tabellen */
.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table thead th {
  background: rgba(0,0,0,0.04);
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .table thead th { background: rgba(255,255,255,0.06); }
}
.table tr:hover td { background: rgba(0,0,0,0.03); }
@media (prefers-color-scheme: dark) {
  .table tr:hover td { background: rgba(255,255,255,0.04); }
}

/* Meldungen */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.alert-success { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.alert-warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.alert-danger  { border-color: #fecaca; background: #fef2f2; color: #7f1d1d; }
@media (prefers-color-scheme: dark) {
  .alert-success { border-color: #14532d; background: #0a1f15; color: #86efac; }
  .alert-warning { border-color: #3a2a05; background: #1a1406; color: #fde68a; }
  .alert-danger  { border-color: #4c0b0b; background: #1a0b0b; color: #fecaca; }
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}
.badge-success { background: var(--success); color: var(--primary-contrast); }
.badge-warning { background: var(--warning); color: var(--primary-contrast); }
.badge-danger  { background: var(--danger);  color: var(--primary-contrast); }
.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Log-Ausgabe */
.log-output {
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;   /* behält Zeilenumbrüche, erlaubt aber Umbruch */
  word-wrap: break-word;   /* bricht lange Wörter */
  overflow-wrap: break-word;
  color: var(--text);
}


/* Utility */
.row { display: flex; gap: var(--spacing); flex-wrap: wrap; }
.col { flex: 1 1 240px; }
.center { display: grid; place-items: center; }
.right { text-align: right; }
.m0 { margin: 0; }
.mt { margin-top: var(--spacing); }
.mt-sm { margin-top: var(--spacing-sm); }
.mb { margin-bottom: var(--spacing); }
.p0 { padding: 0; }
.p { padding: var(--spacing); }
.p-sm { padding: var(--spacing-sm); }

/* Code */
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 6px;
}
@media (prefers-color-scheme: dark) {
  code, pre { background: rgba(255,255,255,0.08); }
  .log-output {
    background: #1a1f29;
    border-color: #2c3444;
    color: #e5e7eb;
  }
  .accordion {
    border-color: #2c3444;
  }

  .accordion-item {
    border-top-color: #2c3444;
  }

  .accordion-header {
    background: #1a1f29;
    color: #e5e7eb;
  }

  .accordion-header:hover {
    background: #2c3444;
  }

  .accordion-item.active .accordion-header {
    background: #3b82f6; /* kräftiges Blau für aktive Sektion */
    color: #fff;
  }

  .accordion-content {
    background: #111827;
    color: #e5e7eb;
  }
}
