/* ═══════════════════════════════════════════════════════
   Werkzeugleiste & Eigenschaften-Panel
   ═══════════════════════════════════════════════════════ */

/* ── Linke Werkzeugleiste ────────────────────────── */
.toolbar-left {
  width: 80px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 12px 8px;
}

.tool-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tool-group-bottom {
  margin-top: auto;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.tool-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tool-btn.active {
  background: rgba(201,169,104,.15);
  color: var(--gold);
  border-color: rgba(201,169,104,.3);
}

/* ── Ausrichten-Gruppe ───────────────────────────── */
.toolbar-align {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── Copy/Paste-Gruppe ───────────────────────────── */
.toolbar-copy-paste {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── Layout-Info unten links ─────────────────────── */
.layout-info {
  text-align: center;
  padding: 8px 4px;
  border-top: 1px solid var(--border);
}
.info-format {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.info-dims {
  font-size: .65rem;
  color: var(--text-hint);
  margin-top: 2px;
}

/* ── Rechtes Panel ───────────────────────────────── */
.panel-right {
  width: 240px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
}

.panel-section {
  padding: 16px;
}
.panel-section.hidden {
  display: none;
}

.panel-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.panel-hint {
  font-size: .8rem;
  color: var(--text-hint);
  line-height: 1.5;
  text-align: center;
  padding: 32px 8px;
}

/* ── Eigenschafts-Zeilen ─────────────────────────── */
.prop-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.prop-row label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: .04em;
}

.prop-row-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.prop-row-inline label {
  flex-shrink: 0;
}

.prop-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Inputs ──────────────────────────────────────── */
input[type="number"],
input[type="text"],
textarea,
select {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: .85rem;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s;
}
input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
}

input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 2px 4px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

select option {
  background: var(--bg-panel);
}

/* ── Stil-Buttons (Fett / Kursiv / Unterstrichen) ── */
.style-buttons,
.align-buttons {
  display: flex;
  gap: 4px;
}

.style-btn,
.align-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.style-btn:hover,
.align-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.style-btn.active,
.align-btn.active {
  background: rgba(201,169,104,.15);
  color: var(--gold);
  border-color: rgba(201,169,104,.4);
}

/* Seitenverhältnis-Buttons (Foto-Dummy) */
.ratio-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ratio-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 64px;
  padding: 8px 4px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.ratio-btn b {
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ratio-btn small {
  font-size: .62rem;
  opacity: .8;
  line-height: 1;
}
.ratio-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.ratio-btn.active {
  background: rgba(201,169,104,.15);
  color: var(--gold);
  border-color: rgba(201,169,104,.5);
}
/* kleine Form-Vorschau im Button */
.ratio-shape {
  display: block;
  border: 2px solid currentColor;
  border-radius: 2px;
}
.ratio-shape.sq   { width: 16px; height: 16px; }
.ratio-shape.port { width: 12px; height: 18px; }
.ratio-shape.land { width: 18px; height: 12px; }
/* readonly-Felder (z.B. abgeleitete Höhe) optisch gedämpft */
.prop-row input[readonly] {
  opacity: .65;
  cursor: not-allowed;
}

/* Schieberegler (Hintergrund-Deckkraft/Helligkeit) */
.prop-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}
#bg-opacity-val,
#bg-brightness-val,
#ovl-border-val,
#ovl-soft-val {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.align-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ── Hintergrund-Panel ───────────────────────────── */
.bg-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bg-upload-zone:hover,
.bg-upload-zone.drag-active {
  border-color: var(--gold);
  background: rgba(201,169,104,.06);
}
.bg-upload-zone svg {
  width: 28px;
  height: 28px;
  stroke: var(--text-hint);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bg-upload-zone p {
  font-size: .8rem;
  color: var(--text-secondary);
}
.bg-upload-zone .hint {
  font-size: .72rem;
  color: var(--text-hint);
}

.bg-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bg-preset-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.bg-preset-item:hover {
  border-color: var(--gold-dark);
  transform: scale(1.05);
}
.bg-preset-item.selected {
  border-color: var(--gold);
}
.bg-preset-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bg-preset-item.plain {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  color: var(--text-hint);
  background: var(--bg-dark);
  border-color: var(--border);
}

/* ══════════════════════════════════════════════════════
   ICON-PANEL
══════════════════════════════════════════════════════ */
.icon-category-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin: 12px 0 6px;
}
.icon-category-label:first-of-type {
  margin-top: 4px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 6px;
}

.icon-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: border-color .15s, background .15s, transform .12s;
}
.icon-item:hover {
  border-color: var(--gold);
  background: rgba(201,169,104,.08);
  transform: scale(1.06);
}
.icon-item svg {
  width: 100%;
  height: 100%;
  display: block;
}

.panel-hint-small {
  font-size: .72rem;
  color: var(--text-hint);
  text-align: center;
  padding: 0 4px 8px;
  line-height: 1.45;
}

/* ── Icon-Top-Row (Farbe + Upload) ───────────────── */
.icon-top-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.icon-upload-btn {
  flex-shrink: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  white-space: nowrap;
  padding: 0 10px;
}

/* Icon-Thumbnails: img-basiert, CSS-Filter für Gold-Ton */
.icon-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: invert(1) sepia(1) saturate(2) hue-rotate(330deg) brightness(0.85);
  transition: filter .15s;
}
.icon-item:hover img {
  filter: invert(1) sepia(1) saturate(3) hue-rotate(330deg) brightness(1);
}

/* ── Rahmen-Stil-Raster ──────────────────────────── */
.frame-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 4px 0 6px;
}
.frame-style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg-dark);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 7px 4px 5px;
  transition: border-color .15s, background .15s, transform .12s;
}
.frame-style-btn:hover {
  border-color: var(--gold);
  background: rgba(201,169,104,.08);
  transform: scale(1.05);
}
.frame-style-btn.active {
  border-color: var(--gold);
  background: rgba(201,169,104,.16);
}
.frame-style-btn svg {
  width: 100%;
  height: auto;
  display: block;
}
.frame-style-btn span {
  font-size: .66rem;
  color: var(--text-hint);
}
.frame-style-btn.active span {
  color: var(--gold);
}
