/* Lokale Fonts: keine Google-Verbindungen */
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-VariableFont_wdth,wght.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --bg: #525966;
  --panel: #3a404a;
  --panel-strong: #2e333d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --accent-2: #fbbf24;
  --danger: #f43f5e;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  --radius-xl: 8px;
  --radius-lg: 5px;
  --radius-md: 3px;
  --radius-sm: 2px;
  --max: 1380px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  /* Main UI uses Roboto */
  font-family: 'Roboto', ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  /* Subtle grain/gradient for depth without being "shiny" */
  background-image: linear-gradient(180deg, #575f6d 0%, #4c5360 100%);
}
body.modal-open { overflow: hidden; }
a { color: var(--accent-2); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.field.is-disabled span { color: var(--muted); }
.field.is-disabled input,
.field.is-disabled select {
  opacity: 0.55;
  cursor: not-allowed;
}
input:disabled, select:disabled, button:disabled {
  cursor: not-allowed;
}

/* Technical Icon/Image Wrappers adapted for SVGs */
.hero-image-wrap {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 0 rgba(255,255,255,0.05);
  background: var(--panel-strong);
  display: grid;
  place-items: center;
  padding: 14px;
  color: var(--accent-2);
}
.hero-image-wrap.compact {
  width: 64px;
  height: 64px;
  padding: 10px;
}
.hero-icon-svg {
  width: 100%;
  height: 100%;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: brightness(1);
  transition: filter 0.3s ease, transform 0.3s ease;
}
.hero-icon-svg rect { fill: rgba(245, 158, 11, 0.12); }
.hero-card:hover .hero-icon-svg {
  filter: brightness(1.12) contrast(1.04);
  color: var(--accent-2);
  transform: scale(1.02);
}

.site-shell {
  width: min(calc(100% - 28px), var(--max));
  margin: 22px auto 18px;
}

.hero-card,
.panel,
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 32px;
}

.hero-brand,
.modal-brand {
  display: flex;
  gap: 28px; /* Slightly wider gap for the icon look */
  align-items: center;
}

.hero-card h1,
.modal h2,
.section-head h2,
.preview-head h3,
.dropzone h3,
.empty-state h3 { 
  margin: 0; 
  /* Heads use Montserrat */
  font-family: 'Montserrat', sans-serif;
  letter-spacing: -0.01em; /* Reduced spacing for Montserrat Versalien */
  font-weight: 800; /* BEEINDRUCKEND */
}
.hero-card h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1; margin-top: 4px; }
.modal h2 { font-size: 1.75rem; }

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  /* Eyebrow uses Roboto for technicality */
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
}
.hero-copy,
.dropzone p,
.empty-state p,
.modal p,
.modal li,
.site-footer span { 
  font-family: 'Roboto', sans-serif; /* Fließtext Roboto */
  color: var(--muted); 
  line-height: 1.6; 
  font-weight: 400;
}
.hero-copy { margin-top: 12px; max-width: 600px; font-size: 1.05rem; }

.welcome-lead { margin: 8px 0 0; max-width: 460px; }

.range-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.range-meta output {
  color: var(--soft);
  font-weight: 700;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  padding: 0;
}
input[type="range"]:disabled {
  opacity: 0.5;
}

.workspace-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}
.section-head,
.preview-head,
.thumbs-head,
.progress-label-row,
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.session-badge {
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.75rem;
  /* Montserrat for the badge */
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--accent-strong);
  font-weight: 700;
}
.session-badge.is-idle {
  background: var(--panel-strong);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Professional sharper buttons */
.ghost-button,
.primary-button,
.secondary-button,
.footer-link {
  border: 0;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}
.ghost-button,
.secondary-button {
  padding: 10px 16px;
  background: var(--panel-strong);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.ghost-button:hover,
.secondary-button:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--soft);
}
.ghost-button.subtle { padding: 8px 12px; font-size: 0.85rem; }
.primary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  color: #fff;
  background: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}
.primary-button:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}
.ghost-button:disabled,
.secondary-button:disabled,
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.dropzone {
  margin-top: 18px;
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--muted);
  background: var(--panel-strong);
  padding: 24px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--soft); background: rgba(255,255,255,0.02); }
.dropzone.is-dragging { border-color: var(--accent-2); background: rgba(14, 165, 233, 0.05); }
.dropzone-visual { display: flex; gap: 16px; align-items: center; }
.dropzone-illustration {
  width: 54px; height: 54px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
}
.dropzone-illustration svg { width: 24px; height: 24px; fill: var(--muted); }
.dropzone-meta {
  margin-top: 16px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.8rem;
  /* Roboto for technical metadata */
  font-family: 'Roboto', sans-serif;
}
.progress-block { margin-top: 16px; }
.progress-track {
  width: 100%; height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}
.progress-track.large { height: 8px; }
.progress-track span {
  display: block; height: 100%; width: 0;
  background: var(--accent);
}
.inline-feedback {
  min-height: 22px; margin-top: 12px; color: var(--muted); font-size: 0.85rem;
}
.inline-feedback[data-state="error"] { color: var(--danger); }
.inline-feedback[data-state="success"] { color: var(--accent-2); }
.inline-feedback[data-state="warning"] { color: #f59e0b; }

.thumbs-head { margin-top: 24px; color: var(--soft); font-size: 0.9rem; border-bottom: 1px solid var(--line); padding-bottom: 8px;}
.thumbs {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.thumb-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  transition: border-color 0.2s;
}
.thumb-card.active {
  border-color: var(--accent);
}
.thumb-preview { display: block; aspect-ratio: 1 / 1; background: #222; }
.thumb-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-meta { padding: 10px 12px; display: grid; gap: 2px; }
.thumb-meta strong {
  font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.thumb-meta span { 
  color: var(--muted); 
  font-size: 0.75rem; 
  /* Technical Roboto for thumbs */
  font-family: 'Roboto', sans-serif; 
}
.thumb-delete {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: rgba(0,0,0,0.6); color: white; font-size: 1rem; line-height: 1;
  display: grid; place-items: center; opacity: 0; transition: opacity 0.2s;
}
.thumb-card:hover .thumb-delete { opacity: 1; }
.thumb-empty {
  padding: 20px; border-radius: var(--radius-md); border: 1px dashed var(--line-strong);
  color: var(--muted); font-size: 0.85rem; text-align: center;
}

.empty-state {
  border-radius: var(--radius-lg);
  min-height: 400px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
  border: 1px dashed var(--line-strong);
  background: var(--panel-strong);
  padding: 32px;
}
.empty-state.hidden,
.workspace-content.hidden { display: none; }
.empty-icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
}
.empty-icon svg { width: 28px; height: 28px; fill: var(--muted); }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.meta-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.meta-item span { 
  color: var(--muted); 
  font-size: 0.75rem; 
  text-transform: uppercase; 
  letter-spacing: 0.05em; 
  /* Clean technical Fließtext */
  font-family: 'Roboto', sans-serif;
}
.meta-item strong { 
  font-size: 0.95rem; 
  font-family: 'Roboto', sans-serif; 
  font-weight: 500;
}

.preview-shell {
  margin-top: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 16px;
}
.preview-head h3 { font-size: 1.1rem; }
.canvas-wrap {
  margin-top: 12px;
  border-radius: var(--radius-md);
  padding: 8px;
  background: #2a2e37;
  border: 1px solid var(--line-strong);
}
#cropCanvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  background: #1e2128; /* Deep dark for contrast behind image */
}
.control-form { margin-top: 24px; }
.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field,
.checkbox-field {
  display: grid;
  gap: 6px;
}
.field span,
.checkbox-field span { color: var(--soft); font-size: 0.85rem; font-weight: 500;}
.field input,
.field select {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  /* Technically sound Roboto for fields */
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.readonly-field input { color: var(--muted); background: rgba(0,0,0,0.1); border-color: transparent; }
.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  margin-top: 16px;
}
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.action-row {
  margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px;
}
.action-row > * { flex: 1 1 200px; }

.site-footer {
  margin-top: 12px;
  padding: 12px 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  /* Footer Fließtext */
  font-family: 'Roboto', sans-serif;
}
.footer-link {
  padding: 0;
  margin-left: 16px;
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 0.85rem;
}
.footer-link:hover { color: var(--text); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 23, 28, 0.8);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 100;
}
.modal {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  width: min(calc(100% - 32px), 640px);
  z-index: 101;
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.modal-content-pad { margin-top: 24px; }
.progress-modal { width: min(calc(100% - 32px), 480px); }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1;
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--panel-strong); color: var(--text); border-color: var(--line); }
.modal .support-links,
.progress-actions {
  margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap;
}
.modal .support-links > *,
.progress-actions > * { flex: 1 1 180px; }
.legal-modal ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

/* Mobile Responsiveness */
@media (max-width: 1080px) {
  .workspace-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-shell { width: min(calc(100% - 16px), var(--max)); margin-top: 12px; }
  .hero-card,
  .panel,
  .modal { border-radius: var(--radius-lg); }
  .hero-card { padding: 24px; }
  .hero-brand { flex-direction: column; align-items: flex-start; gap: 16px; }
  /* Adjust mobile height and padding for SVGs */
  .hero-image-wrap { 
    width: 100%; 
    height: 120px; 
    padding: 12px;
  }
  .panel { padding: 20px; }
  .dropzone-visual { align-items: flex-start; flex-direction: column; gap: 12px;}
  .three-col,
  .meta-grid { grid-template-columns: 1fr; }
  .action-row > * { flex-basis: 100%; }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer div { margin-left: -16px; }
}

.support-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.support-links > * { width: 100%; }
.support-links .support-install,
.support-links .support-enter { grid-column: 1 / -1; }
.support-links .support-paypal { grid-column: 1; }
.support-links .support-coffee { grid-column: 2; }
.reset-all-row {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}
.reset-all-row .ghost-button { min-width: 140px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  background: rgba(255,255,255,0.16);
  border: 1px solid var(--line-strong);
  border-radius: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -6px;
  border-radius: 0;
  border: 0;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}
input[type="range"]::-moz-range-track {
  height: 10px;
  background: rgba(255,255,255,0.16);
  border: 1px solid var(--line-strong);
  border-radius: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 0;
  border: 0;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}
input[type="range"]:disabled::-webkit-slider-thumb,
input[type="range"]:disabled::-moz-range-thumb {
  background: var(--muted);
}

.modal .support-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.modal .support-links > * { width: 100%; flex: initial; }
@media (max-width: 640px) {
  .support-links { grid-template-columns: 1fr; }
  .support-links .support-install,
  .support-links .support-paypal,
  .support-links .support-coffee,
  .support-links .support-enter { grid-column: 1; }
  .reset-all-row { justify-content: stretch; }
  .reset-all-row .ghost-button { width: 100%; }
}
