/* ============================================================
   OSRW 3D-Print-Generator – Gemeinsames Stylesheet
   Schulfarben: Blau #1a5276, Akzent #e67e22
   ============================================================ */

:root {
  --blue:       #1a5276;
  --blue-light: #2e86c1;
  --blue-bg:    #eaf2fb;
  --orange:     #e67e22;
  --orange-h:   #d35400;
  --gray-dark:  #2c3e50;
  --gray-mid:   #7f8c8d;
  --gray-light: #ecf0f1;
  --white:      #ffffff;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(0,0,0,0.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--gray-light);
  color: var(--gray-dark);
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────── */
.site-header {
  background: var(--blue);
  color: var(--white);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.site-header img { height: 44px; width: auto; }
.site-header .header-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.site-header .header-sub {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 1px;
}
.site-header a { color: var(--white); text-decoration: none; }
.site-header .back-link {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.site-header .back-link:hover { opacity: 1; }

/* ── Breadcrumb ───────────────────────────────────────── */
.breadcrumb {
  background: var(--blue-bg);
  padding: 0.5rem 2rem;
  font-size: 0.8rem;
  color: var(--blue);
  border-bottom: 1px solid #c5d9f0;
}
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Startseite: Kacheln ─────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 3rem 2rem 2.5rem;
}
.page-hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.page-hero p  { font-size: 1rem; opacity: 0.85; }

.grid-container {
  max-width: 1100px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.card-icon {
  background: var(--blue-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  font-size: 4rem;
}
.card-body { padding: 1rem 1.2rem 1.4rem; }
.card-body h2 { font-size: 1.05rem; color: var(--blue); margin-bottom: 0.4rem; }
.card-body p  { font-size: 0.85rem; color: var(--gray-mid); line-height: 1.5; }
.card-tag {
  display: inline-block;
  margin-top: 0.7rem;
  background: var(--orange);
  color: var(--white);
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
}

/* ── Generator-Layout (2-Spalten) ────────────────────── */
.gen-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}
@media (max-width: 820px) {
  .gen-layout { grid-template-columns: 1fr; }
}

/* ── Linke Spalte: Eingaben ───────────────────────────── */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}
.panel h2 {
  font-size: 1rem;
  color: var(--blue);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--blue-bg);
}

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-dark);
  margin-bottom: 0.3rem;
}
.field .val {
  font-size: 0.8rem;
  color: var(--blue);
  font-weight: 700;
  float: right;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
}
input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1.5px solid #c5d9f0;
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--gray-dark);
  outline: none;
  transition: border-color 0.15s;
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus { border-color: var(--blue-light); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-mid);
  margin: 1.2rem 0 0.6rem;
}

/* ── Render-Button ────────────────────────────────────── */
.btn-render {
  width: 100%;
  padding: 0.75rem;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}
.btn-render:hover   { background: var(--blue-light); }
.btn-render:active  { background: #1a3a5c; }
.btn-render:disabled { background: var(--gray-mid); cursor: not-allowed; }

/* ── Rechte Spalte: Vorschau ─────────────────────────── */
.preview-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.preview-header {
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.preview-header h2 { font-size: 1rem; color: var(--blue); }
.preview-status {
  font-size: 0.8rem;
  color: var(--gray-mid);
}
.preview-status.ok  { color: #27ae60; }
.preview-status.err { color: #e74c3c; }

#canvas-container {
  flex: 1;
  position: relative;
  min-height: 380px;
  background: #f7f9fc;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
#canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Ladeoverlay */
#loader {
  position: absolute;
  inset: 0;
  background: rgba(247,249,252,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  gap: 1rem;
}
#loader .spinner {
  width: 48px; height: 48px;
  border: 5px solid var(--blue-bg);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
#loader .loader-text { font-size: 0.9rem; color: var(--gray-mid); text-align: center; }
#loader .loader-bar-wrap {
  width: 220px; height: 8px;
  background: var(--blue-bg);
  border-radius: 4px;
  overflow: hidden;
}
#loader .loader-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width 0.4s;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Download-Leiste ─────────────────────────────────── */
.download-bar {
  padding: 1rem 1.4rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.download-bar span { font-size: 0.85rem; color: var(--gray-mid); margin-right: 0.3rem; }

.btn-dl {
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-dl:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn-dl:active { transform: translateY(0); }
.btn-dl:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-stl { background: var(--orange); color: var(--white); }
.btn-scad { background: var(--blue);  color: var(--white); }
.btn-png  { background: #8e44ad;      color: var(--white); }

/* ── Fehlermeldung ───────────────────────────────────── */
.error-box {
  background: #fdedec;
  border: 1.5px solid #e74c3c;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.82rem;
  color: #c0392b;
  margin-top: 0.5rem;
  display: none;
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: var(--gray-mid);
  margin-top: 2rem;
}
