/* INFINEMA - Cinematic Dark Theme */

/* Dark Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #2a2a35 #0a0a0f;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
    background: #2a2a35;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a48;
}

::-webkit-scrollbar-corner {
    background: #0a0a0f;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-hover: #22222e;
    --accent-primary: #c9a227;
    --accent-secondary: #8b7355;
    --accent-glow: rgba(201, 162, 39, 0.3);
    --text-primary: #e8e6e3;
    --text-secondary: #9a9a9a;
    --text-muted: #666;
    --border-color: #2a2a35;
    --success: #4a9c6d;
    --error: #c94a4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: var(--accent-primary);
    text-shadow: 0 0 30px var(--accent-glow);
}

.pro-badge {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: #fff;
    background: linear-gradient(135deg, #c9a227 0%, #8b7355 100%);
    padding: 4px 12px;
    border-radius: 4px;
    margin-left: 15px;
    vertical-align: middle;
    box-shadow: 0 0 20px var(--accent-glow);
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 0;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 80px;
    transition: all 0.3s;
}

.progress-step .step-icon {
    font-size: 1.5rem;
    opacity: 0.5;
    transition: all 0.3s;
}

.progress-step .step-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    transition: all 0.3s;
}

.progress-step.active {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.progress-step.active .step-icon {
    opacity: 1;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.progress-step.active .step-label {
    color: var(--accent-primary);
}

.progress-step.completed {
    border-color: var(--success);
}

.progress-step.completed .step-icon {
    opacity: 0.8;
}

.progress-step.completed .step-label {
    color: var(--success);
}

/* Phases */
.phase {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.phase.hidden {
    display: none;
}

.phase-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.phase-number {
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.phase-header h2 {
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Idea Input */
.idea-input {
    margin-bottom: 30px;
}

.idea-input label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.idea-input .btn-random:first-of-type {
    margin-left: auto;
}

.btn-random {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.btn-random:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.1);
}

.idea-input textarea {
    width: 100%;
    min-height: 150px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.idea-input textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.idea-input textarea::placeholder {
    color: var(--text-muted);
}

/* Dark resize handle for textareas */
textarea::-webkit-resizer {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 0 0 8px 0;
}

/* Crew Grid */
.crew-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.crew-row {
    display: grid;
    gap: 20px;
}

/* Row 1: 2 items (Duration + Aspect Ratio) */
.crew-row:nth-child(1) {
    grid-template-columns: repeat(2, 1fr);
}

/* Row 2: 3 items (Screenwriter + DOP + Director) */
.crew-row:nth-child(2) {
    grid-template-columns: repeat(3, 1fr);
}

/* Row 3: 3 items (Engines - aligned with Row 2) */
.crew-row:nth-child(3) {
    grid-template-columns: repeat(3, 1fr);
}

.crew-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: border-color 0.3s, transform 0.2s;
}

.crew-card:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
}

.crew-card label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.crew-icon {
    font-size: 1.3rem;
}

.crew-card select {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

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

.crew-card select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Import info badge (shown when JSON imported) */
.import-info {
    margin-top: 4px;
    padding: 3px 8px;
    font-size: 11px;
    color: var(--accent-primary);
    background: rgba(245, 197, 24, 0.1);
    border: 1px solid rgba(245, 197, 24, 0.3);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
}
.import-info:hover {
    background: rgba(245, 197, 24, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #ddb82f;
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

.btn-stop {
    background: #555 !important;
    color: #fff !important;
    border: none !important;
}

.btn-stop:hover {
    background: #666 !important;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.btn-expand {
    width: 100%;
    padding: 20px;
    font-size: 1.1rem;
}

.btn-generate {
    flex: 1;
    padding: 20px;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Story Display */
.story-display {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 25px;
}

.story-title {
    font-size: 1.8rem;
    color: var(--accent-primary);
    margin-bottom: 10px;
    font-weight: 400;
}

.story-logline {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.story-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

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

.meta-item strong {
    color: var(--text-primary);
}

/* Story Arc */
.story-arc {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.arc-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border-left: 3px solid var(--accent-primary);
}

.arc-section h4 {
    color: var(--accent-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.arc-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Scenes */
.scenes-container h3 {
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 1px;
}

.scene-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent-secondary);
}

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.scene-number {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.scene-duration {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.scene-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.scene-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.scene-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.scene-detail {
    font-size: 0.85rem;
}

.scene-detail strong {
    color: var(--accent-secondary);
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* Production Display */
.production-display {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 25px;
}

.production-title {
    font-size: 1.8rem;
    color: var(--accent-primary);
    margin-bottom: 15px;
    font-weight: 400;
}

.visual-style {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 3px solid var(--accent-primary);
}

.visual-style h4 {
    color: var(--accent-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* Shots */
.shots-container h3 {
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 1px;
}

.shot-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 3px solid var(--success);
}

.shot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.shot-number {
    background: var(--success);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.shot-meta {
    display: flex;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.shot-prompt {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.shot-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.shot-detail {
    font-size: 0.85rem;
}

.shot-detail strong {
    color: var(--success);
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* Poster Prompt */
.poster-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.poster-section h3 {
    margin-bottom: 15px;
    font-weight: 400;
}

.poster-prompt {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    border-left: 3px solid var(--accent-primary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#loadingText {
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-role {
    opacity: 0.5;
    transition: opacity 0.4s ease, color 0.4s ease;
}

.footer-role.active {
    opacity: 1;
    color: var(--accent-color, #f59e0b);
    font-weight: 600;
}

/* Copy Button */
.copy-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Additional Shot Styles */
.shot-action {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.shot-dialogue {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-style: italic;
    border-left: 3px solid var(--accent-secondary);
}

.shot-negative {
    background: rgba(201, 74, 74, 0.1);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    border-left: 3px solid var(--error);
}

.prompt-text {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    margin: 8px 0;
    border: 1px solid var(--border-color);
    word-wrap: break-word;
}

.shot-count {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.screenplay-shot {
    border-left-color: var(--accent-secondary);
}

.image-shot {
    border-left-color: #7c4dff;
}

.video-shot {
    border-left-color: var(--success);
}

/* Production Log */
.production-log-container {
    margin-top: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    overflow: hidden;
}

.log-header {
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

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

.log-icon {
    font-size: 1.2rem;
}

.log-toggle {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.log-content.collapsed {
    display: none;
}

.log-content.collapsed + .log-header .log-toggle {
    transform: rotate(-90deg);
}

.log-content {
    max-height: 400px;
    overflow-y: auto;
}

.log-entries {
    padding: 15px;
}

.log-entry {
    padding: 10px 15px;
    margin-bottom: 8px;
    border-left: 3px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-entry.stage {
    border-left-color: var(--accent-primary);
    font-weight: bold;
    color: var(--accent-primary);
}

.log-entry.progress {
    border-left-color: var(--text-secondary);
    color: var(--text-secondary);
}

.log-entry.success {
    border-left-color: var(--success);
    color: var(--success);
}

.log-entry.error {
    border-left-color: var(--error);
    color: var(--error);
}

.log-entry.warning {
    border-left-color: #ff9800;
    color: #ff9800;
}

.log-timestamp {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 10px;
}

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

    .scene-details,
    .shot-details {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .logo h1 {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }
}

/* ========================================
   SEMI-AUTONOMOUS MODE
   ======================================== */

/* Stage Navigation */
.stage-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.stage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.stage-item .stage-icon {
    font-size: 2rem;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.stage-item .stage-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.stage-item.active {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

.stage-item.active .stage-icon {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.stage-item.active .stage-label {
    color: var(--accent-primary);
}

.stage-item.completed {
    border-color: var(--success);
    background: rgba(74, 156, 109, 0.1);
}

.stage-item.completed .stage-icon {
    filter: grayscale(0%);
    opacity: 0.7;
}

.stage-item.completed .stage-label {
    color: var(--success);
}

.stage-item:hover:not(.active) {
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
}

.stage-divider {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.mode-option {
    flex: 1;
    max-width: 300px;
    cursor: pointer;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mode-option input:checked + .mode-label {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

.mode-icon {
    font-size: 2rem;
}

.mode-label strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.mode-label small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Semi-Autonomous Stage Sections */
.semi-stage {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.semi-stage.hidden {
    display: none;
}

.stage-header {
    text-align: center;
    margin-bottom: 40px;
}

.stage-header h2 {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.stage-desc {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Story Editor */
.story-editor {
    max-width: 800px;
    margin: 0 auto;
}

.editor-field {
    margin-bottom: 25px;
}

.editor-field label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.editor-field input,
.editor-field textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 15px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.editor-field input:focus,
.editor-field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.editor-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Storyboard Grid */
.storyboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.storyboard-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.storyboard-card:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
}

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

.card-number {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.card-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.card-status.generating {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.card-status.complete {
    color: var(--success);
    background: rgba(74, 156, 109, 0.1);
}

.card-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    background: var(--bg-primary);
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}

.card-prompt {
    margin-bottom: 12px;
}

.card-prompt label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-prompt textarea {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 60px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-regenerate {
    background: var(--accent-primary);
    color: #0a0a0f;
}

.btn-regenerate:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.btn-regenerate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.video-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
}

.card-video {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    background: var(--bg-primary);
    margin-bottom: 12px;
    overflow: hidden;
}

.card-video video {
    width: 100%;
    height: 100%;
}

/* Final Preview */
.final-preview {
    max-width: 900px;
    margin: 0 auto;
}

.final-preview video {
    width: 100%;
    border-radius: 12px;
    background: #000;
    margin-bottom: 30px;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Output Container */
.output-container {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    margin-top: 15px;
    overflow: hidden;
}

.output-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.3);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.output-header:hover {
    background: rgba(15, 23, 42, 0.5);
}

.output-icon {
    font-size: 18px;
}

.output-toggle {
    margin-left: auto;
    transition: transform 0.2s;
}

.output-content.collapsed {
    display: none;
}

.output-content.collapsed ~ .output-header .output-toggle {
    transform: rotate(-90deg);
}

.output-content {
    padding: 20px;
}

/* Video Player */
.video-player-wrapper {
    margin-bottom: 20px;
    text-align: center;
}

#outputVideo {
    background: #000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Video Info */
.video-info {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #94a3b8;
}

.info-value {
    color: #e2e8f0;
    font-family: monospace;
}

/* Output Actions */
.output-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.output-actions .btn {
    min-width: 150px;
}

/* Settings Modal */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.settings-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

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

.settings-header h3 {
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1rem;
    color: var(--accent-primary);
}

.settings-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

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

.settings-body {
    padding: 24px;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.settings-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Toggle Switch */
.settings-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.settings-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
}

.settings-toggle input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.settings-toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
    background: var(--bg-primary);
}

.toggle-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Engine row hidden state */
.crew-row.engines-hidden {
    display: none;
}
