/* Windows XP Classic Theme V4 */

.aivte-xp-container {
    font-family: Tahoma, 'Microsofe Sans Serif', Arial, sans-serif;
    color: #000;
    max-width: 1400px;
    margin: 20px auto;
    background: #ECE9D8; /* Classic XP Window Gray */
    padding: 3px;
    border: 1px solid #0055EA; /* Thin blue border representing window edge */
    border-radius: 8px 8px 0 0;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.aivte-xp-titlebar {
    background: linear-gradient(180deg, #0058E6 0%, #3A93FF 10%, #288EFF 50%, #127DFF 51%, #036CD6 100%);
    border-radius: 6px 6px 0 0;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.aivte-xp-title {
    color: white;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 2px #000;
    margin: 0;
}

.aivte-xp-buttons .btn {
    width: 21px; height: 21px; display: inline-block; margin-left: 2px;
    background: #e68b2c; border: 1px solid #fff; border-radius: 3px;
}

.aivte-xp-content-area {
    background: #ECE9D8;
    padding: 10px;
    border: 1px solid #fff;
    border-right-color: #808080;
    border-bottom-color: #808080;
}

/* Template Grid (Top) */
.aivte-template-selection {
    margin-bottom: 15px;
    background: #fff;
    border: 2px inset #d4d0c8;
    padding: 10px;
    height: 180px;
    overflow-y: auto;
}

.aivte-template-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.aivte-template-card {
    width: 200px;
    background: #ECE9D8;
    border: 2px outset #fff;
    padding: 5px;
    cursor: pointer;
    text-align: center;
}

.aivte-template-card:active {
    border-style: inset;
}

.aivte-template-card.active {
    background: #c3d9ff; /* Subtle blue selection */
    border: 1px dotted #000;
}

.aivte-card-vidwrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px inset #808080;
}

.aivte-card-vidwrap video { width: 100%; height: 100%; object-fit: cover; }
.aivte-no-vid { color: white; display:flex; align-items:center; justify-content:center; height:100%; font-size: 11px;}
.aivte-card-title { margin-top: 5px; font-size: 11px; }

/* Bottom Split Section */
.aivte-editor-split {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.aivte-editor-controls {
    flex: 1;
    min-width: 320px;
    border: 2px groove #fff;
    padding: 15px;
    background: #ECE9D8;
}

.aivte-editor-preview {
    flex: 1.8;
    min-width: 500px;
    border: 2px groove #fff;
    padding: 15px;
    background: #ECE9D8;
}

/* Form Elements (XP Style) */
.fieldset-xp { border: 2px groove #fff; padding: 10px; margin-bottom: 15px; }
.legend-xp { color: #0055EA; padding: 0 5px; background: #ECE9D8; font-size: 11px; }

.aivte-control-group { margin-bottom: 10px; }
.aivte-control-group label { display: inline-block; font-size: 11px; margin-bottom: 3px; }
.aivte-input {
    width: 100%; padding: 3px 5px; border: 2px inset #d4d0c8; background: #fff;
    font-size: 11px; font-family: Tahoma; color: #000; box-sizing: border-box;
}

.aivte-file-upload {
    width: 100%; padding: 4px; border: 2px inset #d4d0c8; background: #fff; font-size: 11px;
}

/* XP Toggles */
.aivte-toggles-block { margin-top: 10px; background: #fff; border: 2px inset #d4d0c8; padding: 8px; }
.aivte-toggle-item { display: block; margin-bottom: 5px; font-size: 11px; }
.aivte-toggle-item input[type="checkbox"] { margin-right: 5px; vertical-align: middle; }

/* XP Button */
.aivte-btn-xp {
    display: block; width: 100%; padding: 6px;
    background: #ECE9D8; color: #000; border: 2px outset #fff;
    font-size: 11px; justify-content: center; cursor: pointer;
    font-family: Tahoma; text-align: center; font-weight: bold;
    margin-top: 10px;
}
.aivte-btn-xp:active { border-style: inset; padding: 7px 5px 5px 7px; } /* simulate click push */
.aivte-btn-xp:disabled { color: #808080; text-shadow: 1px 1px #fff; cursor: not-allowed; border: 2px outset #fff; }

/* Status Loader */
.aivte-status-box { margin-top: 15px; padding: 10px; border: 2px inset #d4d0c8; background: #fff; text-align: center; }
.aivte-status-text { font-size: 11px; margin-bottom: 5px; color: #000; }
.aivte-progress-bar-wrap { width: 100%; height: 16px; background: #ECE9D8; border: 1px inset #808080; }
.aivte-progress-bar { height: 100%; background: #0058e6; width: 0%; transition: width 0.2s linear; }

/* Live Preview UI */
.aivte-preview-wrapper {
    position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
    background: #000; border: 2px inset #d4d0c8; isolation: isolate;
}
.aivte-layer { position: absolute; top:0; left:0; width:100%; height:100%; }
.aivte-layer video, .aivte-layer iframe { width: 100%; height: 100%; object-fit: cover; border: none; }
#aivte-template-video-layer { opacity: 0.85; z-index: 2; pointer-events: none; }
.aivte-overlay-layer { position: absolute; top:0; left:0; width:100%; height:100%; z-index: 5; pointer-events: none; }

.aivte-preview-text {
    color: #fff; font-weight: bold; font-family: Arial; font-size: 2vw;
    text-shadow: 2px 2px 0 #000; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; box-sizing: border-box;
}

.aivte-placeholder-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 12px; z-index: 1; text-align: center; width: 80%;
}

/* Timeline Trim (XP Sliders are chunky block style) */
.aivte-trim-container { margin-top: 20px; padding: 10px; border: 2px groove #fff; }
.aivte-trim-header { display: block; font-weight: bold; margin-bottom: 15px; font-size: 11px; }
.aivte-trim-labels { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; }

/* Override noUiSlider to look like XP track thumb */
.noUi-connect { background: #316ac5; }
.noUi-horizontal { height: 6px; border: 1px inset #808080; background: #ECE9D8; box-shadow: none; }
.noUi-horizontal .noUi-handle { 
    width: 10px; height: 18px; right: -5px; top: -7px; 
    background: #ECE9D8; border: 2px outset #fff; border-radius: 0; box-shadow: none; cursor: default;
}
.noUi-handle:before, .noUi-handle:after { display: none; }

.aivte-download-area { margin-top: 15px; }

/* Result Player */
.aivte-result-player-wrap { margin-bottom: 15px; border: 2px inset #d4d0c8; padding: 2px; background: #000; }
.aivte-result-player-wrap video { width: 100%; display: block; }
