/* ── Video Sync Editor Styles ──────────────────────────── */
/* All styles scoped under #video-sync-editor                */

#video-sync-editor {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
}

/* ── Header ───────────────────────────────────────────── */

#video-sync-editor .vs-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

#video-sync-editor .vs-title {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    white-space: nowrap;
}

#video-sync-editor .vs-title strong {
    color: var(--accent);
    font-weight: 700;
}

#video-sync-editor .vs-mode-tabs {
    display: flex;
    gap: 4px;
    margin-left: 12px;
}

#video-sync-editor .vs-mode-tab {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

#video-sync-editor .vs-mode-tab:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--text);
}

#video-sync-editor .vs-mode-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

#video-sync-editor .vs-mode-tab:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#video-sync-editor .vs-close-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-family: inherit;
}

#video-sync-editor .vs-close-btn:hover {
    border-color: var(--accent-hot);
    color: var(--accent-hot);
}

/* ── Body ─────────────────────────────────────────────── */

#video-sync-editor .vs-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Video Panel ──────────────────────────────────────── */

#video-sync-editor .vs-video-panel {
    flex: 3;
    background: #000;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}

#video-sync-editor .vs-video-panel video {
    flex: 1;
    width: 100%;
    min-height: 0;
    object-fit: contain;
    background: #000;
}

#video-sync-editor .vs-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#video-sync-editor .vs-overlay-canvas.interactive {
    pointer-events: auto;
    cursor: move;
}

/* ── Countdown Overlay ────────────────────────────────── */

#video-sync-editor .vs-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 40px rgba(102, 153, 255, 0.6), 0 4px 12px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    font-variant-numeric: tabular-nums;
}

#video-sync-editor .vs-countdown.active {
    opacity: 1;
}

#video-sync-editor .vs-video-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
    z-index: 5;
}

#video-sync-editor .vs-video-controls .vs-btn {
    min-width: 36px;
}

#video-sync-editor .vs-time-display {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    min-width: 80px;
}

#video-sync-editor .vs-speed-select {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

/* ── Metronome ────────────────────────────────────────── */

#video-sync-editor .vs-metro-sep {
    color: var(--border);
    font-size: 14px;
    margin: 0 2px;
    user-select: none;
}

#video-sync-editor .vs-metro-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

#video-sync-editor .vs-metro-slider {
    width: 80px;
    accent-color: var(--accent-amber);
    cursor: pointer;
}

/* ── Sidebar ──────────────────────────────────────────── */

#video-sync-editor .vs-sidebar {
    flex: 0 0 320px;
    min-width: 280px;
    max-width: 400px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#video-sync-editor .vs-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

#video-sync-editor .vs-sidebar-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

#video-sync-editor .vs-sidebar-content p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* ── Timeline Panel ───────────────────────────────────── */

#video-sync-editor .vs-timeline-panel {
    height: 80px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
}

#video-sync-editor .vs-timeline-panel canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Drop Zone ────────────────────────────────────────── */

#video-sync-editor .vs-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 16px;
}

#video-sync-editor .vs-drop-zone:hover {
    border-color: var(--accent);
    color: var(--text);
}

#video-sync-editor .vs-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--text);
}

#video-sync-editor .vs-drop-zone .vs-drop-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.6;
}

#video-sync-editor .vs-drop-zone .vs-drop-text {
    font-size: 14px;
    margin-bottom: 4px;
}

#video-sync-editor .vs-drop-zone .vs-drop-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Sync Progress ────────────────────────────────────── */

#video-sync-editor .vs-sync-progress {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

#video-sync-editor .vs-sync-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.15s ease;
}

/* ── Event Card ───────────────────────────────────────── */

#video-sync-editor .vs-event-card {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
}

#video-sync-editor .vs-event-card .vs-event-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

#video-sync-editor .vs-event-card .vs-event-detail {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

/* ── Mark List ────────────────────────────────────────── */

#video-sync-editor .vs-mark-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#video-sync-editor .vs-mark-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s ease;
}

#video-sync-editor .vs-mark-item:hover {
    background: var(--surface-raised);
}

#video-sync-editor .vs-mark-item .vs-mark-time {
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    min-width: 60px;
}

#video-sync-editor .vs-mark-item .vs-mark-location {
    color: var(--text-muted);
}

#video-sync-editor .vs-mark-item .vs-mark-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.1s;
    font-family: inherit;
}

#video-sync-editor .vs-mark-item:hover .vs-mark-delete {
    opacity: 1;
}

#video-sync-editor .vs-mark-item .vs-mark-delete:hover {
    color: var(--accent-hot);
}

/* ── Control Rows ─────────────────────────────────────── */

#video-sync-editor .vs-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

#video-sync-editor .vs-control-row label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

#video-sync-editor .vs-control-row select,
#video-sync-editor .vs-control-row input[type="range"] {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
}

#video-sync-editor .vs-control-row input[type="range"] {
    flex: 1;
    max-width: 140px;
    accent-color: var(--accent);
}

#video-sync-editor .vs-control-row .vs-range-value {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

/* ── Buttons ──────────────────────────────────────────── */

#video-sync-editor .vs-btn {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

#video-sync-editor .vs-btn:hover {
    border-color: var(--accent);
    color: #fff;
}

#video-sync-editor .vs-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

#video-sync-editor .vs-btn.primary:hover {
    background: #77aaff;
    border-color: #77aaff;
}

#video-sync-editor .vs-btn.danger {
    border-color: var(--danger);
    color: var(--danger);
}

#video-sync-editor .vs-btn.danger:hover {
    background: var(--danger);
    color: #fff;
}

/* ── No-video placeholder ─────────────────────────────── */

#video-sync-editor .vs-no-video {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Export Progress ──────────────────────────────────── */

#video-sync-editor .vs-export-progress {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

#video-sync-editor .vs-export-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #77aaff);
    border-radius: 4px;
    transition: width 0.2s ease;
}

/* ── Trim Inputs ─────────────────────────────────────── */

#video-sync-editor .vs-trim-input {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    width: 80px;
    text-align: right;
}

#video-sync-editor .vs-trim-input:focus {
    border-color: var(--accent);
    outline: none;
}

/* ── Trim preview prompt ─────────────────────────────── */

.vs-trim-prompt {
    position: absolute;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 170, 51, 0.9);
    color: #000;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
    animation: vs-trim-prompt-in 0.3s ease-out;
}

@keyframes vs-trim-prompt-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Scrollbar (sidebar) ──────────────────────────────── */

#video-sync-editor .vs-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

#video-sync-editor .vs-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

#video-sync-editor .vs-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ── Font picker ─────────────────────────────────────── */

#video-sync-editor .vs-font-section {
    padding: 8px 0;
}

#video-sync-editor .vs-font-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

#video-sync-editor .vs-font-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-raised);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.2;
}
#video-sync-editor .vs-font-pill:hover {
    color: var(--text);
    border-color: var(--accent);
}
#video-sync-editor .vs-font-pill.active {
    background: rgba(102, 153, 255, 0.15);
    color: var(--accent);
    border-color: rgba(102, 153, 255, 0.4);
}
#video-sync-editor .vs-font-pill.locked::before {
    content: '\uD83D\uDD12';
    font-size: 10px;
    margin-right: 2px;
}

#video-sync-editor .vs-font-remove {
    font-size: 14px;
    line-height: 1;
    margin-left: 2px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
}
#video-sync-editor .vs-font-remove:hover {
    color: var(--danger);
}

#video-sync-editor .vs-font-browse-btn {
    display: block;
    width: 100%;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 6px;
}
#video-sync-editor .vs-font-browse-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(102, 153, 255, 0.05);
}

#video-sync-editor .vs-font-browser {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 10px;
}

#video-sync-editor .vs-font-preview {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    padding: 12px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    outline: none;
    transition: border-color 0.15s;
    user-select: none;
}
#video-sync-editor .vs-font-preview:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(102, 153, 255, 0.15);
}
#video-sync-editor .vs-font-preview.already-added {
    border-color: rgba(68, 221, 170, 0.4);
    color: var(--accent-green);
}

#video-sync-editor .vs-font-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
    letter-spacing: 0.02em;
}

/* ── Image Overlay Slots ─────────────────────────────── */

#video-sync-editor .vs-image-slot {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
    background: var(--surface-raised);
}

#video-sync-editor .vs-image-slot-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

#video-sync-editor .vs-image-label {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    padding: 3px 6px;
    font-family: inherit;
    transition: border-color 0.15s;
}

#video-sync-editor .vs-image-label:hover,
#video-sync-editor .vs-image-label:focus {
    border-color: var(--border);
    outline: none;
}

#video-sync-editor .vs-image-vis-btn {
    padding: 3px 8px;
    font-size: 11px;
}

#video-sync-editor .vs-image-clear-btn {
    padding: 3px 8px;
    font-size: 14px;
    line-height: 1;
    min-width: unset;
}

#video-sync-editor .vs-text-callout-input {
    width: 100%;
    background: var(--surface-raised, var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    padding: 6px 8px;
    resize: vertical;
    margin-bottom: 8px;
    transition: border-color 0.15s;
}

#video-sync-editor .vs-text-callout-input:focus {
    border-color: var(--accent-amber, var(--accent));
    outline: none;
}

#video-sync-editor .vs-image-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

#video-sync-editor .vs-image-upload:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(102, 153, 255, 0.05);
}

#video-sync-editor .vs-image-thumb-wrap {
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background:
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

#video-sync-editor .vs-image-thumb {
    display: block;
    width: 100%;
    max-height: 120px;
    object-fit: contain;
}

#video-sync-editor .vs-image-color {
    width: 32px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
}

#video-sync-editor .vs-image-color::-webkit-color-swatch-wrapper {
    padding: 2px;
}

#video-sync-editor .vs-image-color::-webkit-color-swatch {
    border-radius: 2px;
    border: none;
}

/* ── Glow section label ──────────────────────────────── */

#video-sync-editor .vs-glow-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 10px 0 6px;
}

/* ── Auto-resize hint ────────────────────────────────── */

#video-sync-editor .vs-auto-resize-hint {
    font-size: 11px;
    color: var(--text-muted);
    padding-left: 4px;
    margin-bottom: 14px;
    line-height: 1.4;
}

/* ── Callout Cards ───────────────────────────────────── */

#video-sync-editor .vs-callout-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
    background: var(--surface-raised);
}

#video-sync-editor .vs-callout-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

#video-sync-editor .vs-callout-timing-active {
    background: rgba(255, 170, 51, 0.2);
    border-color: rgba(255, 170, 51, 0.6);
    color: var(--accent-amber);
    animation: vs-callout-pulse 1.2s ease-in-out infinite;
}

@keyframes vs-callout-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 170, 51, 0.3); }
    50%      { box-shadow: 0 0 8px 2px rgba(255, 170, 51, 0.5); }
}

/* ── Overlay Track Tabs ─────────────────────────────── */

#video-sync-editor .vs-overlay-track-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 0 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

#video-sync-editor .vs-overlay-track-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

#video-sync-editor .vs-overlay-track-tab:hover {
    border-color: var(--accent);
    color: var(--text);
}

#video-sync-editor .vs-overlay-track-tab.active {
    background: rgba(102, 153, 255, 0.15);
    border-color: rgba(102, 153, 255, 0.4);
    color: var(--accent);
    font-weight: 600;
}

#video-sync-editor .vs-overlay-track-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

#video-sync-editor .vs-overlay-vis-btn {
    margin-left: auto;
    font-size: 12px;
    cursor: pointer;
    padding: 0 2px;
    transition: opacity 0.15s;
    user-select: none;
}

/* ── Sync Track Badge ───────────────────────────────── */

#video-sync-editor .vs-sync-track-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: rgba(102, 153, 255, 0.1);
    border: 1px solid rgba(102, 153, 255, 0.25);
    color: var(--accent);
}

#video-sync-editor .vs-sync-track-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(102, 153, 255, 0.2);
    color: var(--accent);
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 2px;
}
