/* Google Fonts - Outfit and Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-base: #0a0a0f;
    --bg-surface: rgba(20, 20, 30, 0.45);
    --bg-surface-solid: #12121a;
    --bg-card: rgba(25, 25, 40, 0.55);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(124, 58, 237, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #7c3aed; /* Neon Violet */
    --primary-glow: rgba(124, 58, 237, 0.45);
    --secondary: #06b6d4; /* Neon Cyan */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-inset: inset 0 2px 4px 0 rgba(255, 255, 255, 0.05);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 60px;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 10, 15, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.6);
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main), var(--shadow-inset);
    border-radius: var(--border-radius-lg);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.glass-card:hover {
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.1);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--primary-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: -2px;
}

.badge {
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid var(--border-highlight);
    color: #c084fc;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Layout Grid */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 30px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards & Sections Title */
.panel-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.panel-title svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}

/* Drag-Drop Upload Area */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.05);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.1);
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    fill: var(--text-secondary);
    margin-bottom: 12px;
    transition: transform 0.3s ease, fill 0.3s ease;
}

.upload-zone:hover svg {
    transform: translateY(-4px);
    fill: var(--primary);
}

.upload-zone h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-zone span {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 8px;
}

/* Settings Form Elements */
.settings-group {
    margin-bottom: 16px;
}

.settings-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.settings-label span.value-bubble {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* Custom Select, Input, Switch Styling */
select, input[type="text"], input[type="number"] {
    width: 100%;
    background: rgba(10, 10, 15, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:focus, input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.2);
}

/* Segmented Options Control */
.segmented-control {
    display: flex;
    background: rgba(10, 10, 15, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 3px;
    gap: 4px;
}

.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

/* Custom Ranges */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 8px var(--primary-glow);
    transition: background 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--secondary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #ffffff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #8b5cf6, #4f46e5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

/* Visual Canvas Workspace */
.workspace-container {
    flex: 1;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.no-video-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.no-video-placeholder svg {
    width: 64px;
    height: 64px;
    fill: var(--text-muted);
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.no-video-placeholder p {
    font-size: 14px;
    margin-top: 6px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Selection Interactive Layout */
.canvas-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 520px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #000000;
    display: none;
}

.canvas-wrapper img {
    display: block;
    max-width: 100%;
    max-height: 520px;
    user-select: none;
    -webkit-user-drag: none;
}

.canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* File Upload Progress and Queue List */
.queue-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.queue-item {
    background: rgba(10, 10, 15, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.queue-item.active {
    border-color: var(--border-highlight);
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.queue-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.queue-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-pending { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.status-processing { background: rgba(124, 58, 237, 0.2); color: #c084fc; animation: pulse 1.5s infinite; }
.status-completed { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-failed { background: rgba(239, 68, 68, 0.2); color: #f87171; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.queue-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 11px;
    font-family: monospace;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}

.queue-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.action-btn.btn-dl {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.action-btn.btn-dl:hover {
    background: rgba(16, 185, 129, 0.25);
}

/* Template Chips Manager */
.template-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.template-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.template-chip:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--primary);
}

.template-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

.template-chip-del {
    color: var(--text-muted);
    font-weight: bold;
    font-size: 14px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.template-chip-del:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
}

/* Modal Popup window */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 960px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

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

.modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

/* Side-by-side Before/After Video Preview Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.comparison-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comparison-card label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-video-wrapper {
    width: 100%;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: #000000;
    border: 1px solid var(--border-color);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* Utilities */
.d-none { display: none !important; }
.text-center { text-align: center; }

/* Responsive adjustments */
@media (max-width: 1100px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    .left-panel {
        max-width: 100%;
    }
}

/* Media Type Queue Badges */
.file-badge {
    font-size: 8px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

.badge-vid {
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid var(--border-highlight);
    color: #c084fc;
}

.badge-img {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: #22d3ee;
}

/* Glowing selection boundary indicators */
.canvas-wrapper:hover {
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.15);
}

/* Micro-interaction updates */
.queue-item {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.queue-item:hover {
    background: rgba(25, 25, 40, 0.7);
    border-color: rgba(124, 58, 237, 0.2);
    transform: translateX(4px);
}

