/* =============================================================
   konverter.css – Stile nur für den Datei-Konverter
   Nutzt die Variablen aus base.css.
   ============================================================= */

.konverter {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 16px var(--gutter) 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Layout: links Arbeitsbereich, rechts Panel, darunter Ergebnisse ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.workspace { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.layout.has-files {
  grid-template-columns: minmax(0, 1fr) 340px;
}
.layout.has-files .workspace { grid-column: 1; grid-row: 1; }
.layout.has-files .panel     {
  grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px;
  /* Auf niedrigen Bildschirmen im Panel scrollen, damit der Button erreichbar bleibt */
  max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
}
.layout.has-files .results   { grid-column: 1; grid-row: 2; }

@media (max-width: 880px) {
  /* Handy/Tablet: alles untereinander – Dateien, Einstellungen, Ergebnisse */
  .layout.has-files { grid-template-columns: minmax(0, 1fr); }
  .layout.has-files .workspace,
  .layout.has-files .panel,
  .layout.has-files .results { grid-column: 1; grid-row: auto; position: static; }
  .layout.has-files .panel { max-height: none; overflow: visible; }
}

/* ---------- Datenschutz-Hinweis ---------- */
.privacy {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.privacy__icon { width: 28px; height: 28px; color: var(--ok); flex: none; margin-top: 2px; }
.privacy__title { margin: 0 0 2px; font-weight: 700; }
.privacy__text { margin: 0; color: var(--muted); font-size: .88rem; }

/* ---------- Upload-Bereich ---------- */
.dropzone {
  position: relative;
  text-align: center;
  background: var(--panel);
  border: 2px dashed var(--accent-line);
  border-radius: var(--radius);
  padding: 40px 20px 28px;
  transition: border-color .2s, background .2s, transform .2s var(--ease), padding .2s;
}
.dropzone.is-dragover {
  border-color: var(--accent-light);
  background: var(--accent-soft);
  transform: scale(1.01);
}
.dropzone__icon { width: 44px; height: 44px; color: var(--accent-light); }
.dropzone__title { margin: 8px 0 4px; font-size: 1.25rem; font-weight: 600; }
.dropzone__sub { margin: 0 0 20px; color: var(--muted); font-size: .9rem; }
.dropzone__buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dropzone__formats { margin: 18px 0 0; font-size: .78rem; letter-spacing: 1px; color: var(--muted); }
.dropzone__formats span { letter-spacing: 0; }

/* Sobald Dateien da sind, wird der Upload-Bereich kompakter */
.has-files .dropzone { padding: 18px 20px; }
.has-files .dropzone__icon,
.has-files .dropzone__formats { display: none; }
.has-files .dropzone__title { margin-top: 0; font-size: 1.05rem; }
.has-files .dropzone__sub { margin-bottom: 12px; }

kbd {
  font: inherit; font-size: .8em; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: 5px; padding: 1px 5px;
}

/* Auf Touch-Geräten gibt es weder Drag & Drop vom Desktop, Ordner-Auswahl noch Strg+V */
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .folder-only, .pointer-only { display: none; }
  .touch-only { display: inline; }
}

/* ---------- Meldungen ---------- */
.notices { display: flex; flex-direction: column; gap: 8px; }
.notices:empty { display: none; }
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .88rem;
  background: var(--warn-soft); border: 1px solid var(--warn-line);
}
.notice--error { background: var(--danger-soft); border-color: var(--danger-line); }
.notice__body { flex: 1; min-width: 0; }
.notice__title { margin: 0; font-weight: 700; color: var(--warn); }
.notice--error .notice__title { color: var(--danger); }
.notice__list { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.notice__list li { overflow-wrap: anywhere; }
.notice__close {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 2px; border-radius: 6px; line-height: 0;
}
.notice__close:hover { color: var(--text); }
.notice__close svg { width: 18px; height: 18px; }

/* ---------- Karten (Dateiliste, Ergebnisse) ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 20px 12px;
  min-width: 0;
}
.card__head {
  display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap;
  padding: 10px 0 12px; border-bottom: 1px solid var(--line);
}
.card__title { margin: 0; font-size: 1rem; font-weight: 600; }
.card__summary { margin: 0; color: var(--muted); font-size: .85rem; flex: 1; min-width: 140px; }
.results { border-color: var(--ok-line); }
#download-zip { padding: 9px 18px; font-size: .85rem; }
.results__status { margin: 8px 0 0; font-size: .82rem; color: var(--ok); }
.results__status:empty { display: none; }
.results__status.is-error { color: var(--danger); }

/* ---------- Dateizeilen ---------- */
.file-list { list-style: none; margin: 0; padding: 0; }

.file {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.file:last-child { border-bottom: 0; }

/* Vorschaubild: Schachbrett zeigt Transparenz */
.file__thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center;
  background-color: #2a2a2a;
  background-image:
    linear-gradient(45deg, #333 25%, transparent 25%),
    linear-gradient(-45deg, #333 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #333 75%),
    linear-gradient(-45deg, transparent 75%, #333 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}
.file__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file__thumb svg { width: 28px; height: 28px; color: var(--accent-light); }
.file__thumb--doc { background: var(--accent-soft); }
.file__thumb--error { background: var(--danger-soft); }
.file__thumb--error svg { color: var(--danger); }

.file__name {
  margin: 0; font-weight: 600; font-size: .92rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file__path { color: var(--muted); font-weight: 400; }
.file__meta {
  margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center;
  color: var(--muted); font-size: .8rem;
}
.file__message { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.file__message:empty { display: none; }

/* Status-Farben der Meldungszeile */
.file--error .file__message,
.file[data-status="failed"] .file__message { color: var(--danger); }
.file[data-status="done"] .file__message { color: var(--ok); }
.file[data-status="working"] .file__message,
.file[data-status="queued"] .file__message { color: var(--accent-light); }
.file[data-status="skipped"] .file__message { color: var(--warn); }
.file[data-status="working"] .file__thumb { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.badge {
  display: inline-block;
  font-size: .7rem; font-weight: 700; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 50px;
  background: var(--accent-soft); color: var(--accent-light);
  border: 1px solid var(--accent-line);
}
.file--error .badge { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.result .badge { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }

/* Aktionen rechts in der Zeile */
.file__actions { display: flex; align-items: center; gap: 8px; }
.file__target {
  width: auto; max-width: 150px;
  padding: 8px 10px; font-size: .82rem;
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 16px; height: 16px; }
.file__convert { color: var(--accent-light); border-color: var(--accent-line); }

.result__download { padding: 8px 16px; font-size: .82rem; }
.result__download svg { width: 16px; height: 16px; }

/* Neu hinzugefügte Zeilen kurz einblenden */
@keyframes file-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.file { animation: file-in .3s var(--ease); }

/* ---------- Panel (Einstellungen) ---------- */
.panel {
  background: var(--panel);
  border: 1px solid rgba(116,83,145,.22);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.panel__title { margin: 0; font-size: 1rem; font-weight: 600; }
.panel__group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel__group:disabled { opacity: .5; }
.panel__note:empty { display: none; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: 3px;
  color: var(--accent-light); font-weight: 700;
}
.hint { font-size: .8rem; color: var(--muted); margin: 0; }

/* Segment-Auswahl (Radio-Buttons als Pillen) – wie beim QR-Generator */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 50px; font-size: .85rem;
  color: var(--text); cursor: pointer; transition: border-color .2s, background .2s;
}
.seg label:has(input:checked) { border-color: var(--accent-light); background: var(--accent-soft); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.seg label:has(input:disabled) { opacity: .4; cursor: not-allowed; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); margin: 0; }

select {
  width: 100%;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; font-size: .88rem;
}
select option { background: #111; color: #fff; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.color-row { display: flex; gap: 12px; align-items: center; }
input[type="color"] {
  width: 52px; height: 40px; padding: 2px; flex: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}

.btn--wide { width: 100%; padding: 13px; font-size: .95rem; }

/* Modus-Umschalter (Umwandeln / Verkleinern) */
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; border-radius: 50px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.mode-switch label {
  position: relative;
  text-align: center; padding: 9px 10px; border-radius: 50px;
  font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer;
  transition: background .2s, color .2s;
}
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch label:has(input:checked) { background: var(--accent); color: #fff; box-shadow: 0 4px 15px rgba(116,83,145,.3); }
.mode-switch label:has(input:focus-visible) { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.mode-switch:has(input:disabled) { opacity: .5; }

.mode-section { display: flex; flex-direction: column; gap: 16px; }

.field__label--row { display: flex; justify-content: space-between; align-items: baseline; }
.field__label output { color: var(--text); letter-spacing: 1px; font-size: .85rem; }
.field__optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }

/* Maximale Breite/Höhe */
.size-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.size-row label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--muted); }
.unit-input { position: relative; display: block; }
.unit-input input {
  width: 100%;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 34px 10px 12px; font: inherit; font-size: .88rem;
  -moz-appearance: textfield;
}
.unit-input input::-webkit-outer-spin-button,
.unit-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-input input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.unit-input input::placeholder { color: rgba(255,255,255,.3); }
.unit-input > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: .78rem; font-weight: 600;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 50px; padding: 5px 12px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--accent-light); background: var(--accent-soft); }

.tip {
  margin: 0; font-size: .8rem; color: var(--muted);
  background: var(--warn-soft); border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.tip strong { color: var(--warn); }

/* Schieberegler – gleiches Design wie beim QR-Generator */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; margin: 0; padding: 0;
  background: transparent; cursor: pointer;
  --p: 50%;
}
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px; border: none;
  background: linear-gradient(to right, var(--accent-light) 0 var(--p), rgba(255,255,255,.14) var(--p) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  transition: transform .15s;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 6px rgba(0,0,0,.4); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; border: none; background: rgba(255,255,255,.14); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent-light); }
input[type="range"]::-moz-range-thumb {
  box-sizing: border-box; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

/* Ersparnis in der Ergebnisliste */
.saving { font-weight: 700; color: var(--ok); }
.result--kept .file__message { color: var(--warn); }
.result--kept .badge { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }

/* ---------- Fortschritt ---------- */
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress progress {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden;
  background: rgba(255,255,255,.1);
}
.progress progress::-webkit-progress-bar { background: rgba(255,255,255,.1); border-radius: 8px; }
.progress progress::-webkit-progress-value { background: var(--accent-light); border-radius: 8px; transition: width .2s; }
.progress progress::-moz-progress-bar { background: var(--accent-light); border-radius: 8px; }
.progress__text { margin: 0; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Erklärtext & FAQ (wie beim QR-Generator) ---------- */
.seo-text { max-width: var(--page-max); margin: 0 auto; padding: 8px var(--gutter) 48px; color: var(--muted); }
.seo-text h2 { color: var(--text); font-size: 1.35rem; font-weight: 600; margin: 32px 0 10px; }
.seo-text p, .seo-text li { font-size: .95rem; max-width: 760px; }
.seo-text ol, .seo-text ul { padding-left: 20px; }
.seo-text li { margin-bottom: 6px; }
.seo-text strong { color: var(--text); }
.seo-more { margin-top: 28px; }
.seo-more a { color: var(--accent-light); text-decoration: none; font-weight: 600; }
.seo-more a:hover { text-decoration: underline; }
.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; max-width: 760px; }
.faq details {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0 20px;
  transition: border-color .2s;
}
.faq details[open] { padding-bottom: 16px; border-color: rgba(116,83,145,.22); }
.faq summary {
  cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-light); font-size: 1.3rem; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; }

/* ---------- Handy: untere Leiste ---------- */
.mobile-bar { display: none; }
@media (max-width: 880px) {
  .mobile-bar:not([hidden]) {
    display: flex; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(10,10,10,.92);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(116,83,145,.3);
    animation: bar-in .25s var(--ease);
  }
  .mobile-bar .btn { padding: 12px 16px; }
  .mobile-bar .btn:last-child { flex: 1; }
  body.has-mobile-bar { padding-bottom: 80px; }
}
@keyframes bar-in { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- Handy ---------- */
@media (max-width: 600px) {
  .dropzone { padding: 28px 16px 22px; }
  .dropzone__buttons .btn { flex: 1 1 100%; }
  .card { padding: 4px 14px 8px; }
  .file { grid-template-columns: 48px minmax(0, 1fr); gap: 4px 10px; }
  .file__thumb { width: 48px; height: 48px; grid-row: span 2; }
  .file__actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .file__target { max-width: none; flex: 1; }
}
