/* =============================================================================================
   FotoStacking Tool V3.0 – Stylesheet (ERSATZ-FASSUNG vom 19.10.2026)
   ---------------------------------------------------------------------------------------------
   Neu aufgebaut, weil die Original-style.css (V2.9) beim Erstellen dieses Pakets nicht erreichbar
   war (Hauptrechner offline). Deckt alle Klassen aus index.html/app.js ab: dunkles Design mit
   Violett-Akzent wie bisher. Sobald du wieder am Hauptrechner bist, kannst du einfach deine
   Original-style.css hineinkopieren – aufnahme.css (Mikroskop) bleibt davon unabhängig.
   Farben ohne Rot/Grün-Gegensätze (Blau/Violett/Bernstein).
   ============================================================================================= */

/* ---- Schrift (liegt lokal im Ordner fonts/, nichts wird aus dem Internet geladen) ---------- */
@font-face {
    font-family: 'Inter';
    font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Farben und Maße ------------------------------------------------------------------------ */
:root {
    --bg-primary: #0e0e14;        /* Seitenhintergrund */
    --bg-secondary: #15151e;      /* Kopfzeile, Seitenleiste */
    --bg-tertiary: #1c1c28;       /* Kästen */
    --bg-input: #101018;          /* Eingabefelder */
    --bg-hover: #262636;
    --border-color: rgba(255, 255, 255, 0.09);
    --text-primary: #e9e9f2;
    --text-secondary: #c2c2d2;
    --text-muted: #8e8ea6;
    --accent: #8b5cf6;
    --accent-dark: #6d28d9;
    --accent-light: #c4b5fd;
    --accent-soft: rgba(139, 92, 246, 0.16);
    --warning: #f59e0b;
    --radius: 10px;
    --sidebar-width: 320px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    font-size: 13px; line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;                      /* die Bereiche scrollen einzeln */
}
a { color: var(--accent-light); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* ---- Grundgerüst ---------------------------------------------------------------------------- */
.app-container { display: flex; flex-direction: column; height: 100vh; }

.app-header {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 18px;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border-color);
}
.header-left, .header-right { display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 30px; height: 30px; color: var(--accent); flex: 0 0 auto; }
.header-titles { display: flex; flex-direction: column; line-height: 1.2; }
.header-titles h1 { font-size: 17px; letter-spacing: -0.01em; }
.header-subtitle { font-size: 11px; color: var(--text-muted); }
.header-subtitle a { color: var(--text-muted); text-decoration: none; }
.header-subtitle a:hover { color: var(--accent-light); }
.version-badge {
    font-size: 11px; color: var(--accent-light);
    background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.image-counter {
    display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary);
    background: var(--bg-tertiary); border: 1px solid var(--border-color); padding: 6px 10px; border-radius: 8px;
}
.image-counter #imageCount { font-weight: 700; color: var(--text-primary); }

.main-content { flex: 1; min-height: 0; display: flex; }

/* ---- Seitenleiste --------------------------------------------------------------------------- */
.sidebar {
    flex: 0 0 var(--sidebar-width); width: var(--sidebar-width);
    overflow-y: auto; padding: 12px;
    background: var(--bg-secondary); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; gap: 10px;
}
.panel { background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius); }
.panel-header { padding: 10px 12px 0; }
.panel-header h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent-light); }
.panel-body { padding: 10px 12px 12px; }

.setting-group { margin-bottom: 10px; }
.setting-group:last-child { margin-bottom: 0; }
.setting-label {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 12px; color: var(--text-secondary); margin-bottom: 4px;
}
.setting-controls { display: flex; align-items: center; gap: 4px; }
.setting-input, .select-control {
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: 6px;
    padding: 5px 7px; font: inherit; font-size: 12px;
}
.setting-controls .setting-input { width: 62px; text-align: right; }
.select-control { width: 100%; }
.setting-input:focus, .select-control:focus { outline: none; border-color: var(--accent); }
.setting-hint { font-size: 11px; color: var(--text-muted); margin: 4px 0 0; }

/* Schieberegler */
.setting-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); outline: none; margin: 6px 0 2px;
}
.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); border: 2px solid #fff; cursor: pointer;
}
.setting-slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: pointer; }

.btn-reset {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border-color);
    border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: 13px; line-height: 1;
}
.btn-reset:hover { color: var(--text-primary); border-color: var(--accent); }

/* Schalter (Checkbox im Stil eines Kippschalters) */
.toggle-control { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.toggle-control input { position: absolute; opacity: 0; width: 0; height: 0; }
.control-indicator {
    position: relative; flex: 0 0 auto; width: 30px; height: 17px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.14); transition: background 0.15s;
}
.control-indicator::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%;
    background: #fff; transition: transform 0.15s;
}
.toggle-control input:checked + .control-indicator { background: var(--accent); }
.toggle-control input:checked + .control-indicator::after { transform: translateX(13px); }
.toggle-control input:focus-visible + .control-indicator { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.toggle-control input:disabled + .control-indicator { opacity: 0.4; }

/* Modus-Auswahl */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mode-btn {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    background: var(--bg-input); color: var(--text-secondary);
    border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 4px; cursor: pointer; font: inherit;
}
.mode-btn:hover { border-color: rgba(139, 92, 246, 0.5); }
.mode-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text-primary); }
.mode-icon { font-size: 17px; line-height: 1.2; }
.mode-label { font-size: 12px; font-weight: 600; }
.mode-desc { font-size: 10px; color: var(--text-muted); }

/* Exportformat */
.format-toggle { display: flex; gap: 4px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 8px; padding: 3px; }
.format-btn { flex: 1; background: transparent; color: var(--text-secondary); border: none; border-radius: 6px; padding: 6px; cursor: pointer; font: inherit; font-size: 12px; }
.format-btn.active { background: var(--accent); color: #fff; }

/* Knöpfe */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-size: 12px; font-weight: 500;
    padding: 8px 14px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--border-color); background: var(--bg-tertiary); color: var(--text-primary);
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover:not(:disabled) { background: var(--bg-hover); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: transparent; color: #fff; font-weight: 600; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.btn-secondary { background: var(--bg-hover); }
.btn-ghost { background: transparent; }
.btn-icon { width: 16px; height: 16px; }
.actions-panel { display: flex; flex-direction: column; gap: 8px; }
.actions-panel .btn { width: 100%; padding: 10px 14px; }

/* ---- Arbeitsfläche rechts ------------------------------------------------------------------- */
.canvas-area { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px; gap: 10px; }

/* Ablagefläche */
.dropzone {
    flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
    border: 2px dashed rgba(139, 92, 246, 0.35); border-radius: 14px; cursor: pointer;
    background: rgba(139, 92, 246, 0.03); transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-content { max-width: 460px; padding: 20px; }
.dropzone-icon svg { width: 76px; height: 76px; color: var(--accent-light); }
.dropzone-title { font-size: 20px; margin: 10px 0 4px; }
.dropzone-text { color: var(--text-secondary); margin: 0 0 10px; }
.dropzone-formats { font-size: 11px; color: var(--text-muted); margin: 2px 0; }
.dropzone-privacy { font-size: 11px; color: var(--accent-light); margin-top: 12px; }

/* Vorschau mit Werkzeugleiste */
.preview-area { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; background: var(--bg-secondary); }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 4px; }
.toolbar-btn {
    display: inline-flex; align-items: center; gap: 5px; background: transparent; color: var(--text-secondary);
    border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; cursor: pointer; font: inherit; font-size: 12px;
}
.toolbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.toolbar-btn svg { width: 15px; height: 15px; }
.toolbar-separator { width: 1px; height: 18px; background: var(--border-color); margin: 0 4px; }
.zoom-level { font-size: 11px; color: var(--text-muted); min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.view-toggle { display: flex; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 8px; padding: 2px; }
.view-btn { background: transparent; color: var(--text-secondary); border: none; border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 12px; }
.view-btn.active { background: var(--accent); color: #fff; }

/* Bildfläche: Bild liegt mittig, Zoom/Verschieben macht app.js per transform */
.canvas-container {
    position: relative; flex: 1; min-height: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background:                                     /* dezentes Schachbrett für Transparenz */
        repeating-conic-gradient(#14141c 0% 25%, #191923 0% 50%) 50% / 24px 24px;
    touch-action: none;
}
.canvas-wrapper { position: relative; flex: 0 0 auto; transform-origin: center center; line-height: 0; }
.canvas-wrapper canvas { display: block; }
#overlayCanvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }

/* Vergleichsregler */
.compare-slider { position: absolute; inset: 0; pointer-events: none; }
.compare-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); }
.compare-handle {
    position: absolute; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%);
    border-radius: 50%; background: #fff; color: var(--accent-dark); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center; pointer-events: auto; cursor: ew-resize;
}
.compare-handle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.compare-label { position: absolute; top: 10px; font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; }
.compare-label-left { left: 10px; }
.compare-label-right { right: 10px; }

/* Ladeanzeige */
.loading-overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(8, 8, 12, 0.72); backdrop-filter: blur(2px); }
.loading-content { text-align: center; width: min(340px, 80%); }
.loading-spinner { width: 38px; height: 38px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent); animation: fst-dreh 0.9s linear infinite; }
@keyframes fst-dreh { to { transform: rotate(360deg); } }
.loading-text { margin: 0 0 10px; color: var(--text-secondary); }
.progress-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-light)); transition: width 0.2s; }
.progress-percent { display: block; margin-top: 6px; font-size: 11px; color: var(--text-muted); }

.canvas-label { position: absolute; left: 10px; bottom: 10px; z-index: 5; font-size: 11px; padding: 4px 9px; border-radius: 6px; background: rgba(0, 0, 0, 0.65); color: #fff; }
.canvas-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); pointer-events: none; }

/* Bildleiste unten */
.image-strip { flex: 0 0 auto; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; padding: 8px 10px; }
.strip-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.strip-header h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent-light); }
.strip-count { font-size: 11px; color: var(--text-muted); }
.strip-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.strip-thumb {
    position: relative; flex: 0 0 auto; width: 92px; height: 64px; border-radius: 8px; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; background: #000;
}
.strip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-thumb.active { border-color: var(--accent); }
.strip-thumb-index { position: absolute; left: 4px; bottom: 3px; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.7); color: #fff; }
.strip-thumb-remove {
    position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; border: none;
    background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.strip-thumb:hover .strip-thumb-remove, .strip-thumb.active .strip-thumb-remove { opacity: 1; }
.strip-thumb-remove:hover { background: var(--warning); color: #000; }

/* ---- Anleitung (Fenster) -------------------------------------------------------------------- */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(5, 5, 10, 0.72); align-items: center; justify-content: center; }
.modal-content { width: min(760px, 94vw); max-height: 88vh; display: flex; flex-direction: column; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { font-size: 16px; }
.modal-close { background: transparent; border: none; color: var(--text-muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 16px 20px; overflow-y: auto; color: var(--text-secondary); }
.modal-body h3 { font-size: 15px; color: var(--text-primary); margin-bottom: 6px; }
.modal-body h4 { font-size: 13px; color: var(--accent-light); margin: 16px 0 6px; }
.modal-body ul, .modal-body ol { padding-left: 20px; margin: 0; }
.modal-body li { margin-bottom: 5px; }
.modal-body strong { color: var(--text-primary); }
.modal-legal { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--border-color); font-size: 11px; color: var(--text-muted); }

/* Bildlaufleisten dezent */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Schmale Bildschirme (Tablet/Handy): untereinander statt nebeneinander ------------------- */
@media (max-width: 860px) {
    body { overflow: auto; }
    .app-container { height: auto; min-height: 100vh; }
    .app-header { flex-wrap: wrap; }
    .main-content { flex-direction: column; }
    .sidebar { width: 100%; flex-basis: auto; border-right: none; border-bottom: 1px solid var(--border-color); overflow: visible; }
    .canvas-area { min-height: 70vh; }
}
