/* ==========================================================================
   Base styles
   ========================================================================== */
html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}
::-moz-selection { background: #b3d4fc; text-shadow: none; }
::selection      { background: #b3d4fc; text-shadow: none; }
audio, canvas, iframe, img, svg, video { vertical-align: middle; }
fieldset { border: 0; margin: 0; padding: 0; }
textarea { resize: vertical; }
/* ==========================================================================
   Global
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #f4f7fb 0%, #eef2ff 100%);
  color: #1f2937;
}
.page {
  padding: 48px 24px 64px;
}
/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  max-width: 1100px;
  margin: 0 auto 40px;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4f46e5;
}
h1, h2, h3 { margin-top: 0; }
h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}
.intro {
  max-width: 760px;
  margin: 0;
  font-size: 1.1rem;
  color: #475569;
}
/* ==========================================================================
   Tier Stack
   ========================================================================== */
.tier-stack {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
}
/* ==========================================================================
   Tier Panel
   ========================================================================== */
.tier-panel {
  flex: 1;
  min-width: 0;
  border: 1px solid #dbe4ff;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(79, 70, 229, 0.07);
  overflow: hidden;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}
.tier-panel--frontend { border-color: #c7d2fe; }
.tier-panel--backend  { border-color: #a7f3d0; }
.tier-panel--database { border-color: #fed7aa; }
.tier-panel--frontend.is-active {
  box-shadow: 0 18px 48px rgba(79, 70, 229, 0.16);
  border-color: #818cf8;
}
.tier-panel--backend.is-active {
  box-shadow: 0 18px 48px rgba(5, 150, 105, 0.14);
  border-color: #34d399;
}
.tier-panel--database.is-active {
  box-shadow: 0 18px 48px rgba(194, 65, 12, 0.13);
  border-color: #fb923c;
}
/* ── Tier Header ── */
.tier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #334155 0%, #475569 55%, #64748b 100%);
}
.tier-badge {
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tier-badge--frontend { background: #eef2ff; color: #4338ca; }
.tier-badge--backend  { background: #ecfdf5; color: #065f46; }
.tier-badge--database { background: #fff7ed; color: #9a3412; }
.tier-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
}
/* ── Tier Body ── */
.tier-body {
  padding: 24px;
}
/* ==========================================================================
   Browser Mockup
   ========================================================================== */
.browser-window {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.browser-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #e5e7eb;
  border-bottom: 1px solid #d1d5db;
}
.browser-dots {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}
.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}
.dot--red    { background: #ef4444; }
.dot--yellow { background: #f59e0b; }
.dot--green  { background: #22c55e; }
.browser-addressbar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 0.8rem;
  color: #374151;
}
.address-lock { font-size: 0.75rem; }
.address-text { color: #374151; }
.browser-viewport {
  min-height: 180px;
  padding: 20px;
  background: #f9fafb;
}
.viewport-empty {
  margin: 0;
  color: #9ca3af;
  font-style: italic;
  font-size: 0.9rem;
}
/* ==========================================================================
   Controls Box
   ========================================================================== */
.controls-box {
  margin-top: 20px;
  padding: 20px 24px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}
.controls-heading {
  margin: 0 0 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}
.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1f2937;
}
.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.method-badge {
  flex-shrink: 0;
  padding: 9px 14px;
  background: #4f46e5;
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.url-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.88rem;
  color: #1f2937;
  transition: border-color 0.2s, outline 0.2s;
}
.url-input:focus {
  outline: 2px solid #c7d2fe;
  border-color: #818cf8;
}
/* ==========================================================================
   Button
   ========================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: #4f46e5;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  opacity: 0.93;
}
.button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}
/* ==========================================================================
   Pfeile unterhalb der Tier-Panels
   ========================================================================== */

/* Flex-Layout spiegelt die Panel-Breiten wider:
   spacer(1) + arrow-conn(2) + arrow-conn(2) + spacer(1) = 6 Einheiten
   → je 3 Panels à flex:1 → panel-Mitte bei 1/6, 3/6, 5/6 der Gesamtbreite */

.arrows-below {
  display: flex;
  align-items: flex-start;
  padding: 10px 0 0;
}

.arrow-spacer { flex: 1; }

.arrow-conn {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 0;
}

.conn-lane--down,
.conn-lane--up {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #cbd5e1;
  opacity: 0;
  visibility: hidden;
  transition: color 0.3s ease, opacity 0.2s ease;
}

.conn-lane--down.is-active,
.conn-lane--up.is-active,
.conn-lane--down.is-done,
.conn-lane--up.is-done {
  opacity: 1;
  visibility: visible;
}

.conn-lane--down.is-active { color: #4f46e5; }
.conn-lane--up.is-active   { color: #059669; }

.conn-lane--down.is-done,
.conn-lane--up.is-done {
  color: #94a3b8;
}

.conn-lane--down.is-done .conn-tag,
.conn-lane--up.is-done .conn-tag {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.conn-arrow-h {
  display: flex;
  align-items: center;
}

.conn-arrow-line {
  flex: 1;
  height: 0;
  border-top: 2px solid; /* erbt currentColor vom Elternelement */
}

.conn-arrow-tip {
  font-size: 0.6rem;
  line-height: 1;
}

.conn-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  align-self: flex-start;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.conn-lane--up .conn-tag { align-self: flex-end; }

.conn-lane--down.is-active .conn-tag {
  color: #4338ca;
  background: #eef2ff;
  border-color: #a5b4fc;
}
.conn-lane--up.is-active .conn-tag {
  color: #065f46;
  background: #ecfdf5;
  border-color: #6ee7b7;
}
/* ==========================================================================
   Backend – Log-Panel
   ========================================================================== */
.log-panel {
  background: #0f172a;
  border-radius: 12px;
  padding: 16px 20px;
  min-height: 96px;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.84rem;
  line-height: 1.6;
}

.response-panel {
  display: none;
  margin-top: 12px;
  background: #0f172a;
  border-radius: 12px;
  padding: 14px 18px;
  min-height: 120px;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.response-panel.is-visible {
  display: block;
}

.response-json {
  margin: 0;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-empty {
  margin: 0;
  color: #475569;
  font-style: italic;
}
.log-line           { margin: 0; color: #cbd5e1; }
.log-line.is-info    { color: #60a5fa; }
.log-line.is-success { color: #4ade80; }
.log-line.is-warn    { color: #fbbf24; }
/* ==========================================================================
   Database – Abfrage & Tabelle
   ========================================================================== */
.db-query {
  margin: 0 0 20px;
  padding: 14px 18px;
  background: #0f172a;
  color: #fbbf24;
  border-radius: 12px;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  white-space: pre;
}
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.db-table th {
  padding: 9px 14px;
  background: #f1f5f9;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  font-weight: 700;
  color: #374151;
}
.db-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1f2937;
}
.db-table tbody tr:last-child td { border-bottom: none; }
.db-table tbody tr:hover         { background: #f8fafc; }
/* ==========================================================================
   Produktliste im Browser-Viewport
   ========================================================================== */
.product-list-heading {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
}
.product-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.product-name  { font-weight: 600; }
.product-price { color: #4f46e5; font-weight: 700; font-size: 0.95rem; }
/* ==========================================================================
   Responsive
   ========================================================================== */
@media only screen and (max-width: 64em) {
  .tier-stack    { flex-direction: column; }
  .tier-panel    { flex: none; }
  .arrows-below  { display: none; }
}
@media only screen and (max-width: 40em) {
  .page      { padding: 32px 16px 48px; }
  .tier-body { padding: 16px; }
  .input-row { flex-wrap: wrap; }
  .url-input { min-width: 0; }
}

