/* ================================================================
   Babiato Video Tools v3.0 — Frontend CSS
   ================================================================ */
:root {
    --bvt-green:  #00B894;
    --bvt-dark:   #0f172a;
    --bvt-blue:   #1e3a5f;
    --bvt-radius: 12px;
}

/* ── Upload Zone ───────────────────────────────────────────────── */
.bvt-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--bvt-radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #f8fafc;
}
.bvt-upload-zone:hover, .bvt-upload-zone.bvt-drag-over {
    border-color: var(--bvt-green);
    background: #e6faf6;
}
.bvt-upload-zone input[type="file"] { display: none; }
.bvt-upload-icon { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.bvt-upload-zone h3 { font-size: 1rem; margin: 0 0 .25rem; color: #1e293b; font-weight: 600; }
.bvt-upload-zone p  { font-size: .85rem; color: #64748b; margin: 0; }
.bvt-upload-btn {
    margin-top: 1rem; display: inline-block; padding: .55rem 1.25rem;
    background: var(--bvt-green); color: #fff; border-radius: 8px;
    font-size: .875rem; font-weight: 600; cursor: pointer;
}

/* ── URL Input area ────────────────────────────────────────────── */
.bvt-url-group {
    display: flex; gap: .75rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.bvt-url-input {
    flex: 1; padding: .7rem 1rem; border: 1.5px solid #e2e8f0;
    border-radius: 10px; font-size: .9rem; min-width: 0;
    transition: border-color .15s;
}
.bvt-url-input:focus { outline: none; border-color: var(--bvt-green); }
.bvt-format-pills { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.bvt-format-pills label { display: flex; align-items: center; gap: .35rem; cursor: pointer; padding: .4rem .75rem; border: 1.5px solid #e2e8f0; border-radius: 20px; font-size: .82rem; font-weight: 500; transition: .15s; }
.bvt-format-pills input { display: none; }
.bvt-format-pills input:checked + span { color: var(--bvt-green); }
.bvt-format-pills label:has(input:checked) { border-color: var(--bvt-green); background: #e6faf6; }

/* ── Buttons ───────────────────────────────────────────────────── */
.bvt-btn {
    display: inline-flex; align-items: center; gap: .4rem; padding: .65rem 1.4rem;
    border-radius: 9px; font-size: .875rem; font-weight: 600; cursor: pointer;
    border: none; text-decoration: none; transition: opacity .15s, transform .1s;
}
.bvt-btn:hover { opacity: .88; transform: translateY(-1px); }
.bvt-btn:active { transform: translateY(0); }
.bvt-btn-primary   { background: var(--bvt-green); color: #fff; }
.bvt-btn-secondary { background: #f1f5f9; color: #475569; }
.bvt-btn-lg { padding: .8rem 2rem; font-size: .95rem; }
.bvt-btn-sm { padding: .4rem .8rem; font-size: .8rem; }
.bvt-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.bvt-btn-loading { display: none; }

/* ── Progress ──────────────────────────────────────────────────── */
.bvt-progress-wrap { background: #f1f5f9; border-radius: 10px; padding: 1rem 1.25rem; margin: 1rem 0; }
.bvt-progress-text { font-size: .85rem; color: #475569; margin-bottom: .5rem; }
.bvt-progress-track { background: #e2e8f0; border-radius: 4px; height: 6px; overflow: hidden; }
.bvt-progress-fill  { background: var(--bvt-green); height: 100%; border-radius: 4px; transition: width .3s; }

/* ── Error ─────────────────────────────────────────────────────── */
.bvt-error {
    background: #fef2f2; color: #dc2626; border: 1px solid #fecaca;
    border-radius: 9px; padding: .75rem 1rem; font-size: .875rem;
    margin-top: .75rem; display: none;
}

/* ── File chip ─────────────────────────────────────────────────── */
.bvt-file-info {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 9px;
    padding: .75rem 1rem; display: flex; align-items: center; gap: .75rem;
    margin-bottom: 1rem;
}
.bvt-filename { font-weight: 600; font-size: .875rem; color: #1e293b; flex: 1; }
.bvt-filesize { font-size: .8rem; color: #64748b; }
.bvt-change-link { font-size: .8rem; color: var(--bvt-green); cursor: pointer; text-decoration: underline; }

/* ── Results ───────────────────────────────────────────────────── */
.bvt-results {
    background: #f0fdf9; border: 1px solid #a7f3d0; border-radius: var(--bvt-radius);
    padding: 1.25rem; margin-top: 1rem; display: none;
}
.bvt-result-title { font-weight: 700; font-size: 1rem; margin-bottom: .25rem; color: #1e293b; }
.bvt-result-meta  { font-size: .82rem; color: #64748b; margin-bottom: 1rem; }
.bvt-result-thumb { max-width: 100%; border-radius: 8px; margin-bottom: .75rem; }
.bvt-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.bvt-download-video {
    display: inline-flex; align-items: center; gap: .4rem; padding: .65rem 1.4rem;
    background: var(--bvt-green); color: #fff; border-radius: 9px;
    font-weight: 600; font-size: .875rem; text-decoration: none;
}
.bvt-download-video:hover { opacity: .88; }

/* Instagram multi-item */
.bvt-ig-items { display: flex; flex-direction: column; gap: .5rem; }
.bvt-ig-item  { display: flex; justify-content: space-between; align-items: center; padding: .5rem .75rem; background: #fff; border-radius: 8px; font-size: .85rem; }
.bvt-ig-label { color: #64748b; }

/* YouTube format list */
.bvt-yt-formats h4  { font-size: .85rem; font-weight: 600; color: #64748b; margin: .75rem 0 .5rem; text-transform: uppercase; letter-spacing: .05em; }
.bvt-yt-format      { display: flex; align-items: center; padding: .6rem .9rem; background: #fff; border-radius: 8px; margin-bottom: .35rem; text-decoration: none; color: #1e293b; font-size: .875rem; transition: background .15s; }
.bvt-yt-format:hover { background: #e6faf6; }
.bvt-yt-format span:first-child { flex: 1; font-weight: 500; }
.bvt-yt-size  { color: #64748b; font-size: .8rem; margin-right: .75rem; }
.bvt-dl-arrow { color: var(--bvt-green); }

/* ================================================================
   VIDEO TRIMMER — 123apps style dark timeline
   ================================================================ */
#bvt-trimmer-editor { display: none; }

.bvt-trimmer-wrap {
    background: #0f172a;
    border-radius: var(--bvt-radius);
    overflow: hidden;
}

/* Video preview area */
.bvt-trimmer-preview-area {
    background: #0d1117;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 1rem;
    position: relative;
}
#bvt-trimmer-video {
    max-width: 100%;
    max-height: 360px;
    border-radius: 6px;
}
.bvt-trimmer-filename {
    position: absolute;
    top: .75rem; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.5);
    color: rgba(255,255,255,.8);
    padding: .2rem .75rem;
    border-radius: 20px;
    font-size: .78rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 80%;
}

/* Timeline container */
.bvt-timeline-wrap {
    padding: .75rem 0 0;
    position: relative;
    user-select: none;
}

/* Filmstrip + overlay */
.bvt-timeline {
    position: relative;
    height: 56px;
    cursor: crosshair;
    overflow: hidden;
    border-radius: 4px;
}
#bvt-filmstrip {
    display: flex;
    height: 100%;
    overflow: hidden;
}
/* Dark shades over unselected parts */
.bvt-tl-shade {
    position: absolute;
    top: 0; height: 100%;
    background: rgba(0,0,0,.65);
    z-index: 2;
    pointer-events: none;
}
#bvt-tl-left-shade  { left: 0; }
#bvt-tl-right-shade { right: 0; }

/* Blue selection border */
#bvt-tl-selection {
    position: absolute;
    top: 0; height: 100%;
    border-top: 3px solid #3b82f6;
    border-bottom: 3px solid #3b82f6;
    z-index: 3;
    pointer-events: none;
}

/* Handles */
.bvt-tl-handle {
    position: absolute;
    top: 0; width: 14px; height: 100%;
    background: #3b82f6;
    z-index: 5;
    cursor: ew-resize;
    display: flex; align-items: center; justify-content: center;
    transform: translateX(-50%);
}
.bvt-tl-handle::after {
    content: '⋮';
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

/* Playhead */
#bvt-tl-playhead {
    position: absolute;
    top: 0; width: 2px; height: 100%;
    background: #ef4444;
    z-index: 6;
    pointer-events: none;
    display: none;
    transform: translateX(-1px);
}

/* Time labels above handles */
.bvt-tl-label {
    position: absolute;
    top: -22px;
    transform: translateX(-50%);
    background: #3b82f6;
    color: #fff;
    font-size: .7rem;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

/* Bottom time display */
.bvt-tl-times {
    display: flex;
    justify-content: space-between;
    padding: .3rem .2rem;
    font-size: .75rem;
    color: rgba(255,255,255,.45);
}

/* Controls bar */
.bvt-trimmer-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem 1rem;
    flex-wrap: wrap;
}
.bvt-play-btn-big {
    width: 42px; height: 42px; border-radius: 50%;
    background: #22c55e;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff; flex-shrink: 0;
    transition: background .15s;
}
.bvt-play-btn-big:hover { background: #16a34a; }

.bvt-time-inputs {
    display: flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.06);
    border-radius: 8px;
    padding: .4rem .6rem;
}
.bvt-time-inputs label { font-size: .72rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .04em; }
.bvt-time-input-field {
    background: transparent; border: none; outline: none;
    color: #fff; font-size: .88rem; font-weight: 600;
    width: 58px; text-align: center; font-family: monospace;
}
.bvt-time-arrow { color: rgba(255,255,255,.3); font-size: .9rem; }
.bvt-time-dur   { font-size: .78rem; color: rgba(255,255,255,.4); background: rgba(255,255,255,.06); border-radius: 6px; padding: .3rem .6rem; }

.bvt-trimmer-actions {
    display: flex; gap: .75rem; align-items: center;
    padding: 0 1rem 1rem;
    flex-wrap: wrap;
}
.bvt-fmt-select {
    padding: .45rem .75rem; border: 1.5px solid rgba(255,255,255,.15);
    border-radius: 8px; background: rgba(255,255,255,.06); color: #fff;
    font-size: .85rem;
}
.bvt-fmt-select option { background: #1e293b; }

.bvt-trimmer-note {
    font-size: .75rem; color: rgba(255,255,255,.35); padding: 0 1rem .75rem;
}

/* ── Compressor settings ────────────────────────────────────────── */
.bvt-compress-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; margin-bottom: 1rem; }
@media(max-width:480px) { .bvt-compress-grid { grid-template-columns: 1fr; } }
.bvt-radio-card {
    border: 2px solid #e2e8f0; border-radius: 10px; padding: .9rem; cursor: pointer;
    transition: border-color .15s, background .15s; text-align: center;
}
.bvt-radio-card.active, .bvt-radio-card:has(input:checked) { border-color: var(--bvt-green); background: #e6faf6; }
.bvt-radio-card input { display: none; }
.bvt-radio-card .bvt-rc-icon { font-size: 1.5rem; display: block; margin-bottom: .3rem; }
.bvt-radio-card .bvt-rc-title { font-size: .875rem; font-weight: 600; color: #1e293b; }
.bvt-radio-card .bvt-rc-desc  { font-size: .75rem; color: #64748b; margin-top: .2rem; }

.bvt-res-row {
    display: flex; align-items: center; gap: .75rem;
    margin-bottom: 1rem;
}
.bvt-res-row label { font-size: .875rem; font-weight: 500; color: #475569; flex-shrink: 0; }
.bvt-res-select {
    padding: .45rem .75rem; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: .875rem; background: #fff; color: #1e293b;
}

/* Compressor result stats */
.bvt-compress-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.bvt-stat { text-align: center; }
.bvt-stat-label { font-size: .72rem; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.bvt-stat-value { font-size: 1.1rem; font-weight: 700; color: #1e293b; }
.bvt-stat-value.bvt-saved { color: var(--bvt-green); }

/* ── Quality slider (MP3) ───────────────────────────────────────── */
.bvt-quality-row { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.bvt-quality-row label { font-size: .875rem; font-weight: 500; color: #475569; }
.bvt-quality-row input[type="range"] { flex: 1; accent-color: var(--bvt-green); }
.bvt-quality-val { font-size: .85rem; color: var(--bvt-green); font-weight: 600; min-width: 55px; }

/* ── Spinner ────────────────────────────────────────────────────── */
@keyframes bvt-spin { to { transform: rotate(360deg); } }
.bvt-spinner {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff; border-radius: 50%;
    animation: bvt-spin .7s linear infinite;
    display: inline-block;
}

/* Note box */
.bvt-note {
    background: #fefce8; border: 1px solid #fde68a; border-radius: 8px;
    padding: .6rem .9rem; font-size: .8rem; color: #854d0e;
    margin-top: .75rem;
}

/* ── Prevent stray images/SVGs from stretching inside our tool cards ──────── */
.tool-workspace .bvt-video-card img:not(.bvt-result-thumbnail),
.tool-workspace .bvt-video-card svg:not(.bvt-inline-icon) {
    max-width: 32px !important;
    max-height: 32px !important;
}

/* ── If featured image somehow gets rendered inside workspace, hide it ─────── */
.tool-workspace > img,
.tool-workspace > figure,
.tool-workspace p > img:only-child {
    display: none !important;
}

/* ── Video Converter format cards ────────────────────────────────────────── */
.bvt-fmt-card {
    transition: border-color .15s, background .15s, transform .1s;
}
.bvt-fmt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}


