/* AI Video rebuild (UI revamp, 2026-11-07). Kit tokens scoped to #page-video.
 * Follows the AI Video art kit: hero art, SVG icons, purple/magenta/cyan.
 * Layout + skin only; no behaviour, API, or JS changes. Loads after
 * tc-create.css, so equal-specificity ties resolve in this file's favour.
 * The reference's "Generation Workflows" list maps to the live queue card
 * (#i2vQueueProgress, real queued jobs) and the live history panel; no
 * workflow list is fabricated.
 */

/* Kit tokens, scoped so they cannot leak into other pages */
#page-video {
    --tcv-bg: #090C21;
    --tcv-sidebar: #10102C;
    --tcv-panel: #151233;
    --tcv-panel-raised: #201542;
    --tcv-border: #55317E;
    --tcv-purple: #9630F5;
    --tcv-magenta: #D344FF;
    --tcv-blue: #26B9FF;
    --tcv-cyan: #36DBE9;
    --tcv-success: #19D58D;
    --tcv-danger: #F04459;
    --tcv-text: #F6F3FF;
    --tcv-muted: #B0A8D2;
    --tcv-radius: 14px;
}

/* ------------------------------------------------------------------ */
/* Hero: cinematic art, gradient title, filmstrip base                 */
/* ------------------------------------------------------------------ */

#page-video .tc-video-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--tcv-border);
    border-radius: var(--tcv-radius);
    margin: 2px 0 16px;
    background: linear-gradient(115deg, #080D27, #1C1050 55%, #071A43);
}
#page-video .tc-video-hero-art {
    position: absolute;
    inset: 0;
    background: url("/static/img/video/hero_background.svg") center/cover no-repeat;
    opacity: 0.95;
}
#page-video .tc-video-hero-body {
    position: relative;
    padding: 26px 28px 18px;
}
#page-video .tc-video-hero-crumb {
    margin: 0 0 4px;
    font-size: 12px;
    color: var(--tcv-muted);
}
#page-video .tc-video-hero-crumb .breadcrumb-item {
    color: var(--tcv-muted);
}
#page-video .tc-video-hero-title {
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.05;
    margin: 0 0 6px;
    background: linear-gradient(90deg, #ffffff, #E7C2FF 55%, #A5DFFF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
#page-video .tc-video-hero-sub {
    margin: 0;
    color: var(--tcv-muted);
    font-size: 15px;
}
#page-video .tc-video-hero-strip {
    position: relative;
    height: 24px;
    background: url("/static/img/video/filmstrip_decor.svg") left center/auto 100% repeat-x;
    border-top: 1px solid rgba(85, 49, 126, 0.6);
    opacity: 0.9;
}

/* ------------------------------------------------------------------ */
/* Mode toggle: gradient active pill, kit SVG icons                    */
/* ------------------------------------------------------------------ */

#page-video .video-main-mode-toggle .main-mode-btn.active {
    background: linear-gradient(115deg, #8224E8, #D23CFF);
    border-color: #E064FF;
    color: #fff;
    box-shadow: 0 4px 16px rgba(150, 48, 245, 0.35);
}
#page-video .main-mode-btn .mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#page-video .main-mode-btn .mode-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Dropzone icons (kit SVGs replace the emoji) */
#page-video .upload-dropzone .upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#page-video .upload-dropzone .upload-icon img {
    width: 28px;
    height: 28px;
    display: block;
}
#page-video .analyze-dropzone-icon img,
#page-video .optimize-dropzone-icon img {
    width: 44px;
    height: 44px;
    display: block;
    margin: 0 auto;
}
#page-video #i2t12j img {
    width: 20px;
    height: 20px;
    vertical-align: -4px;
}
#page-video #clipboardPasteBtn img {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

/* ------------------------------------------------------------------ */
/* Create workspace: two columns on desktop, stacked below 1024px      */
/* ------------------------------------------------------------------ */

@media (min-width: 1024px) {
    #page-video #inputSection {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        grid-template-areas:
            "toggle toggle"
            "upload side"
            "narrative side"
            "prompt side";
        gap: 16px;
        align-items: start;
    }
    #page-video #inputSection > .video-main-mode-toggle { grid-area: toggle; }
    #page-video #inputSection > #imageUploadArea { grid-area: upload; }
    #page-video #inputSection > #i2vNarrativeWrapper { grid-area: narrative; }
    #page-video #inputSection > #videoPromptWrapper { grid-area: prompt; }
    #page-video #inputSection > .settings-bar { grid-area: side; }
}

/* Settings bar becomes the right-hand "AI Generation Settings" panel */
#page-video #inputSection > .settings-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--tcv-border);
    border-radius: var(--tcv-radius);
    background: linear-gradient(140deg, var(--tcv-panel), #12102A);
}
#page-video #inputSection > .settings-bar::before {
    content: "AI Generation Settings";
    display: block;
    background: url("/static/img/video/icon_settings.svg") left center/18px 18px no-repeat;
    padding-left: 26px;
    font-weight: 700;
    font-size: 15px;
    color: var(--tcv-text);
}
#page-video #inputSection > .settings-bar .settings-spacer {
    display: none;
}
#page-video #inputSection > .settings-bar .setting-item {
    width: 100%;
}
#page-video #inputSection > .settings-bar .setting-item > label {
    display: block;
    margin-bottom: 4px;
}
/* Direct/local backend options group as "Advanced Settings" */
#page-video #i2v-direct-options {
    border: 1px solid var(--tcv-border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(32, 21, 66, 0.55);
}
#page-video #i2v-direct-options::before {
    content: "Advanced Settings";
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--tcv-text);
    margin-bottom: 10px;
}
/* Execute row fills the side panel */
#page-video #inputSection > .settings-bar #i3h8nf {
    width: 100%;
}
#page-video #inputSection #generateBtn.btn-generate {
    width: 100%;
    background: linear-gradient(115deg, #8224E8, #D23CFF);
    border-color: #E064FF;
    min-height: 48px;
}
#page-video #previewSegmentsBtn,
#page-video #evaluateBtn {
    width: 100%;
    min-height: 44px;
}

/* ------------------------------------------------------------------ */
/* Bottom panels: live queue + live history (full-width, stacked).
 * NOTE: the reference shows them side by side, but #generationHistoryPanel
 * is a direct child of #page-video, shared across all five tabs (it is
 * NOT inside #createVideoMode). Moving it would hide history on the other
 * four tabs, so the panels stay full-width and stacked, as before.     */
/* ------------------------------------------------------------------ */

#page-video #i2vQueueProgress.queue-progress-card,
#page-video #i2vQueueResults.queue-results-card,
#page-video #generationHistoryPanel.history-panel {
    background: linear-gradient(140deg, var(--tcv-panel), #12102A);
    border: 1px solid var(--tcv-border);
    border-radius: var(--tcv-radius);
}
#page-video #generationHistoryPanel .history-header h3 {
    color: var(--tcv-text);
}
#page-video #generationHistoryPanel .history-count {
    color: var(--tcv-muted);
}
#page-video #generationHistoryPanel .history-list > * {
    border-bottom: 1px solid var(--tcv-border);
}
#page-video #generationHistoryPanel .history-list > *:last-child {
    border-bottom: none;
}

/* ------------------------------------------------------------------ */
/* Enhance / Optimize / Analyze / Restore: kit panel treatment         */
/* ------------------------------------------------------------------ */

#page-video #enhanceVideoMode .creation-card,
#page-video #analyzeVideoMode .analyze-card,
#page-video #optimizeVideoMode .optimize-global-settings,
#page-video #restoreVideoMode .restore-card {
    background: linear-gradient(140deg, var(--tcv-panel), #12102A);
    border: 1px solid var(--tcv-border);
    border-radius: var(--tcv-radius);
}
#page-video #optimizeVideoMode .optimize-dropzone,
#page-video #analyzeVideoMode .analyze-dropzone {
    border: 1.5px dashed var(--tcv-purple);
    border-radius: var(--tcv-radius);
    background: rgba(150, 48, 245, 0.05);
}
/* Enhance dropzone: base .upload-dropzone is flex-row, which runs the
 * icon and the two text lines together on one line. Stack them. */
#page-video #videoEnhanceDropzone {
    flex-direction: column;
    gap: 4px;
}
#page-video #optimizeVideoMode .optimize-caps-banner {
    border: 1px solid var(--tcv-border);
    border-radius: 12px;
    background: rgba(32, 21, 66, 0.55);
    color: var(--tcv-muted);
}
#page-video #analyzeVideoMode .analyze-info-card h3 {
    color: var(--tcv-text);
}
#page-video #analyzeVideoMode .analyze-step {
    border-color: var(--tcv-border);
    color: var(--tcv-muted);
}
#page-video #restoreVideoMode .restore-heading h2 {
    color: var(--tcv-text);
}
#page-video #restoreVideoMode .restore-badge {
    border-color: var(--tcv-border);
    color: var(--tcv-cyan);
}
#page-video #restoreVideoMode .restore-notice {
    border-color: var(--tcv-border);
    color: var(--tcv-muted);
}
#page-video #restoreVideoMode .restore-button {
    background: linear-gradient(115deg, #8224E8, #D23CFF);
    border-color: #E064FF;
}
#page-video #restoreVideoMode .restore-button.restore-secondary {
    background: rgba(150, 48, 245, 0.12);
    border-color: var(--tcv-border);
    color: var(--tcv-text);
}

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 1023px) {
    #page-video .tc-video-hero-body {
        padding: 20px 18px 14px;
    }
    #page-video .tc-video-hero-strip {
        height: 18px;
    }
}

/* ------------------------------------------------------------------ */
/* Sweep fix: dialogue voice block in the right panel                  */
/* #dialogueOptions (the existing TTS Engine / Voice / Lip Sync        */
/* selects + Preview button) moved from #characterDialogueSection      */
/* into the top of the "AI Generation Settings" panel. Same elements,  */
/* same ids, same behaviour -- only the layout changes: the three      */
/* selects stack vertically, full width, like the reference voice     */
/* block. No display rule here: the [hidden] attribute (set when the   */
/* dialogue textarea is empty) and the mode toggle in app.js must      */
/* keep governing visibility.                                          */
/* ------------------------------------------------------------------ */
#page-video #inputSection > .settings-bar #dialogueOptions {
    margin-top: 4px;
    padding-top: 0;
    border-top: none;
    width: 100%;
}
#page-video #inputSection > .settings-bar #dialogueOptions .dialogue-voice-row {
    flex-direction: column;
    gap: 10px;
}
#page-video #inputSection > .settings-bar #dialogueOptions .dialogue-voice-row .voice-option {
    min-width: 0;
    width: 100%;
}
#page-video #inputSection > .settings-bar #dialogueOptions #i4hrui {
    width: 100%;
    min-height: 40px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--tcv-border);
    background: rgba(150, 48, 245, 0.12);
    color: var(--tcv-text);
    cursor: pointer;
}
