/* Video Generation specific styles */

body.video-gen-page {
    --accent-primary: #1e3a5f;
    --accent-secondary: #2c4a6e;
    --accent-light: rgba(30, 58, 95, 0.18);
    --accent-gradient: linear-gradient(135deg, #1e3a5f 0%, #2c4a6e 50%, #3d5a80 100%);
}

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.editor-layout.api-docs-active {
    grid-template-columns: 1fr;
    gap: 0;
}

.editor-layout.api-docs-active .editor-panel {
    min-height: auto;
}

.editor-layout.api-docs-active .preview-panel {
    display: none;
}

/* Fix API docs panel height to allow full content display */
.editor-layout.api-docs-active .side-tabs__panel {
    height: auto;
    min-height: 600px;
    overflow-y: visible;
}

.editor-layout.api-docs-active .side-tabs__body {
    overflow: visible;
}

.editor-panel,
.preview-panel {
    min-height: 600px;
}

.editor-panel {
    display: flex;
    min-width: 0;
}

.editor-panel > .side-tabs {
    flex: 1;
    min-width: 0;
}

/* Prevent wide API examples from blowing out the layout */
.video-gen-page .side-tabs__body,
.video-gen-page .side-tabs__panel,
.video-gen-page .side-tabs__panel .code-section,
.video-gen-page .side-tabs__panel .code-block {
    min-width: 0;
    max-width: 100%;
}

.video-gen-page .side-tabs__panel .code-block {
    width: 100%;
}

/* Section styling */
.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.prompts-section textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.55;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}

.prompts-section textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

/* Upload area */
.upload-section {
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bg-tertiary);
}

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

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 44px;
    margin-bottom: 16px;
}

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

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

.image-preview {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-top: 16px;
    display: none;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(15, 23, 42, 0.75);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-image:hover {
    background-color: var(--error);
}

/* Model Selection */
.model-selection {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.model-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.model-card {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-tertiary);
}

.model-card:hover {
    border-color: var(--accent-primary);
    background-color: var(--accent-light);
}

.model-card.active {
    border-color: var(--accent-primary);
    background-color: var(--accent-light);
}

.model-icon {
    font-size: 32px;
}

.model-info h5 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.model-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Input groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 0;
}

/* Advanced Settings */
.advanced-section {
    margin-bottom: 24px;
}

.advanced-header {
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}

.advanced-header:hover .fold-icon {
    color: var(--accent-primary);
}

.advanced-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.fold-icon {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.fold-icon.collapsed {
    transform: rotate(0deg);
}

.fold-icon:not(.collapsed) {
    transform: rotate(90deg);
}

.advanced-content {
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
    margin-top: 16px;
}

.advanced-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* Code block */
.code-block {
    position: relative;
    background: #0f172a;
    border: 1px solid rgba(30, 41, 59, 0.85);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.4);
}

.code-block pre {
    padding: 22px;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #f1f5f9;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Generate button */
.generate-button {
    width: 100%;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}


.generate-button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.generate-button:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Preview section */


.preview-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    min-height: 400px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

#resultVideo {
    width: 100%;
    height: auto;
    display: block;
    background-color: #000;
}

.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 48px 32px;
    color: var(--text-muted);
    background: linear-gradient(160deg, rgba(139, 92, 246, 0.12) 0%, rgba(124, 58, 237, 0.08) 60%, rgba(109, 40, 217, 0.05) 100%);
}

.result-placeholder .placeholder-icon {
    font-size: 42px;
}

.placeholder-headline {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-placeholder .placeholder-text {
    font-size: 14px;
    max-width: 360px;
    line-height: 1.6;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 12px;
}

.loading-subtext {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--success);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-button:hover {
    background-color: #22c55e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Generation time */
.generation-time {
    margin-top: 12px;
    padding: 8px 16px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

.generation-time .time-label {
    font-weight: 500;
    margin-right: 6px;
}

.generation-time .time-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Video Info */
.video-info {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 12px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.info-item {
    display: flex;
    gap: 6px;
    font-size: 14px;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

.output-cost-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Responsive design */
@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .side-tabs {
        padding: 18px;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 28px;
    }

    .page-description {
        font-size: 15px;
    }

    section {
        padding: 18px;
        margin-bottom: 18px;
    }

    .side-tabs {
        padding: 16px;
        gap: 14px;
    }

    .side-tabs__button {
        font-size: 14px;
        padding: 10px 14px;
    }

    .side-tabs__body {
        padding: 18px 16px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-description {
        font-size: 13px;
    }

    .input-group label {
        font-size: 14px;
    }

    .input-group textarea {
        min-height: 100px;
        font-size: 14px;
    }

    .slider-group label {
        font-size: 14px;
    }

    .slider-container {
        gap: 10px;
    }

    .slider-label {
        font-size: 14px;
    }

    .slider-value {
        font-size: 13px;
    }

    .aspect-ratio-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .aspect-button {
        font-size: 13px;
        padding: 8px 14px;
        flex: 1 1 calc(33.333% - 6px);
        min-width: 80px;
    }

    .generate-button {
        padding: 14px 24px;
        font-size: 15px;
        width: 100%;
    }

    .status-message {
        font-size: 14px;
        padding: 12px;
    }

    .preview-container {
        min-height: 250px;
        padding: 16px;
    }

    .video-preview {
        max-height: 400px;
    }

    .video-info {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        text-align: center;
    }

    .video-info-item {
        font-size: 13px;
    }

    .video-actions {
        flex-direction: column;
        gap: 10px;
    }

    .download-button, .new-generation-button {
        width: 100%;
        font-size: 14px;
        padding: 12px 20px;
    }

    .code-block pre {
        font-size: 12px;
        padding: 16px;
    }

    .copy-button {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .editor-layout {
        gap: 16px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-description {
        font-size: 14px;
    }

    section {
        padding: 14px;
        margin-bottom: 14px;
    }

    .side-tabs {
        padding: 12px;
        gap: 12px;
    }

    .side-tabs__button {
        font-size: 13px;
        padding: 9px 12px;
    }

    .side-tabs__body {
        padding: 16px 14px;
    }

    .aspect-button {
        flex: 1 1 calc(50% - 4px);
        font-size: 12px;
        padding: 8px 10px;
    }

    .slider-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .slider-value {
        text-align: left;
    }

    .preview-container {
        min-height: 200px;
    }

    .video-preview {
        max-height: 300px;
    }

    .model-card {
        min-width: 100%;
    }
}
