/* ============================================
   Video Editor Module - Subtitle Integration
   Professional UI for creating videos with subs
   ============================================ */

/* Container */
.video-editor-container {
    padding: 20px 0;
}

/* Step Cards */
.video-step {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 20px;
    overflow: hidden;
}

.video-step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-bottom: 1px solid var(--border-color);
}

.video-step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

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

.video-step-body {
    padding: 20px;
}

.video-step.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.video-step.disabled .video-step-header {
    background: var(--bg-input);
}

.video-step.disabled .video-step-number {
    background: var(--text-muted);
}

/* Audio Upload */
.video-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-upload-zone:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.video-upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    transform: scale(1.01);
}

.video-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.video-upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.video-upload-text {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 6px;
}

.video-upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Audio File Info */
.video-file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
}

.video-file-icon {
    font-size: 32px;
}

.video-file-details {
    flex: 1;
}

.video-file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.video-file-duration {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.video-file-remove {
    width: 30px;
    height: 30px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    cursor: pointer;
    color: var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.video-file-remove:hover {
    background: var(--error);
    color: white;
}

/* Text Input */
.video-text-container {
    margin-bottom: 16px;
}

.video-text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.video-text-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.video-word-count {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-input);
    border-radius: 12px;
}

.video-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.video-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* SRT Options */
.video-options-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.video-option-group {
    flex: 1;
}

.video-option-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.video-option-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
}

.video-option-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* SRT Preview */
.video-srt-section {
    background: #0f172a;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.video-srt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.video-srt-title {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}

.video-srt-content {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
}

/* Video Settings */
.video-settings {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.video-setting-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.video-color-input {
    width: 100%;
    height: 40px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    cursor: pointer;
}

/* Result Section */
.video-result {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 2px solid rgba(16, 185, 129, 0.4);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-top: 24px;
}

.video-result-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 16px;
}

.video-result-player {
    width: 100%;
    max-width: 640px;
    border-radius: 12px;
    margin: 0 auto 16px;
    background: black;
}

.video-result-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.video-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* History Modal */
.video-history-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.video-history-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

.video-history-modal-title {
    font-size: 16px;
    font-weight: 600;
}

.video-history-modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
}

.video-history-list {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.video-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.video-history-item:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.video-history-item-icon {
    font-size: 24px;
}

.video-history-item-info {
    flex: 1;
}

.video-history-item-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.video-history-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.video-history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .video-settings {
        grid-template-columns: 1fr;
    }

    .video-options-row {
        flex-direction: column;
    }
}