/* assets/css/design_web.css */

/* ===== Base / Layout ===== */
:root { color-scheme: dark; }
* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
  background: radial-gradient(1200px 800px at 70% 30%, #0f172a, #020617);
  color: #e5e7eb;

  /* 2-Spalten Grid: Sidebar | Main; Header oben */
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(640px, 1fr);
  grid-template-rows: auto 1fr;
  gap: 16px;
  overflow: hidden; /* nur links scrollen */
}

/* ===== Header ===== */
header {
  grid-column: 1 / -1;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 800;
  letter-spacing: .3px;
  font-size: clamp(18px, 2.4vw, 22px);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(2,6,23,0.55);
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* ===== Sidebar (äußere Hülle) ===== */
.sidebar {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* Scroll-Container */
.sidebar-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 24px 16px;
  scrollbar-gutter: stable both-edges;
}
.sidebar-scroll::-webkit-scrollbar { width: 10px; }
.sidebar-scroll::-webkit-scrollbar-track { background: rgba(2,6,23,0.3); }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.35);
  border-radius: 8px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.5); }

/* ===== Sektionen ===== */
.section {
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(2,6,23,0.55);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  overflow: hidden;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
}
.sec-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  user-select: none;
  cursor: default;
}
.sec-title { font-weight: 700; font-size: 14px; }
.sec-body {
  display: grid;
  gap: 14px;
  padding: 0 14px 14px;
}

/* ===== UI Elemente ===== */
.pill {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(2,6,23,0.55);
  border: 1px solid rgba(148,163,184,0.18);
  font-size: 13px;
}
.radio { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.note { font-size: 12px; opacity: .7; }

/* Segment-Schalter */
.seg {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 999px;
  padding: 4px;
}
.seg button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-weight: 600;
}
.seg button.active { background: rgba(96,165,250,0.15); color: #e5e7eb; }

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(2,6,23,0.55);
  color: #e5e7eb;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { border-color: #93c5fd; }

/* Navigation (‹ Index ›) */
.skin-nav {
  display: flex;
  align-items: center;
  justify-content: center;  /* alles schön mittig */
  gap: 15px;                 /* Abstand zwischen Pfeilen und Zahl */
}


/* Inputs */
input[type="color"] { width: 40px; height: 32px; border: none; background: transparent; }
input[type="text"] {
  background: rgba(2,6,23,0.6);
  border: 1px solid rgba(148,163,184,0.18);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  width: 100%;
}
input[type="range"] { accent-color: #60a5fa; width: 100%; }

/* Farbrow */
.sec-body .color-row,
.sec-body .pill {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

/* ===== Main / Viewer ===== */
.main {
  grid-column: 2;
  grid-row: 2;
  padding: 8px 12px 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Alles links nebeneinander */
  gap: 20px;                   /* Abstand zwischen den Elementen */
}

.viewer {
  position: relative;
  height: 100%;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(2,6,23,0.38);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  overflow: hidden;
  z-index: 0;
}
#app { position: absolute; inset: 0; }
canvas { display: block; width: 100%; height: 100%; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .sidebar { grid-column: 1; grid-row: 2; }
  .main    { grid-column: 1; grid-row: 3; }
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  background: rgba(2,6,23,0.92);
  border: 1px solid rgba(148,163,184,0.25);
  color: #e5e7eb;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* Fix: Sidebar über Viewer, damit alles klickbar bleibt */
.sidebar { position: relative; z-index: 10; }
.main    { position: relative; z-index: 1; }
.viewer  { position: relative; z-index: 0; }

/* === Farbvarianten für Buttons === */
.btn-blue { background:#3b82f6; border-color:#60a5fa; color:#fff; }
.btn-blue:hover { border-color:#93c5fd; }
.btn-red { background:#b91c1c; border-color:#ef4444; color:#fff; }
.btn-red:hover { border-color:#f87171; }
.btn-turquoise {
  background-color: #008B8B; /* Dark Cyan */
  color: #fff;
}


/* === Code-Leiste oben in der Sidebar === */
.sidebar-top {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(2,6,23,0.85);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 8px;
  margin-bottom: 12px;
}

.sidebar-top input[type="text"]{
  width: 220px;               /* kurz & kompakt */
  background: rgba(2,6,23,0.6);
  border: 1px solid rgba(148,163,184,0.18);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
}
