/*
 * Video background remover.
 *
 * Follows the audio-to-text tool's structure deliberately - same hero, same
 * card rhythm, same progress vocabulary - because the two behave the same way
 * and should not look like they came from different sites. The palette is this
 * site's blue rather than that tool's indigo, so the pages are siblings and
 * not clones.
 *
 * The one idea unique to this tool is transparency, and it has to be SHOWN:
 * a transparent video on a white page looks exactly like a broken one. That is
 * what the chequerboard behind the result player is for, and why it only
 * appears when the output actually has an alpha channel.
 *
 * Scoped under .vbg- throughout because this loads alongside the site-wide
 * stylesheet and must not reach anything outside this page.
 */

.vbg-hero,
.vbg-section {
    --vbg-primary: #2583dc;
    --vbg-primary-dark: #1a6ec0;
    --vbg-navy: #343a52;
    --vbg-ink: #1f2937;
    --vbg-muted: #6b7280;
    --vbg-line: #e5e7eb;
    --vbg-surface: #ffffff;
    --vbg-offset: #f8f2ee;
    --vbg-bg: #f8fafc;
}

/* ---- hero -------------------------------------------------------------- */

.vbg-hero {
    background: linear-gradient(135deg, #343a52 0%, #2583dc 100%);
    color: #fff;
    padding: 64px 0 72px;
}

.vbg-hero-title {
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
}

.vbg-hero-lead {
    font-size: 1.08rem;
    line-height: 1.65;
    /* Not pure white: full-contrast body text beside a full-contrast heading
       leaves the eye nothing to rank. */
    color: rgba(255, 255, 255, 0.92);
    max-width: 46rem;
    margin-bottom: 22px;
}

.vbg-hero-points {
    list-style: none;
    padding: 0;
    margin: 0 0 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
}

.vbg-hero-points li {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 8px;
}

.vbg-hero-points i {
    opacity: 0.85;
}

.vbg-hero-cta {
    font-weight: 600;
    color: var(--vbg-primary-dark);
    border-radius: 10px;
    padding: 12px 26px;
}

/* The illustration: a subject lifted off a chequerboard, which is what
   transparency looks like in every editor a visitor has used. */
.vbg-hero-art {
    position: relative;
    width: 300px;
    height: 240px;
    margin: 0 auto;
}

.vbg-hero-art-checker {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #d9dee8 25%, transparent 25%),
        linear-gradient(-45deg, #d9dee8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d9dee8 75%),
        linear-gradient(-45deg, transparent 75%, #d9dee8 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.vbg-hero-art-subject {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    color: var(--vbg-navy);
}

.vbg-hero-art-badge {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: var(--vbg-primary-dark);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}

/* ---- section and cards -------------------------------------------------- */

.vbg-section {
    background: var(--vbg-bg);
    padding: 44px 0 56px;
}

.vbg-card {
    background: var(--vbg-surface);
    border: 1px solid var(--vbg-line);
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 22px;
    /* The beige offset shadow used across the rest of the site, so these cards
       belong to the same page as everything below them. */
    box-shadow: 5px 5px 0 var(--vbg-offset);
}

/* ---- drop zone ---------------------------------------------------------- */

.vbg-drop {
    border: 2px dashed #c7d2e0;
    border-radius: 14px;
    padding: 38px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    background: #fcfdff;
}

.vbg-drop:hover,
.vbg-drop:focus-visible,
.vbg-drop.is-dragging {
    border-color: var(--vbg-primary);
    background: #f2f8fe;
    outline: none;
}

.vbg-drop-icon {
    font-size: 2.6rem;
    color: var(--vbg-primary);
    margin-bottom: 12px;
}

.vbg-drop-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vbg-navy);
    margin-bottom: 6px;
}

.vbg-drop-sub {
    color: var(--vbg-muted);
    margin-bottom: 6px;
}

.vbg-drop-types {
    font-size: 0.82rem;
    color: #9aa4b2;
    margin: 0;
    letter-spacing: 0.02em;
}

.vbg-file {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.vbg-file-thumb {
    width: 96px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: #0d1117;
    flex-shrink: 0;
}

.vbg-file-info {
    min-width: 0;
    flex: 1;
}

.vbg-file-name {
    font-weight: 600;
    color: var(--vbg-ink);
    /* A long filename must not push the clear button off the card. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vbg-file-meta {
    font-size: 0.85rem;
    color: var(--vbg-muted);
}

.vbg-file-clear {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #9aa4b2;
    cursor: pointer;
    padding: 0 6px;
}

.vbg-file-clear:hover {
    color: #d64545;
}

/* ---- background modes --------------------------------------------------- */

.vbg-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.vbg-mode {
    background: #fff;
    border: 2px solid var(--vbg-line);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.vbg-mode:hover {
    border-color: #b6cde4;
}

.vbg-mode.is-active {
    border-color: var(--vbg-primary);
    box-shadow: 0 0 0 3px rgba(37, 131, 220, 0.15);
}

.vbg-mode-swatch {
    width: 46px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.vbg-swatch-transparent {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #d9dee8 25%, transparent 25%),
        linear-gradient(-45deg, #d9dee8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d9dee8 75%),
        linear-gradient(-45deg, transparent 75%, #d9dee8 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.vbg-swatch-color {
    background: linear-gradient(135deg, #00ff00 0%, #0047ff 100%);
}

.vbg-swatch-blur {
    background: linear-gradient(135deg, #94a3b8 0%, #cbd5e1 100%);
    filter: blur(1px);
}

.vbg-swatch-image {
    background: linear-gradient(135deg, #343a52 0%, #2583dc 100%);
}

.vbg-mode-label {
    font-weight: 600;
    color: var(--vbg-ink);
    font-size: 0.95rem;
}

.vbg-mode-note {
    font-size: 0.78rem;
    color: var(--vbg-muted);
    line-height: 1.3;
}

/* ---- per-mode options --------------------------------------------------- */

.vbg-options {
    margin-top: 18px;
    padding: 16px;
    background: #f7fafc;
    border: 1px solid var(--vbg-line);
    border-radius: 12px;
}

.vbg-options > label {
    display: block;
    font-weight: 600;
    color: var(--vbg-ink);
    margin-bottom: 10px;
}

.vbg-options-note {
    font-size: 0.83rem;
    color: var(--vbg-muted);
    margin: 10px 0 0;
}

.vbg-color-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.vbg-color-row input[type="color"] {
    width: 58px;
    height: 42px;
    padding: 2px;
    border: 1px solid var(--vbg-line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.vbg-presets {
    display: flex;
    gap: 8px;
}

.vbg-preset {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    /* Every preset needs a visible edge, or white-on-white disappears. */
    border: 1px solid rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.vbg-preset:hover {
    transform: scale(1.08);
}

.vbg-bg-preview {
    margin-top: 12px;
}

.vbg-bg-preview img {
    max-width: 220px;
    max-height: 130px;
    border-radius: 8px;
    border: 1px solid var(--vbg-line);
}

/* ---- action ------------------------------------------------------------- */

.vbg-controls {
    margin-top: 22px;
    text-align: center;
}

.vbg-process {
    font-weight: 600;
    padding: 12px 34px;
    border-radius: 10px;
    background: var(--vbg-primary);
    border-color: var(--vbg-primary);
}

.vbg-process:hover:not(:disabled) {
    background: var(--vbg-primary-dark);
    border-color: var(--vbg-primary-dark);
}

.vbg-controls-note {
    font-size: 0.85rem;
    color: var(--vbg-muted);
    margin: 12px 0 0;
}

.vbg-error {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    /* 6.1:1 on this background - an error message is the last thing that
       should be hard to read. */
    background: #fdecea;
    border: 1px solid #f5c6c2;
    color: #a12622;
    font-size: 0.92rem;
}

/* ---- progress ----------------------------------------------------------- */

.vbg-progress-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.vbg-progress-stage {
    font-weight: 600;
    color: var(--vbg-ink);
}

.vbg-progress-elapsed {
    font-size: 0.84rem;
    color: var(--vbg-muted);
    margin-top: 2px;
}

.vbg-progress-percent {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vbg-primary);
    font-variant-numeric: tabular-nums;
}

.vbg-progress-track {
    height: 12px;
    background: #e9eef5;
    border-radius: 999px;
    overflow: hidden;
}

.vbg-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2583dc 0%, #4bb3fd 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.vbg-progress-note {
    font-size: 0.85rem;
    color: var(--vbg-muted);
    margin: 14px 0 0;
}

.vbg-cancel {
    margin-top: 12px;
}

/* ---- result ------------------------------------------------------------- */

.vbg-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.vbg-result-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--vbg-navy);
    margin: 0 0 6px;
}

.vbg-result-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 0.88rem;
    color: var(--vbg-muted);
}

.vbg-result-facts i {
    color: var(--vbg-primary);
    margin-right: 4px;
}

/*
 * The stage behind the player.
 *
 * Dark by default, which flatters an opaque result. The chequerboard is added
 * only when the output really has an alpha channel - showing it otherwise
 * would suggest a transparency that is not there, and hiding it when there IS
 * one would make a working cut-out look like a black rectangle.
 */
.vbg-result-stage {
    border-radius: 12px;
    overflow: hidden;
    background: #0d1117;
    display: flex;
    justify-content: center;
}

.vbg-result-stage.is-transparent {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #d9dee8 25%, transparent 25%),
        linear-gradient(-45deg, #d9dee8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d9dee8 75%),
        linear-gradient(-45deg, transparent 75%, #d9dee8 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.vbg-result-video {
    max-width: 100%;
    max-height: 460px;
    display: block;
}

.vbg-note {
    margin-top: 16px;
    padding: 12px 14px;
    background: #eef6fd;
    border: 1px solid #cfe4f7;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #1c4f7c;
}

.vbg-again {
    margin-top: 18px;
}

/* ---- small screens ------------------------------------------------------ */

@media (max-width: 575.98px) {
    .vbg-hero {
        padding: 44px 0 50px;
    }

    .vbg-card {
        padding: 18px;
        /* The offset shadow costs horizontal room that a phone does not have
           to spare, and it reads as a misalignment at this width. */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    }

    .vbg-drop {
        padding: 26px 12px;
    }

    .vbg-modes {
        grid-template-columns: repeat(2, 1fr);
    }

    .vbg-result-head {
        flex-direction: column;
    }

    .vbg-progress-percent {
        font-size: 1.25rem;
    }
}

/* Respect a reduced-motion preference: the progress bar is information, so it
   still moves, but it stops animating its way there. */
@media (prefers-reduced-motion: reduce) {
    .vbg-progress-bar {
        transition: none;
    }

    .vbg-preset:hover {
        transform: none;
    }
}
