/**
 * MetaoFly — Browser Video Editor (CapCut Lite Studio)
 * Production-Grade CapCut Web UI & Visual Architecture
 *
 * Direct recreation of CapCut Web/Desktop layout:
 * 1. Studio Top App Bar (Project Name, Ratio Selector, Zoom, Undo/Redo, Vibrant Blue Export)
 * 2. Left Slim Tool Dock (64px) + Collapsible Drawer (320px)
 * 3. Spacious Center Theater Player with Floating Action Pill & Cyan Selection Box
 * 4. Master Timeline Toolbar (Split, Trim, Delete, Circular Play, Timecode, Zoom)
 * 5. Full-Width Magnetic Multi-Track Timeline (T1, V2 PiP, V1 Filmstrip, A1 Audio)
 *
 * @package MetaoFly
 */

/* ── 1. Studio Shell Workspace ───────────────────────────── */
.bve-workspace {
    background: #0d0d12;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 720px;
    max-height: 720px;
    padding: 0 !important;
    gap: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    user-select: none;
    box-sizing: border-box;
}

/* ── 2. CapCut Studio Top App Bar ────────────────────────── */
.bve-studio-topbar {
    height: 44px;
    background: #14141b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 16px;
    z-index: 30;
    flex-shrink: 0;
    margin: 0 !important;
}

.bve-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bve-studio-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    cursor: default;
}

.bve-brand-badge {
    font-size: 10px;
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.35);
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.bve-project-title-box {
    display: flex;
    align-items: center;
}

.bve-project-name {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 5px;
    font-weight: 500;
    width: 130px;
    transition: all 0.2s ease;
}

.bve-project-name:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: #00f2fe;
    outline: none;
    width: 170px;
    color: #ffffff;
}

/* Ratio Dropdown Pill */
.bve-ratio-dropdown {
    position: relative;
}

.bve-ratio-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-ratio-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #00f2fe;
}

.bve-ratio-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #181822;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 170px;
}

.bve-aspect-switcher {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bve-aspect-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.15s ease;
}

.bve-aspect-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.bve-aspect-btn.active {
    background: rgba(0, 242, 254, 0.16);
    color: #00f2fe;
    font-weight: 600;
}

/* Center Topbar */
.bve-topbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bve-zoom-pill select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-radius: 5px;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

.bve-topbar-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #94a3b8;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-topbar-icon-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* Right Topbar */
.bve-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bve-privacy-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    cursor: default;
}

.bve-export-blue-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

.bve-export-blue-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.6);
}

/* ── 3. CapCut Upper Studio Workspace ────────────────────── */
.bve-upper-workspace {
    display: flex;
    height: 380px;
    max-height: 380px;
    background: #09090d;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    margin: 0 !important;
}

/* Left Slim Icon Dock (64px) */
.bve-left-dock {
    width: 64px;
    background: #14141b;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    flex-shrink: 0;
    z-index: 15;
}

.bve-dock-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bve-dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 52px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.bve-dock-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.bve-dock-btn.active {
    color: #00f2fe;
    background: rgba(0, 242, 254, 0.08);
}

.bve-dock-btn.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #00f2fe;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px #00f2fe;
}

/* Slide-out Drawer Panel (310px, Collapsible) */
.bve-drawer-panel {
    width: 310px;
    background: #161620;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 12;
    overflow: hidden;
}

.bve-drawer-panel.collapsed {
    width: 0px !important;
    border-right: none;
}

.bve-drawer-header {
    height: 40px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.bve-drawer-title {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.bve-drawer-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.bve-drawer-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.bve-tab-content-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.bve-tab-pane {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.bve-tab-pane.active {
    display: flex;
}

.bve-pane-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bve-pane-badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Media Bin Dropzone */
.bve-dropzone {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bve-dropzone:hover,
.bve-dropzone.drag-over {
    border-color: #00f2fe;
    background: rgba(0, 242, 254, 0.05);
}

.bve-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bve-dropzone-label {
    font-size: 11px;
    color: #e2e8f0;
}

.bve-dropzone-hint {
    font-size: 10px;
    color: #64748b;
}

.bve-hidden-file-input {
    display: none;
}

.bve-media-bin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.bve-empty-bin-placeholder {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    color: #64748b;
    font-size: 11px;
    text-align: center;
    gap: 6px;
}

.bve-media-card {
    background: #1e1e28;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 16 / 10;
    transition: all 0.15s ease;
}

.bve-media-card:hover {
    border-color: #00f2fe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.bve-media-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bve-media-card-duration {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}

.bve-media-card-title {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    font-size: 9px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.65);
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Text Presets */
.bve-text-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.bve-text-preset-card {
    background: #1e1e2a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-text-preset-card:hover {
    border-color: #00f2fe;
    background: rgba(0, 242, 254, 0.05);
}

.bve-preset-preview {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 2px;
}

.bve-preset-label {
    font-size: 9px;
    color: #94a3b8;
}

/* Transitions Grid */
.bve-transitions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.bve-trans-card {
    background: #1e1e2a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-trans-card:hover {
    border-color: #00f2fe;
    background: rgba(0, 242, 254, 0.05);
}

.bve-trans-card.active {
    border-color: #00f2fe;
    background: rgba(0, 242, 254, 0.12);
}

.bve-trans-icon {
    font-size: 16px;
}

.bve-trans-name {
    font-size: 10px;
    font-weight: 600;
    color: #e2e8f0;
}

/* LUT Grid */
.bve-lut-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.bve-lut-card {
    background: #1e1e2a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-lut-card:hover {
    border-color: #00f2fe;
}

.bve-lut-card.active {
    border-color: #00f2fe;
    background: rgba(0, 242, 254, 0.12);
}

.bve-lut-swatch {
    width: 100%;
    height: 32px;
    border-radius: 4px;
    display: block;
}

.bve-lut-title {
    font-size: 10px;
    font-weight: 600;
    color: #e2e8f0;
}

/* Form inputs & sliders */
.bve-form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bve-form-group label {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}

.bve-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.bve-input,
.bve-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 11px;
}

.bve-input:focus,
.bve-select:focus {
    border-color: #00f2fe;
    outline: none;
}

.bve-slider-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 6px;
}

.bve-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #94a3b8;
}

.bve-range {
    width: 100%;
    accent-color: #00f2fe;
    cursor: pointer;
}

/* ── 4. Center Video Player Stage ────────────────────────── */
.bve-center-stage {
    flex: 1;
    height: 100%;
    min-height: 0;
    min-width: 0;
    background: #09090d;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bve-preview-viewport {
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

/* CapCut Floating Action Mini-Toolbar (Above Video) */
.bve-floating-action-pill {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 18, 25, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 9999px;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 25;
}

.bve-float-pill-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: #00f2fe;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-float-pill-btn:hover {
    background: rgba(0, 242, 254, 0.14);
}

.bve-pill-sep {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
}

.bve-float-pill-icon {
    background: transparent;
    border: none;
    color: #cbd5e1;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-float-pill-icon:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* Canvas Container & Cyan Selection Box */
.bve-canvas-container {
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    position: relative;
    background: #000000;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.95);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bvePreviewCanvas {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: 100%;
    display: block;
    object-fit: contain;
}

.bve-capcut-bounding-box {
    position: absolute;
    inset: 0;
    border: 2px solid #00f2fe;
    box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
    pointer-events: none;
    border-radius: 2px;
}

.bve-capcut-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border: 2px solid #00f2fe;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.bve-handle-nw {
    top: -5px;
    left: -5px;
}

.bve-handle-ne {
    top: -5px;
    right: -5px;
}

.bve-handle-sw {
    bottom: -5px;
    left: -5px;
}

.bve-handle-se {
    bottom: -5px;
    right: -5px;
}

/* ── 5. Master Timeline Toolbar (Icon-Based Tools) ───────── */
.bve-timeline-toolbar {
    height: 40px;
    background: #14141b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    gap: 8px;
    flex-shrink: 0;
    z-index: 20;
    margin: 0 !important;
}

.bve-toolbar-left {
    display: flex;
    align-items: center;
    gap: 3px;
}

.bve-icon-tool-btn {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.bve-icon-tool-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.bve-icon-tool-btn.active {
    color: #00f2fe;
    background: rgba(0, 242, 254, 0.12);
    border-color: rgba(0, 242, 254, 0.3);
}

.bve-icon-tool-btn.bve-btn-accent {
    color: #00f2fe;
}

.bve-icon-tool-btn.bve-btn-accent:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: #00f2fe;
}

.bve-icon-tool-btn.bve-btn-danger:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.bve-tool-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 4px;
}

.bve-speed-dropdown {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 0 4px;
    height: 30px;
}

.bve-speed-icon {
    font-size: 11px;
}

.bve-speed-dropdown select {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px;
}

/* Add Layer Dropdown */
.bve-add-layer-dropdown {
    position: relative;
    display: inline-flex;
}

.bve-btn-add-layer {
    height: 30px;
    padding: 0 8px;
    border-radius: 5px;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.25);
    color: #00f2fe;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-btn-add-layer:hover {
    background: rgba(0, 242, 254, 0.16);
    border-color: #00f2fe;
}

.bve-layer-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    background: #161622;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
    z-index: 50;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 5px;
}

.bve-layer-menu-item {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.bve-layer-menu-item:hover {
    background: rgba(0, 242, 254, 0.14);
    color: #00f2fe;
}

.bve-tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 7px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-tool-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.bve-btn-accent-split {
    color: #00f2fe;
    border-color: rgba(0, 242, 254, 0.35);
    background: rgba(0, 242, 254, 0.08);
}

.bve-btn-accent-split:hover {
    background: rgba(0, 242, 254, 0.18);
    border-color: #00f2fe;
}

.bve-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
}

.bve-tool-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 3px;
}

.bve-speed-dropdown {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 0 4px;
}

.bve-speed-icon {
    font-size: 11px;
}

.bve-speed-dropdown select {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 2px;
}

/* Center Toolbar: Circular Play & Timecode */
.bve-toolbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bve-step-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bve-step-btn:hover {
    color: #ffffff;
}

.bve-play-circle-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    color: #09090d;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
    transition: transform 0.15s ease;
}

.bve-play-circle-btn:hover {
    transform: scale(1.08);
}

.bve-timecode-box {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.bve-current-time {
    color: #ffffff;
    font-weight: 700;
}

.bve-time-divider {
    color: #475569;
}

/* Right Toolbar: Zoom & Clip controls */
.bve-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bve-btn-add-clip {
    background: rgba(0, 242, 254, 0.1);
    color: #00f2fe;
    border-color: rgba(0, 242, 254, 0.25);
}

.bve-icon-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.bve-icon-btn:hover,
.bve-icon-btn.active {
    color: #00f2fe;
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.3);
}

.bve-timeline-zoom-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
}

.bve-zoom-step-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    padding: 0 3px;
}

.bve-zoom-step-btn:hover {
    color: #ffffff;
}

.bve-range-sm {
    width: 70px;
    accent-color: #00f2fe;
    cursor: pointer;
}

/* ── 6. Bottom Full-Width Multi-Track Timeline ───────────── */
.bve-timeline-panel {
    background: #111116;
    height: 256px;
    max-height: 256px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    flex-shrink: 0;
    margin: 0 !important;
}

.bve-timeline-scroll-wrap {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
}

/* CapCut Time Ruler */
.bve-time-ruler {
    height: 24px;
    background: #14141b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 20;
    min-width: 100%;
    cursor: pointer;
}

.bve-ruler-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bve-ruler-tick {
    position: absolute;
    bottom: 0;
    width: 1px;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
}

.bve-ruler-tick.major {
    height: 10px;
    background: rgba(255, 255, 255, 0.35);
}

.bve-ruler-label {
    position: absolute;
    top: 2px;
    font-size: 9px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    color: #94a3b8;
    transform: translateX(-50%);
    pointer-events: none;
}

/* CapCut White Playhead Needle */
.bve-playhead-needle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
    z-index: 40;
    pointer-events: none;
}

.bve-needle-head {
    position: absolute;
    top: 0;
    left: -5px;
    width: 12px;
    height: 14px;
    background: #ffffff;
    clip-path: polygon(0% 0%, 100% 0%, 100% 65%, 50% 100%, 0% 65%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.bve-needle-line {
    position: absolute;
    top: 14px;
    bottom: 0;
    left: 0;
    width: 2px;
    background: #ffffff;
}

/* Tracks Container (Dynamic Customizable Tracks) */
.bve-tracks-container {
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100%;
}

.bve-track-row {
    display: flex;
    align-items: center;
    height: 40px;
    position: relative;
}

.bve-track-header {
    width: 78px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    position: sticky;
    left: 0;
    background: #111116;
    z-index: 10;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    gap: 3px;
    box-sizing: border-box;
}

.bve-track-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: -0.2px;
}

.bve-badge-video {
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
}

.bve-badge-v1 {
    background: rgba(0, 242, 254, 0.18);
    color: #00f2fe;
}

.bve-badge-v2 {
    background: rgba(244, 114, 182, 0.18);
    color: #f472b6;
}

.bve-badge-text {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
}

.bve-badge-audio {
    background: rgba(34, 197, 94, 0.18);
    color: #22c55e;
}

.bve-track-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.bve-track-btn {
    background: transparent;
    border: none;
    font-size: 10px;
    padding: 2px 3px;
    cursor: pointer;
    color: #64748b;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s ease;
}

.bve-track-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.bve-track-btn.muted {
    color: #ef4444;
}

.bve-track-btn.hidden-layer {
    color: #f59e0b;
}

.bve-track-del-btn:hover {
    color: #ef4444 !important;
}

.bve-track-lane {
    flex: 1;
    height: 38px;
    background: #181822;
    border-radius: 5px;
    position: relative;
    margin-right: 40px;
    border: 1px dashed transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.bve-track-lane.dragover {
    border-color: #00f2fe;
    background: rgba(0, 242, 254, 0.08);
}

/* ── 7. Clip Cards on Track (Exact CapCut Match) ─ */
.bve-clip-block {
    position: absolute;
    top: 2px;
    bottom: 2px;
    background: #252533;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    cursor: grab;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 4px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    z-index: 5;
    box-sizing: border-box;
    user-select: none;
}

.bve-clip-block.dragging {
    cursor: grabbing;
    opacity: 0.82;
    box-shadow: 0 8px 24px rgba(0, 242, 254, 0.5);
    z-index: 25;
}

/* Filmstrip thumbnail simulation */
.bve-clip-video {
    background-color: #1e1e2d;
    background-image: repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.04) 0px,
            rgba(255, 255, 255, 0.04) 48px,
            rgba(0, 0, 0, 0.4) 48px,
            rgba(0, 0, 0, 0.4) 50px);
}

/* Selected clip: glowing cyan border */
.bve-clip-block.selected {
    border: 2px solid #00f2fe !important;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.45);
    z-index: 10;
}

/* Trim Drag Handles at ends */
.bve-clip-trim-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    background: #ffffff;
    cursor: col-resize;
    z-index: 15;
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
    display: none;
}

.bve-clip-block.selected .bve-clip-trim-handle {
    display: block;
}

.bve-trim-left {
    left: 0;
}

.bve-trim-right {
    right: 0;
}

.bve-clip-content-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    pointer-events: none;
    padding: 0 6px;
    overflow: hidden;
}

.bve-clip-title {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.bve-clip-duration-tag {
    font-size: 9px;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.65);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    flex-shrink: 0;
}

/* Overlay & Audio clip accents */
.bve-clip-overlay,
.bve-clip-text {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(14, 165, 233, 0.25));
    border-color: rgba(56, 189, 248, 0.4);
}

.bve-clip-audio {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(22, 163, 74, 0.2));
    border-color: rgba(34, 197, 94, 0.4);
}

/* ── 8. Export Modal ─────────────────────────────────────── */
.bve-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.bve-modal-card {
    background: #181822;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.bve-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bve-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.bve-modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
}

.bve-modal-close-btn:hover {
    color: #ffffff;
}

.bve-modal-body {
    padding: 20px;
}

.bve-radio-pill-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.bve-radio-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bve-radio-pill input {
    display: none;
}

.bve-radio-pill.active {
    background: rgba(0, 242, 254, 0.15);
    border-color: #00f2fe;
    color: #00f2fe;
}

.bve-export-specs-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
}

.bve-spec-item {
    display: flex;
    justify-content: space-between;
}

.bve-spec-k {
    color: #64748b;
}

.bve-spec-v {
    color: #e2e8f0;
    font-weight: 600;
}

.bve-start-render-btn {
    width: 100%;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bve-progress-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 14px 0;
}

.bve-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00f2fe, #2563eb);
    transition: width 0.1s linear;
}

.bve-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 14px;
}

.bve-cancel-render-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
}

/* ── 9. Responsive Mobile / Tablet Layout ────────────────── */
@media (max-width: 900px) {
    .bve-workspace {
        height: auto;
        max-height: none;
    }

    .bve-studio-topbar {
        padding: 0 10px;
        gap: 8px;
    }

    .bve-topbar-center {
        display: none !important;
    }

    .bve-project-title-box {
        display: none !important;
    }

    .bve-privacy-pill {
        display: none !important;
    }

    .bve-export-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .bve-upper-workspace {
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .bve-left-dock {
        width: 100%;
        height: 48px;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0 4px;
        order: 2;
    }

    .bve-dock-tabs {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }

    .bve-dock-btn {
        height: 44px;
        flex: 1;
    }

    .bve-dock-btn.active::before {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 0;
        width: auto;
        height: 2px;
    }

    .bve-drawer-panel {
        width: 100% !important;
        height: 280px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        order: 3;
    }

    .bve-center-stage {
        order: 1;
        height: 300px;
    }

    .bve-preview-viewport {
        padding: 10px;
    }

    .bve-timeline-toolbar {
        overflow-x: auto;
        justify-content: flex-start;
    }
}