/* EvoSub VTT Editor - Dark Theme */

/* ===== Variables ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-panel: #12121a;
    --bg-card: #1a1a24;
    --bg-input: #0d0d14;
    --bg-hover: #22222e;

    --text-primary: #f0f0f5;
    --text-secondary: #9898a8;
    --text-muted: #5c5c70;

    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.25);

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;

    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(139, 92, 246, 0.5);

    --font: 'Inter', 'Noto Sans TC', system-ui, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-dark);
    -webkit-font-smoothing: antialiased;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #333344;
    border-radius: 6px;
    border: 3px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
    background: #4a4a60;
}

/* ===== Form Elements ===== */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px !important;
    cursor: pointer;
}

select option {
    background-color: var(--bg-panel);
    color: var(--text-primary);
    padding: 8px;
}

/* ===== Layout ===== */
.editor-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== Toolbar ===== */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color .15s;
}

.toolbar-logo:hover {
    color: var(--accent-hover);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.toolbar-filename {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.toolbar-btn.accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.toolbar-btn.accent:hover {
    background: var(--accent-hover);
}

.export-group {
    display: flex;
    gap: 0;
}

.export-group .toolbar-btn {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.export-select {
    padding: 6px 8px;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.export-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== Editor Body — 50/50 split ===== */
.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== Left: Video + Style ===== */
.editor-left {
    width: 50%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: #0a0a0f;
    flex-shrink: 0;
}

.video-container.drag-over {
    outline: 3px dashed var(--accent);
    outline-offset: -3px;
}

.video-container {
    position: relative;
    background: #000;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--text-muted);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    max-width: 400px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
}

.video-placeholder:hover {
    border-color: var(--accent);
}

.video-placeholder p {
    font-size: 14px;
    color: var(--text-muted);
}

#videoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.subtitle-overlay {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    pointer-events: none;
    z-index: 10;
    padding: 8px 16px;
    transition: all .2s;
    /* default: bottom */
    bottom: 60px;
}

.subtitle-overlay.position-top {
    top: 20px;
    bottom: auto;
}

.subtitle-overlay.position-middle {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.subtitle-overlay.position-bottom {
    bottom: 60px;
    top: auto;
    transform: none;
}

.subtitle-overlay .sub-text {
    display: inline-block;
    padding: 4px 12px;
    font-size: 24px;
    font-weight: 600;
    color: #00e5ff;
    line-height: 1.4;
    font-family: 'Noto Sans TC', sans-serif;
    transition: all .2s;
}

/* Subtitle styles */
.subtitle-overlay .sub-text.effect-none {
    text-shadow: none;
}

.subtitle-overlay .sub-text.effect-outline {
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000,
        -2px 2px 0 #000, 2px 2px 0 #000,
        0 -2px 0 #000, 0 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000;
}

.subtitle-overlay .sub-text.effect-shadow {
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.5);
}

.subtitle-overlay .sub-text.effect-box {
    background: rgba(0, 0, 0, 0.75);
    border-radius: 4px;
    padding: 4px 16px;
}

/* ===== Custom Media Controls (matching original editor) ===== */
.media-controls {
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    display: none;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.media-controls.visible {
    display: flex;
}

.ctrl-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
}

.ctrl-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.ctrl-timeline {
    flex: 1;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.ctrl-timeline-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.ctrl-time {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Consolas', monospace;
    min-width: 100px;
    white-space: nowrap;
}

.ctrl-speed {
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.ctrl-speed:focus {
    outline: none;
    border-color: var(--accent);
}

.volume-container {
    position: relative;
    display: inline-block;
}

.volume-slider-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 12px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-bottom: 8px;
}

.volume-container:hover .volume-slider-popup {
    opacity: 1;
    visibility: visible;
}

.volume-slider-popup input[type="range"] {
    writing-mode: bt-lr;
    -webkit-appearance: slider-vertical;
    width: 24px;
    height: 100px;
    cursor: pointer;
}

/* ===== Style Panel ===== */
.style-panel {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-panel);
    flex-shrink: 0;
}

.style-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.style-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.style-row-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.effect-color-inline {
    display: flex;
    align-items: center;
}

.color-picker-sm {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    padding: 0;
}

.style-row {
    display: flex;
    gap: 24px;
    align-items: center;
}

.style-options,
.position-options {
    display: flex;
    gap: 6px;
}

.style-btn,
.position-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 38px;
    padding: 4px 12px;
    gap: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}

.style-btn:hover,
.position-btn:hover {
    border-color: var(--border-focus);
    background: var(--bg-hover);
}

.style-btn.active,
.position-btn.active {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.style-preview {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.style-preview.outline {
    color: var(--bg-panel);
    text-shadow: -1px -1px 0 currentColor, 1px -1px 0 currentColor,
        -1px 1px 0 currentColor, 1px 1px 0 currentColor;
}

.style-preview.shadow {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.style-preview.box {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 11px;
    transition: .2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: .2s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked+.toggle-slider::before {
    background: #fff;
    transform: translateX(20px);
}

/* Toggle knob for inline-styled toggles (pre-training settings modal) */
.toggle-switch span::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #999;
    border-radius: 50%;
    transition: .3s;
}
.toggle-switch input:checked + span::before {
    background: #fff;
    transform: translateX(18px);
}

/* Font row */
.font-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-icon {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    width: 24px;
    text-align: center;
}

.font-select {
    flex: 1;
    padding: 8px 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.font-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Size row */
.size-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.size-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.size-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    outline: none;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-panel);
}

.size-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-panel);
}

.color-picker {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

/* ===== Right: Cue List (table-style like original editor) ===== */
.editor-right {
    width: 50%;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    overflow: hidden;
}

.cue-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    box-sizing: border-box;
}

.cue-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.cue-search {
    width: 160px;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
}

.cue-search:focus {
    outline: none;
    border-color: var(--accent);
}

.cue-list {
    flex: 1;
    overflow-y: auto;
}

.empty-cue-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--text-muted);
    padding: 40px;
    text-align: center;
}

/* ===== Cue item — table-row style (matching original .srt-row) ===== */
.cue-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.cue-item:hover {
    background: var(--bg-hover);
}

.cue-item.active {
    background: rgba(139, 92, 246, 0.15);
    border-left: 3px solid var(--accent);
}

.cue-item.active .cue-time-col {
    color: var(--accent);
    font-weight: 600;
}

/* Time column */
.cue-time-col {
    width: 160px;
    padding: 14px 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Consolas', monospace;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.cue-time-col:hover {
    color: var(--accent);
    background: rgba(139, 92, 246, 0.05);
}

.cue-time-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.cue-time-input {
    width: 90px;
    padding: 2px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    color: inherit;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    text-align: center;
}

.cue-time-input:focus {
    outline: none;
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--bg-input);
}

/* Text column */
.cue-text {
    flex: 1;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    cursor: text;
    border: none;
    background: none;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.cue-text:focus {
    outline: none;
    background: var(--bg-card);
}

/* Delete button column */
.cue-actions {
    display: flex;
    align-items: center;
    padding: 0 8px;
    opacity: 0;
    transition: opacity .15s;
}

.cue-item:hover .cue-actions {
    opacity: 1;
}

.cue-action-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s;
}

.cue-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.cue-action-btn[data-action="delete"]:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.cue-action-btn[data-action="play"]:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
}

.cue-action-btn[data-action="add"]:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* ===== Buttons ===== */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    animation: toastIn .2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    font-size: 13px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--error);
}

.toast-warning {
    border-left: 3px solid var(--warning);
}

.toast-info {
    border-left: 3px solid var(--accent);
}

/* ===== Find & Replace Panel ===== */
.find-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100%;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    z-index: 200;
    flex-direction: column;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
}

.find-panel.visible {
    display: flex;
}

.fp-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fp-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.fp-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.fp-close:hover {
    color: var(--text-primary);
}

.fp-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fp-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.fp-row label {
    width: 60px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.fp-row input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.fp-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.fp-options {
    display: flex;
    gap: 16px;
}

.fp-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.fp-option input {
    accent-color: var(--accent);
}

.fp-results {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-y: auto;
    min-height: 200px;
}

.fp-result {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    gap: 12px;
    cursor: pointer;
}

.fp-result:hover {
    background: var(--bg-hover);
}

.fp-result:last-child {
    border-bottom: none;
}

.fp-result-time {
    color: var(--text-muted);
    font-family: 'Consolas', monospace;
    min-width: 90px;
}

.fp-result-text {
    flex: 1;
    color: var(--text-primary);
}

.fp-result-text mark {
    background: var(--warning);
    color: var(--bg-dark);
    padding: 0 2px;
    border-radius: 2px;
}

.fp-result-check {
    accent-color: var(--accent);
}

.fp-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fp-count {
    font-size: 13px;
    color: var(--text-muted);
}

.fp-btn {
    padding: 10px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.fp-btn:hover {
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Highlight for search results */
.cue-item.highlight {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning);
}

/* ===== Hide WordPress Admin Bar ===== */
#wpadminbar,
html.wp-toolbar {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

#wpadminbar {
    display: none !important;
}

/* ===== Effect Color Row ===== */
.effect-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.effect-color-row .style-label {
    min-width: 70px;
}

/* ===== Export Modal ===== */
.export-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.export-modal-overlay.visible {
    display: flex;
}

.export-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.export-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.export-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.export-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.export-modal-close:hover {
    color: var(--text-primary);
}

.export-modal-body {
    padding: 12px;
}

.export-format-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
}

.export-format-item:hover {
    background: var(--bg-hover);
}

.export-format-icon {
    color: var(--accent);
    flex-shrink: 0;
}

.export-format-info {
    flex: 1;
}

.export-format-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.export-format-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .editor-body {
        flex-direction: column;
    }

    .editor-left,
    .editor-right {
        width: 100%;
    }

    .editor-right {
        max-height: 40vh;
    }
}

/* ===== Scrollbar ===== */
.cue-list::-webkit-scrollbar,
.editor-left::-webkit-scrollbar {
    width: 6px;
}

.cue-list::-webkit-scrollbar-track,
.editor-left::-webkit-scrollbar-track {
    background: transparent;
}

.cue-list::-webkit-scrollbar-thumb,
.editor-left::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}