/* ===================================================================
   SceneForge AI — Light Mode Premium Design System
   =================================================================== */

:root {
    /* Colors */
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f7;
    --bg-hover: #eef0f6;
    --surface: #ffffff;
    --surface-raised: #ffffff;

    --text-primary: #1a1d2e;
    --text-secondary: #5a6078;
    --text-muted: #8b91a8;
    --text-inverse: #ffffff;

    --accent: #6c5ce7;
    --accent-hover: #5a4bd4;
    --accent-light: #ede9fc;
    --accent-glow: rgba(108, 92, 231, 0.15);

    --primary: #0984e3;
    --primary-hover: #0770c2;
    --primary-light: #e3f2fd;

    --success: #00b894;
    --success-light: #e6faf5;
    --warning: #fdcb6e;
    --warning-light: #fef9e7;
    --danger: #e17055;
    --danger-light: #fdf0ed;

    --border: #e2e5ef;
    --border-light: #eef0f6;
    --border-focus: var(--accent);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(26, 29, 46, 0.04);
    --shadow-sm: 0 2px 8px rgba(26, 29, 46, 0.06);
    --shadow-md: 0 4px 16px rgba(26, 29, 46, 0.08);
    --shadow-lg: 0 8px 32px rgba(26, 29, 46, 0.10);
    --shadow-xl: 0 16px 48px rgba(26, 29, 46, 0.12);

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s var(--ease);
    --transition: 0.25s var(--ease);
    --transition-slow: 0.4s var(--ease);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* ===== HEADER ===== */
#app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.header-left, .header-right { display: flex; align-items: center; gap: 0.5rem; min-width: 180px; }
.header-right { justify-content: flex-end; }

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.3rem;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

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

/* ===== STEP WIZARD ===== */
.step-wizard {
    display: flex;
    align-items: center;
    gap: 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

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

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: var(--transition);
    border: 2px solid transparent;
}

.step.active .step-circle {
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.step.completed .step-circle {
    background: var(--success);
    color: var(--text-inverse);
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.step.active .step-label { color: var(--text-primary); }
.step.completed .step-label { color: var(--success); }

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 0.25rem;
    transition: var(--transition);
}

.step-connector.completed { background: var(--success); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn .material-icons-round { font-size: 1.15rem; }

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}
.btn-accent:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 50%;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-sm .material-icons-round { font-size: 1rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 0.95rem; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: var(--radius-md); }
.btn-full { width: 100%; justify-content: center; }

.btn-danger { color: var(--danger); border-color: rgba(225, 112, 85, 0.3); }
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); }

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

/* ===== MAIN PANELS ===== */
#app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.step-panel {
    display: none;
    flex: 1;
    animation: fadeInUp 0.35s var(--ease);
}

.step-panel.active { display: flex; flex-direction: column; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-content-wrapper {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step-intro { text-align: center; }
.step-intro h1 { font-size: 2rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.step-intro p { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.6; max-width: 600px; margin: 0 auto; }

/* ===== STEP 1: SCRIPT ===== */
.script-input-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.script-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
}

.toolbar-left .material-icons-round { font-size: 1.15rem; color: var(--accent); }
.toolbar-right { display: flex; gap: 0.5rem; }

#script-textarea {
    width: 100%;
    min-height: 320px;
    padding: 1.5rem;
    border: none;
    resize: vertical;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
}

#script-textarea::placeholder { color: var(--text-muted); }

.script-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.stat-chip .material-icons-round { font-size: 1rem; color: var(--accent); }

.step-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.step-actions-fixed {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, var(--bg-primary) 60%, transparent);
    padding: 1.5rem 2rem;
    z-index: 10;
}

/* Scenes Preview */
.scenes-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.scenes-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.scenes-preview-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.scenes-preview-header h3 .material-icons-round { color: var(--accent); }

.scenes-list {
    max-height: 400px;
    overflow-y: auto;
}

.scene-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

.scene-item:last-child { border-bottom: none; }
.scene-item:hover { background: var(--bg-hover); }

.scene-item-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.scene-item-content { flex: 1; }
.scene-item-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scene-item-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.scene-item-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

/* ===== STEP 2: AUDIO ===== */
.audio-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.audio-upload-zone:hover, .audio-upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.upload-icon .material-icons-round { font-size: 2rem; color: var(--accent); }

.audio-upload-zone h3 { font-size: 1.15rem; margin-bottom: 0.25rem; color: var(--text-primary); }
.audio-upload-zone p { color: var(--text-muted); font-size: 0.9rem; }

.audio-player-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.audio-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.audio-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.audio-file-info .material-icons-round { color: var(--accent); font-size: 1.15rem; }

.audio-badge {
    padding: 0.2rem 0.6rem;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.waveform-container {
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
}

#waveform-canvas {
    width: 100%;
    display: block;
    border-radius: var(--radius-sm);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-light);
}

.audio-controls .btn-icon { color: var(--accent); }
.audio-controls .btn-icon:hover { background: var(--accent-light); }

.audio-time { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.audio-scrubber { flex: 1; }
.audio-scrubber input[type="range"] {
    width: 100%;
    height: 4px;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.audio-scrubber input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ===== STEP 3: SCENE EDITOR ===== */
.scene-editor-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    flex: 1;
    min-height: 0;
    height: calc(100vh - 64px - 80px);
}

.scene-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scene-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.scene-sidebar-header h3 { font-size: 1rem; }
.scene-sidebar-actions { display: flex; gap: 0.25rem; }

.scene-timeline-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

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

.timeline-item.active {
    background: var(--accent-light);
    border-color: var(--accent);
}

.timeline-thumb {
    width: 64px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
}

.timeline-thumb img { width: 100%; height: 100%; object-fit: cover; }
.timeline-thumb .material-icons-round { font-size: 1.15rem; color: var(--text-muted); }

.timeline-info { flex: 1; min-width: 0; }
.timeline-title { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-duration { font-size: 0.7rem; color: var(--text-muted); }

/* Preview Area */
.scene-preview-area {
    display: flex;
    flex-direction: column;
    background: var(--bg-tertiary);
    padding: 1.5rem;
    gap: 1rem;
}

.preview-canvas-wrapper {
    flex: 1;
    position: relative;
    background: #1a1d2e;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

#preview-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.preview-empty-state {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.4);
}

.preview-empty-state .material-icons-round { font-size: 3rem; }
.preview-empty-state p { font-size: 0.9rem; }

.preview-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.preview-controls .btn-icon {
    color: var(--accent);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.preview-info { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }

/* Scene Properties Panel */
.scene-properties {
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.properties-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.properties-header h3 { font-size: 1rem; }

.properties-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 0.5rem;
}

.properties-empty .material-icons-round { font-size: 2.5rem; opacity: 0.3; }
.properties-empty p { font-size: 0.85rem; }

.properties-content { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }

.prop-group { display: flex; flex-direction: column; gap: 0.4rem; }
.prop-label { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.prop-input, .prop-select, .prop-textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    transition: var(--transition-fast);
}

.prop-input:focus, .prop-select:focus, .prop-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.prop-textarea { resize: vertical; line-height: 1.5; }

.image-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.image-drop-zone:hover { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.image-drop-zone .material-icons-round { font-size: 1.5rem; }

.image-drop-zone.has-image {
    padding: 0;
    border-style: solid;
    overflow: hidden;
}

.image-drop-zone.has-image img { width: 100%; height: 120px; object-fit: cover; }

/* ===== STEP 4: EXPORT ===== */
.export-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.setting-header .material-icons-round { color: var(--accent); font-size: 1.25rem; }
.setting-header h3 { font-size: 1rem; }

/* Aspect Ratio Options */
.ratio-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.ratio-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.ratio-option:hover { border-color: var(--accent); background: var(--accent-light); }
.ratio-option.active { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3px var(--accent-glow); }
.ratio-option input { display: none; }

.ratio-preview {
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    background: var(--bg-tertiary);
}

.ratio-preview.landscape { width: 48px; height: 27px; }
.ratio-preview.portrait { width: 27px; height: 48px; }
.ratio-preview.square { width: 40px; height: 40px; }
.ratio-preview.four-five { width: 32px; height: 40px; }

.ratio-option.active .ratio-preview { border-color: var(--accent); background: var(--accent-light); }

.ratio-label { font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.ratio-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Resolution Options */
.resolution-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.resolution-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.resolution-option:hover { border-color: var(--accent); }
.resolution-option.active { border-color: var(--accent); background: var(--accent-light); box-shadow: 0 0 0 3px var(--accent-glow); }
.resolution-option input { display: none; }

.res-info { display: flex; flex-direction: column; gap: 0.15rem; }
.res-name { font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.res-detail { font-size: 0.8rem; color: var(--text-muted); }

.res-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.res-badge.recommended { background: var(--success-light); color: var(--success); }

/* Subtitle Settings */
.subtitle-settings { padding: 1.25rem 1.5rem; }

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.toggle-row input { display: none; }

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: var(--radius-full);
    position: relative;
    transition: var(--transition);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.toggle-row input:checked + .toggle-switch { background: var(--accent); }
.toggle-row input:checked + .toggle-switch::after { left: 23px; }

.subtitle-style-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Export Summary */
.export-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-item .material-icons-round { color: var(--accent); font-size: 1.15rem; }

/* Render */
.render-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.btn-xl .material-icons-round { font-size: 1.35rem; }

.render-progress {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.render-progress-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.spin { animation: spin 1.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.render-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.render-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 4px;
    transition: width 0.3s linear;
}

.render-progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.render-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

.render-complete-icon .material-icons-round { font-size: 4rem; color: var(--success); }
.render-complete h3 { font-size: 1.5rem; color: var(--text-primary); }

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 29, 46, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 520px;
    overflow: hidden;
    animation: scaleIn 0.25s var(--ease);
}

@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

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

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.modal-header h3 .material-icons-round { color: var(--accent); }

.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.modal-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.modal-hint .material-icons-round { font-size: 1.15rem; color: var(--primary); flex-shrink: 0; margin-top: 0.1rem; }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    animation: slideInRight 0.3s var(--ease);
    min-width: 280px;
}

.toast.success .material-icons-round { color: var(--success); }
.toast.error .material-icons-round { color: var(--danger); }
.toast.info .material-icons-round { color: var(--primary); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .scene-editor-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 200px 1fr 250px;
        height: auto;
    }
    .scene-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
    .scene-timeline-list { display: flex; overflow-x: auto; padding: 0.5rem; gap: 0.5rem; }
    .timeline-item { flex-shrink: 0; min-width: 180px; }
    .scene-properties { border-left: none; border-top: 1px solid var(--border); }
    .ratio-options { grid-template-columns: repeat(2, 1fr); }
    .resolution-options { grid-template-columns: 1fr; }
    .subtitle-style-options { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    #app-header { padding: 0 1rem; }
    .step-label { display: none; }
    .step-connector { width: 20px; }
    .step-content-wrapper { padding: 2rem 1rem; }
    .ratio-options { grid-template-columns: repeat(2, 1fr); }
}

/* ===== GENERATOR MODAL ===== */
.modal-gen-preview {
    width: 100%;
    height: 200px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#modal-gen-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-gen-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 29, 46, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-gen-loading .material-icons-round {
    font-size: 2rem;
    color: var(--accent);
}

