/* ============================================================
   ITK AVIF-Konverter – Stylesheet
   Aktenzeichen: AVIF-KONV-2025/001
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1a4d8f;
    --primary-dark: #123761;
    --success: #2e8b57;
    --error: #c0392b;
    --warning: #d68910;
    --bg: #f4f6f9;
    --panel-bg: #ffffff;
    --border: #d8dde6;
    --text: #2c3e50;
    --text-muted: #6c7a89;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* ============ TOPBAR ============ */
.topbar {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { font-size: 36px; }
.brand h1 { font-size: 20px; font-weight: 600; }
.subtitle { font-size: 12px; opacity: 0.85; }

.status-badges { display: flex; gap: 8px; }
.badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
}
.badge.ok { background: var(--success); }
.badge.err { background: var(--error); }

/* ============ ALERTS ============ */
.alert {
    max-width: 1200px;
    margin: 16px auto;
    padding: 14px 20px;
    border-radius: 6px;
    border-left: 4px solid;
}
.alert-error {
    background: #fdecea;
    border-color: var(--error);
    color: #7a1f17;
}
.alert code { background: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 3px; }

/* ============ CONTAINER & PANELS ============ */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
    display: grid;
    gap: 20px;
}
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.panel h2 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}
.hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}
code {
    font-family: "Monaco", "Consolas", monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
}

/* ============ DROPZONE ============ */
.dropzone {
    display: block;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: #eaf1fa;
}
.dropzone input[type="file"] { display: none; }
.dropzone-text { color: var(--text-muted); font-size: 15px; }

/* ============ FILE LIST ============ */
.file-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 13px;
}
.file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { color: var(--text-muted); margin: 0 12px; }
.file-item .file-remove {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 18px;
}

/* ============ FORM ============ */
.form-row {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-row label { font-weight: 500; font-size: 14px; }
.form-row small { color: var(--text-muted); font-size: 12px; }
.form-row input[type="range"] { width: 100%; }
.form-row input[type="checkbox"] { margin-right: 8px; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #c5ccd6; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #246b43; }
.btn-danger { background: var(--error); color: white; }
.btn-large { padding: 14px 28px; font-size: 16px; width: 100%; }

/* ============ FOLDER BROWSER ============ */
.folder-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.current-path {
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.current-path strong { color: var(--text); font-family: "Monaco", "Consolas", monospace; }

.folder-browser {
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg);
}
.folder-entry {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
    gap: 10px;
}
.folder-entry:last-child { border-bottom: none; }
.folder-entry:hover { background: #eaf1fa; }
.folder-entry .icon { font-size: 18px; }
.folder-entry .name { flex: 1; font-size: 14px; }
.folder-entry .actions { display: flex; gap: 4px; }
.folder-entry .actions button {
    background: none;
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}
.folder-entry .actions button:hover { background: white; }
.folder-entry.selected { background: #d4e3f5; border-left: 4px solid var(--primary); }

/* ============ PROGRESS ============ */
.progress-area { margin-top: 20px; }
.progress-bar-wrap {
    width: 100%;
    height: 22px;
    background: var(--bg);
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.3s;
}
#progressText {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ============ RESULT LIST ============ */
.result-list { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.result-item {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.result-item.ok { background: #e8f5ed; border-left: 4px solid var(--success); }
.result-item.err { background: #fdecea; border-left: 4px solid var(--error); }
.result-item .savings { font-weight: 600; color: var(--success); }

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; }
    .panel { padding: 16px; }
    .container { padding: 0 12px; }
}
