/* === AI Tools — Global Overrides === */

:root {
    --pico-font-size: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--pico-secondary-border) var(--pico-background-color);
    /* Backdrop behind canvases (preview workspace + the result viewer). Doubles
       as what shows through transparent output pixels. Neutral dark gray reads
       better than pure black. */
    --workspace-bg: #1e1e1e;
}

/* ── Accent ───────────────────────────────────────────────────────────────
   One brand colour everywhere. Pico ships a sky-blue primary; we repoint its
   primary tokens to the updraft indigo so the wordmark, active tab, segmented
   toggles, focus rings, and form accents all speak with one voice. Loaded
   after pico.min.css, so equal-specificity overrides win. */
[data-theme="dark"] {
    --pico-primary: #6366f1;
    --pico-primary-background: #6366f1;
    --pico-primary-hover: #818cf8;
    --pico-primary-hover-background: #4f46e5;
    --pico-primary-border: #6366f1;
    --pico-primary-inverse: #fff;
    --pico-primary-focus: rgba(99, 102, 241, 0.375);
    --pico-primary-underline: rgba(99, 102, 241, 0.5);
}

/* Nav brand */
nav .brand {
    color: #6366f1;
}
nav .brand-icon {
    height: 2.25em;
    vertical-align: -0.35em;
    margin: 0 -0.5em;
}

/* Compact form controls inside tool UIs */
.controls select,
.controls input {
    margin-bottom: 0;
}

/* Feature tab bar */
nav .feature-tabs {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
nav .feature-tabs > li {
    padding: 0;
}
nav a.feature-tab {
    display: inline-flex;
    align-items: center;
    /* Pico gives nav links a negative horizontal margin (offsetting their
       padding); zero it so spacing is owned entirely by the flex gap and the
       active fill can't bleed into its neighbours. */
    margin: 0;
    padding: 0.3rem 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--pico-border-radius);
    color: var(--pico-contrast);
    font-size: 0.8rem;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
nav a.feature-tab .tab-label {
    margin-left: 0.45rem;
}
nav a.feature-tab:not([aria-current="page"]):hover {
    background: color-mix(in oklab, var(--pico-contrast) 12%, transparent);
    color: var(--pico-contrast);
}
nav a.feature-tab[aria-current="page"] {
    background: var(--pico-primary-background, var(--pico-primary));
    border-color: var(--pico-primary-background, var(--pico-primary));
    color: var(--pico-primary-inverse, #fff);
}

/* Feature sections */
[id^="feature-"] {
    animation: fadeIn 0.15s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Control system ─────────────────────────────────────────────────────────
   The shared vocabulary every feature's settings band is built from: a band
   that ends in a divider, "cards" labelled by a floating legend, and segmented
   pill toggles. Features compose the parts they need; the look is identical
   across all of them because it lives here, once. */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
    align-items: stretch;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}
.controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
    font-size: 0.8rem;
    white-space: nowrap;
}
.controls select,
.controls input {
    margin-bottom: 0;
    padding-block: 0.3rem;
    font-size: 0.8rem;
    width: auto;
}
/* Pico sizes switches/checkboxes with zero padding -- the knob is height:100%
   of the content box, so the compact padding-block above would crush it to a
   dot. Restore zero padding while keeping the compact font-size. */
.controls input[type="checkbox"],
.controls input[type="radio"] {
    padding-block: 0;
}
.controls select:not([multiple], [size]) {
    padding-inline-start: 0.7rem;
    padding-inline-end: 2.25rem;
    background-position: center right 0.7rem;
    overflow: hidden;
    white-space: nowrap;
}
.controls .utility-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    align-self: center;
    margin-left: auto;
}

/* A bordered group named by a legend that straddles its top edge. */
.control-card {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 0 0 auto;
    gap: 0.4rem 0.5rem;
    margin-bottom: 0;
    padding: 0.7rem 0.6rem 0.45rem;
    border: 1px solid var(--pico-form-element-border-color, #444);
    border-radius: var(--pico-border-radius);
}
.control-card .card-tab {
    position: absolute;
    top: 0;
    left: 0.7rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.05rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pico-muted-color);
    background: var(--pico-background-color);
}
.control-card .card-tab i {
    font-size: 0.75rem;
}

/* Segmented toggle: one bordered group, transparent buttons, brand fill on the
   active one. */
.pill-group {
    display: flex;
    width: fit-content;
    margin-bottom: 0;
    border: 1px solid var(--pico-form-element-border-color, #444);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
}
.pill-group .pill {
    appearance: none;
    margin: 0;
    width: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--pico-contrast);
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pill-group .pill + .pill {
    border-left: 1px solid var(--pico-form-element-border-color, #444);
}
.pill-group .pill.active {
    background: var(--pico-primary-background, var(--pico-primary));
    color: var(--pico-primary-inverse, #fff);
}
.pill-group .pill:not(.active):hover {
    background: color-mix(in oklab, var(--pico-contrast) 10%, transparent);
}
.pill-group .pill:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Drop zone ──────────────────────────────────────────────────────────────
   One dashed intake surface, whether it accepts stills (.drop-zone-area, the
   shared component) or video/GIF (.drop-area, the interpolator's own). */
.drop-zone-area,
.drop-area {
    border: 2px dashed var(--pico-muted-border-color, #444);
    border-radius: var(--pico-border-radius);
    padding: 3rem 1rem;
    text-align: center;
    color: var(--pico-muted-color, #666);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.drop-zone-area:hover,
.drop-area:hover,
.drop-zone-area.dragover,
.drop-area.drag {
    border-color: var(--pico-primary);
    color: var(--pico-primary);
    background: color-mix(in oklab, var(--pico-primary) 6%, transparent);
}
.drop-zone-area > .fas,
.drop-area > .fas {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 0.5rem;
}
