/* ==========================================================================
   Video Fixer — styles.css
   Client-side (ffmpeg.wasm) video repair tool for techtools.cz
   Dark theme, mobile-first. Palette mirrors the OCR/scad-to-stl house tokens.
   Loaded AFTER /shared-topnav.css so :root can seed --tt-topnav-h.
   ========================================================================== */

:root {
    --tt-topnav-h: 64px;               /* seed; tt-navbar.js publishes the exact px live */

    --bg: #0a0a0f; --bg-2: #0e0e15; --panel: #14141d; --panel-2: #1a1a26; --inset: #101019;
    --border: rgba(255,255,255,0.10); --border-2: rgba(255,255,255,0.16);
    --text: #f2f3f8; --text-2: rgba(242,243,248,0.72); --text-3: rgba(242,243,248,0.46);

    --indigo:#6366f1; --violet:#8b5cf6; --cyan:#06b6d4; --teal:#14b8a6;
    --green:#22c55e; --amber:#f59e0b; --red:#f87171; --rose:#f43f5e;

    --accent: var(--rose);             /* Video Fixer signature: rose→amber */
    --accent-2: var(--amber);
    --grad: linear-gradient(135deg, var(--rose), var(--amber));
    --grad-soft: linear-gradient(135deg, rgba(244,63,94,0.16), rgba(245,158,11,0.16));

    --r-sm:7px; --r-md:11px; --r-lg:16px; --r-xl:22px;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --shadow: 0 18px 50px -22px rgba(0,0,0,0.75);
    --shadow-lg: 0 30px 80px -30px rgba(0,0,0,0.85);
    --ease: cubic-bezier(0.22,1,0.36,1);
    --tap: 40px;
}
@media (pointer: coarse) { :root { --tap: 44px; } }

* { box-sizing: border-box; }

html, body {
    margin: 0; height: 100%;
    background: var(--bg); color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    overflow-x: clip;                  /* NOT hidden — hidden breaks position:sticky navbar */
    overscroll-behavior-y: none;
}

/* App shell — NOT a direct sticky/fixed child, so tt-navbar's conflict guard mounts.
   Scrolls normally (this is a content page, not a full-height canvas app). */
.app {
    min-height: calc(100dvh - var(--tt-topnav-h));
    display: flex; flex-direction: column;
    width: 100%;
}

.wrap { width: 100%; max-width: 940px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- decorative page glow ------------------------------------------------ */
.app::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60% 40% at 80% -5%, rgba(244,63,94,0.10), transparent 60%),
        radial-gradient(50% 40% at 0% 0%, rgba(245,158,11,0.08), transparent 55%);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { padding: clamp(30px, 6vw, 60px) 0 clamp(20px, 3vw, 30px); text-align: center; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--accent); background: var(--grad-soft);
    border: 1px solid rgba(244,63,94,0.28); border-radius: 999px; padding: 6px 14px;
    margin-bottom: 18px;
}
.hero h1 {
    font-size: clamp(1.9rem, 6vw, 3.1rem); line-height: 1.05; font-weight: 800;
    letter-spacing: -0.02em; margin: 0 0 14px;
}
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub {
    font-size: clamp(1rem, 2.6vw, 1.22rem); color: var(--text-2);
    max-width: 620px; margin: 0 auto 24px; line-height: 1.5;
}

/* privacy badges — the SEO/positioning centrepiece */
.privacy-badges {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.pbadge {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.86rem; font-weight: 600; color: var(--text);
    background: var(--panel); border: 1px solid var(--border-2);
    border-radius: 999px; padding: 8px 15px;
}
.pbadge i { color: var(--green); font-size: 0.9rem; }
.pbadge.is-key { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.08); }

/* ==========================================================================
   FIXER CARD (the tool)
   ========================================================================== */
.fixer {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border-2); border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: clamp(18px, 3vw, 28px);
    margin: 10px 0 40px;
}

/* ---- dropzone ------------------------------------------------------------ */
.dropzone {
    position: relative;
    border: 2px dashed rgba(255,255,255,0.18); border-radius: var(--r-lg);
    background: var(--inset);
    padding: clamp(28px, 6vw, 52px) 22px; text-align: center;
    cursor: pointer; transition: border-color var(--ease) .2s, background var(--ease) .2s, transform var(--ease) .2s;
}
.dropzone:hover { border-color: rgba(244,63,94,0.5); background: #0d0d16; }
.dropzone.is-drag { border-color: var(--accent); background: rgba(244,63,94,0.07); transform: scale(1.006); }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dz-icon {
    width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 18px;
    display: grid; place-items: center; font-size: 1.7rem; color: #fff;
    background: var(--grad); box-shadow: 0 12px 30px -12px rgba(244,63,94,0.7);
}
.dz-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 6px; }
.dz-sub { color: var(--text-2); margin: 0 0 18px; font-size: 0.95rem; }
.dz-hint { color: var(--text-3); font-size: 0.82rem; margin-top: 16px; }
.dz-hint code { font-family: var(--mono); color: var(--text-2); }

/* ---- buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: var(--tap); padding: 0 20px;
    font: inherit; font-weight: 650; font-size: 0.95rem; color: var(--text);
    background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r-md);
    cursor: pointer; transition: transform .12s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--panel-2); border-color: rgba(255,255,255,0.28); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    color: #fff; background: var(--grad); border: none;
    box-shadow: 0 12px 30px -14px rgba(244,63,94,0.8);
}
.btn-primary:hover { filter: brightness(1.06); background: var(--grad); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1.02rem; }
.btn-ghost { background: transparent; }
.btn-danger { color: #fff; background: var(--red); border: none; }
.btn-block { width: 100%; }

/* ==========================================================================
   STAGES (dropzone → engine-load → diagnosis → working → result)
   only one visible at a time via [hidden]
   ========================================================================== */
[hidden] { display: none !important; }   /* beat any author display rule (origin, not specificity) */

.stage { animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* progress bar (engine download + encode) */
.pbar { height: 10px; border-radius: 999px; background: var(--inset); overflow: hidden; border: 1px solid var(--border); }
.pbar > i { display: block; height: 100%; width: 0%; background: var(--grad); transition: width .25s var(--ease); }
.pbar.is-indeterminate > i { width: 40% !important; animation: slide 1.1s linear infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

.status-line { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--text-2); font-size: 0.95rem; }
.status-line .spin { color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stage-pad { padding: clamp(18px, 4vw, 34px) 6px; text-align: center; }
.stage-pad h2 { font-size: 1.2rem; margin: 0 0 8px; }
.stage-pad p { color: var(--text-2); margin: 0 auto; max-width: 460px; }

/* ---- diagnosis ----------------------------------------------------------- */
.diag-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.diag-file { display: flex; align-items: center; gap: 12px; min-width: 0; }
.diag-file .fi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); font-size: 1.15rem; flex: none; }
.diag-file .meta { min-width: 0; }
.diag-file .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.diag-file .sub { color: var(--text-3); font-size: 0.82rem; }

.verdict { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px; font-weight: 650; font-size: 0.9rem; margin-left: auto; }
.verdict.bad { color: var(--amber); background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); }
.verdict.ok  { color: var(--green); background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.35); }

/* the technical spec grid */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.spec {
    background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 11px 13px;
}
.spec .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin-bottom: 4px; }
.spec .v { font-family: var(--mono); font-size: 0.92rem; font-weight: 600; word-break: break-word; }
.spec .v.warn { color: var(--amber); }
.spec .v.good { color: var(--green); }

/* issues list */
.issues { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.issue { display: flex; gap: 12px; padding: 13px 15px; border-radius: var(--r-md); background: var(--inset); border: 1px solid var(--border); }
.issue .ic { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 0.82rem; }
.issue.block .ic { color: var(--red); background: rgba(248,113,113,0.14); }
.issue.warn .ic  { color: var(--amber); background: rgba(245,158,11,0.14); }
.issue.good .ic  { color: var(--green); background: rgba(34,197,94,0.14); }
.issue .tx { font-size: 0.92rem; line-height: 1.45; }
.issue .tx b { color: var(--text); }

.plan {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 20px;
    background: var(--grad-soft); border: 1px solid rgba(244,63,94,0.3); border-radius: var(--r-md);
}
.plan i { color: var(--accent); margin-top: 2px; }
.plan .tx { font-size: 0.92rem; line-height: 1.5; }
.plan .tx b { font-weight: 700; }

.diag-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* advanced disclosure */
.adv { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.adv > summary { cursor: pointer; color: var(--text-2); font-size: 0.88rem; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary .chev { transition: transform .2s var(--ease); }
.adv[open] > summary .chev { transform: rotate(90deg); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.82rem; color: var(--text-3); font-weight: 600; }
.ctrl {
    min-height: var(--tap); padding: 0 12px; font: inherit; font-size: 0.92rem;
    color: var(--text); background: var(--panel); border: 1px solid var(--border-2);
    border-radius: var(--r-sm); cursor: pointer;
}
.ctrl:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* dark-theme <option>: literal hex — native option lists don't inherit the theme (Rule 9.6) */
.ctrl option, select.ctrl option { background-color: #1a1a26; color: #f2f3f8; }
.chk { display: flex; align-items: center; gap: 9px; min-height: var(--tap); font-size: 0.9rem; color: var(--text-2); cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* ---- result -------------------------------------------------------------- */
.result-hero { text-align: center; padding: 8px 6px 4px; }
.result-hero .tick { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; color: #fff; background: linear-gradient(135deg, var(--green), var(--teal)); box-shadow: 0 14px 34px -14px rgba(34,197,94,0.7); }
.result-hero h2 { font-size: 1.4rem; margin: 0 0 6px; }
.result-hero p { color: var(--text-2); margin: 0 auto 22px; max-width: 440px; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.result-summary { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 24px auto 4px; max-width: 480px; }
.rs-col { background: var(--inset); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; text-align: left; }
.rs-col .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 6px; }
.rs-col .v { font-family: var(--mono); font-size: 0.84rem; line-height: 1.5; }
.rs-arrow { color: var(--accent); font-size: 1.1rem; }

/* error/log surface */
.errbox { margin-top: 16px; background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.3); border-radius: var(--r-md); padding: 14px 16px; }
.errbox h3 { margin: 0 0 6px; font-size: 0.98rem; color: var(--red); display: flex; align-items: center; gap: 8px; }
.errbox p { margin: 0 0 8px; color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }
.log-view { max-height: 160px; overflow: auto; background: #08080d; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; font-family: var(--mono); font-size: 0.76rem; color: var(--text-3); white-space: pre-wrap; word-break: break-word; }

/* ==========================================================================
   CONTENT SECTIONS (SEO depth)
   ========================================================================== */
.section { padding: clamp(26px, 5vw, 46px) 0; border-top: 1px solid var(--border); }
.section h2 { font-size: clamp(1.35rem, 3.4vw, 1.9rem); font-weight: 800; letter-spacing: -0.01em; margin: 0 0 8px; }
.section .lead { color: var(--text-2); font-size: 1.02rem; line-height: 1.6; max-width: 660px; margin: 0 0 24px; }
.section p { color: var(--text-2); line-height: 1.65; }

.prose p { margin: 0 0 14px; max-width: 720px; }
.prose strong { color: var(--text); }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--inset); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.step .n { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); margin-bottom: 14px; }
.step h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step p { margin: 0; font-size: 0.92rem; }

/* feature grid ("what it fixes") */
.fix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.fix-item { display: flex; gap: 13px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; }
.fix-item .ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.05rem; color: var(--accent); background: var(--grad-soft); }
.fix-item h3 { margin: 0 0 4px; font-size: 0.98rem; }
.fix-item p { margin: 0; font-size: 0.87rem; }

/* supported formats table */
.fmt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; overflow: hidden; border-radius: var(--r-md); }
.fmt-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.fmt-table th, .fmt-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.fmt-table th { background: var(--inset); color: var(--text-3); font-size: 0.74rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.fmt-table tr:last-child td { border-bottom: none; }
.fmt-table td code { font-family: var(--mono); font-size: 0.84em; color: var(--text-2); }
.tag-ok { color: var(--green); font-weight: 600; }
.tag-fix { color: var(--amber); font-weight: 600; }

/* ---- FAQ (accordion) ----------------------------------------------------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.faq-item > summary {
    cursor: pointer; list-style: none; padding: 16px 18px; font-weight: 650; font-size: 1rem;
    display: flex; align-items: center; gap: 12px; justify-content: space-between;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary .fq-plus { flex: none; color: var(--accent); transition: transform .2s var(--ease); }
.faq-item[open] > summary .fq-plus { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 18px 18px; color: var(--text-2); line-height: 1.6; font-size: 0.95rem; }
.faq-item .faq-a p { margin: 0 0 10px; } .faq-item .faq-a p:last-child { margin: 0; }

/* ---- footer note --------------------------------------------------------- */
.foot { padding: 30px 0 50px; text-align: center; color: var(--text-3); font-size: 0.85rem; }
.foot a { color: var(--text-2); }

/* ==========================================================================
   TOASTS
   ========================================================================== */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: calc(var(--tt-z-modal, 1000) + 20); display: flex; flex-direction: column; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: var(--r-md); background: #1c1c28; border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 0.92rem; animation: toastin .28s var(--ease); }
.toast i:first-child { flex: none; }
.toast.ok i:first-child { color: var(--green); }
.toast.err i:first-child { color: var(--red); }
.toast.info i:first-child { color: var(--cyan); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
    .diag-file .name { max-width: 60vw; }
    .verdict { margin-left: 0; }
    .diag-head { gap: 10px; }
    .result-summary { grid-template-columns: 1fr; }
    .rs-arrow { transform: rotate(90deg); justify-self: center; }
    .btn-block-sm { width: 100%; }
    .diag-actions .btn { width: 100%; }
}
@media (max-width: 768px) {
    /* disable heavier motion on mobile for perf */
    .stage { animation: none; }
    .app::before { background: radial-gradient(70% 40% at 80% 0%, rgba(244,63,94,0.08), transparent 60%); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
