:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(22, 28, 45, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --success-hover: #059669;
    --accent-glow: rgba(99, 102, 241, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.glow-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.05) 50%, rgba(0,0,0,0) 100%);
    top: -100px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    color: var(--text-muted);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.glass {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hidden {
    display: none !important;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    font-weight: 600;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

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

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

.input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}


.input-group:focus-within {
    border-color: var(--primary-color);
}

.input-group input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    width: 100%;
    font-size: 0.95rem;
    margin-left: 0.5rem;
}

.btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

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

.btn.primary:hover {
    background: var(--primary-hover);
}

.btn.success {
    background: var(--success-color);
    color: white;
}

.btn.success:hover {
    background: var(--success-hover);
}

.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--card-border);
}

.stat-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #38bdf8;
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-container {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #38bdf8);
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 35px;
}

.file-list-wrapper {
    max-height: 250px;
    overflow-y: auto;
}

.file-list-wrapper::-webkit-scrollbar {
    width: 6px;
}

.file-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
}

.file-list {
    list-style: none;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.file-item.active {
    background: rgba(99, 102, 241, 0.12) !important;
    box-shadow: inset 4px 0 0 var(--primary-color);
    border-bottom-color: rgba(99, 102, 241, 0.3);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    background: rgba(0,0,0,0.3);
}

.badge {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge.waiting { background: rgba(255,255,255,0.1); color: var(--text-muted); }
.badge.processing { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.badge.success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge.error { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Before After Image Slider Component */
.preview-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
    border: 2px dashed rgba(255,255,255,0.05);
    border-radius: 8px;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin: auto 0;
}

.slider-img-wrapper {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 350px;
    max-height: 550px;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
    border: 1px solid var(--card-border);
}

.slider-img-wrapper img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#img-inverted {
    clip-path: inset(0 0 0 50%);
    z-index: 2;
}

.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    cursor: ew-resize;
    z-index: 3;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.slider-handle-line {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
}

.slider-handle-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    pointer-events: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Background clean threshold slider */
.slider-control-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.slider-header .badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.range-input {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    margin: 0.5rem 0;
}

.range-input::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-labels-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Client-side Drag & Drop Zone Styles */
.hidden {
    display: none !important;
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    transition: all 0.25s ease;
    cursor: default;
    position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.08);
}

.drop-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
}

.drop-or {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.btn-group .btn {
    width: auto;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
}

.action-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}


