/* ==================== NINJAVIDEO STYLES ==================== */

/* Container */
#ninjavideoContainer {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ===== STEPPER ===== */
.nv-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
    padding: 16px 0;
}

.nv-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    transition: all 0.3s ease;
}

.nv-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--border-light);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.nv-step.active {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.08);
}

.nv-step.active .nv-step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.nv-step.done {
    color: var(--success);
}

.nv-step.done .nv-step-number {
    background: var(--success);
    color: #fff;
}

.nv-step-arrow {
    color: var(--border-light);
    font-size: 14px;
}

/* ===== BRIEF FORM ===== */
.nv-brief-form {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 24px;
}

.nv-brief-form h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.nv-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.nv-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nv-form-group.full-width {
    grid-column: 1 / -1;
}

.nv-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nv-form-group select,
.nv-form-group input,
.nv-form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-body);
    transition: border-color 0.2s;
}

.nv-form-group select:focus,
.nv-form-group input:focus,
.nv-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ===== BUTTONS ===== */
.nv-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nv-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.nv-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.nv-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nv-btn-secondary {
    background: var(--bg-body);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.nv-btn-secondary:hover {
    background: var(--border-light);
}

.nv-btn-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.nv-btn-danger:hover {
    background: #fee2e2;
}

.nv-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ===== SCRIPT EDITOR ===== */
.nv-script-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.nv-script-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.nv-cost-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}

.nv-scene-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.nv-scene-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.nv-scene-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nv-scene-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.nv-scene-idx {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nv-engine-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nv-engine-badge.heygen {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
}

.nv-engine-badge.runway {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    color: #db2777;
}

.nv-engine-badge.kenburns {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #b45309;
}

.nv-scene-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.nv-scene-text {
    width: 100%;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-body);
    resize: vertical;
}

.nv-scene-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.nv-scene-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.nv-scene-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.nv-scene-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

/* ===== PRODUCTION PROGRESS ===== */
.nv-production {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 24px;
}

.nv-progress-overall {
    margin-bottom: 24px;
}

.nv-progress-bar-container {
    height: 8px;
    background: var(--bg-body);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.nv-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.nv-progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.nv-scene-progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nv-scene-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg-body);
}

.nv-scene-progress .status-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nv-scene-progress .scene-label {
    flex: 1;
    color: var(--text-primary);
}

.nv-scene-progress .scene-cost {
    color: var(--text-muted);
    font-size: 12px;
}

.nv-scene-progress.done {
    background: #f0fdf4;
}

.nv-scene-progress.generating {
    background: #eff6ff;
}

.nv-scene-progress.failed {
    background: #fef2f2;
}

/* ===== PREVIEW ===== */
.nv-preview {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 24px;
    text-align: center;
}

.nv-video-player {
    max-width: 360px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 9 / 16;
}

.nv-video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nv-preview-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.nv-preview-stats strong {
    color: var(--text-primary);
}

.nv-publish-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== JOBS HISTORY ===== */
.nv-history {
    margin-top: 32px;
}

.nv-history h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-secondary);
}

.nv-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nv-job-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.nv-job-row:hover {
    background: var(--bg-body);
}

.nv-job-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.nv-job-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.nv-job-status.done { background: #dcfce7; color: #16a34a; }
.nv-job-status.scripted { background: #dbeafe; color: #2563eb; }
.nv-job-status.producing { background: #fef3c7; color: #d97706; }
.nv-job-status.failed { background: #fee2e2; color: #dc2626; }
.nv-job-status.published { background: #ede9fe; color: #7c3aed; }

/* ===== LOADING SPINNER ===== */
.nv-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: nv-spin 0.8s linear infinite;
}

@keyframes nv-spin {
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nv-form-grid {
        grid-template-columns: 1fr;
    }

    .nv-stepper {
        flex-wrap: wrap;
        gap: 4px;
    }

    .nv-step {
        padding: 6px 10px;
        font-size: 12px;
    }

    .nv-step-arrow {
        display: none;
    }

    .nv-publish-actions {
        flex-direction: column;
    }
}
