/* Design System for ZeroBG (AI Background Remover) */

:root {
    /* Theme Variables - Dark Theme (Default) */
    --bg-primary: #090d16;
    --bg-secondary: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    
    --accent-primary: #10b981; /* Emerald Green */
    --accent-primary-hover: #059669;
    --accent-secondary: #06b6d4; /* Cyan */
    --accent-glow: rgba(16, 185, 129, 0.15);
    --accent-glow-cyan: rgba(6, 182, 212, 0.15);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(16, 185, 129, 0.18);
    --border-focus: rgba(16, 185, 129, 0.45);
    --border-inactive: rgba(148, 163, 184, 0.12);
    
    --danger: #ef4444;
    --success: #10b981;
    
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --sidebar-width: 320px;
    --header-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
    
    --checkerboard-color-1: #1e293b;
    --checkerboard-color-2: #0f172a;
}

/* Light Theme Variables */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: #ffffff;
    
    --accent-primary: #059669;
    --accent-primary-hover: #047857;
    --accent-secondary: #0891b2;
    --accent-glow: rgba(5, 150, 105, 0.08);
    --accent-glow-cyan: rgba(8, 145, 178, 0.08);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(5, 150, 105, 0.2);
    --border-focus: rgba(5, 150, 105, 0.4);
    --border-inactive: rgba(100, 116, 139, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(5, 150, 105, 0.06);
    --shadow-lg: 0 16px 40px rgba(5, 150, 105, 0.1);
    
    --checkerboard-color-1: #e2e8f0;
    --checkerboard-color-2: #ffffff;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.logo-area {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-inactive);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--accent-glow);
    animation: pulseGlow 3s infinite alternate;
}

.icon-brand {
    color: #ffffff;
    width: 20px;
    height: 20px;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.brand-title span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-badge {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

/* Sidebar Tab Headers */
.tab-headers {
    display: flex;
    border-bottom: 1px solid var(--border-inactive);
    background-color: rgba(0, 0, 0, 0.15);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 0.85rem 0.25rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.25s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

/* Tab Content */
.tab-contents {
    padding: 1.25rem;
    flex-grow: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Control Group Utilities */
.control-group {
    margin-bottom: 1.25rem;
}

.control-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.control-label-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.control-subgroup {
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-inactive);
    margin-top: 0.5rem;
    transition: opacity 0.3s ease;
}

.control-subgroup.disabled-overlay {
    opacity: 0.35;
    pointer-events: none;
}

/* Toggle Switch */
.custom-toggle {
    appearance: none;
    width: 32px;
    height: 18px;
    background-color: var(--border-inactive);
    border-radius: 9px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
    outline: none;
}

.custom-toggle:checked {
    background-color: var(--accent-primary);
}

.custom-toggle::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.custom-toggle:checked::after {
    transform: translateX(14px);
}

/* Sliders */
.slider-row {
    margin-bottom: 0.85rem;
}

.slider-label {
    font-size: 0.72rem;
    color: var(--text-main);
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

input[type="range"] {
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background-color: var(--border-inactive);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 0 8px var(--accent-glow);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background-color: var(--accent-primary-hover);
}

/* Background Selectors */
.bg-mode-selector {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-inactive);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.mode-btn i {
    width: 16px;
    height: 16px;
}

.mode-btn:hover {
    color: var(--text-main);
    border-color: var(--border-color);
}

.mode-btn.active {
    color: var(--accent-primary);
    background-color: var(--accent-glow);
    border-color: var(--accent-primary);
}

.control-pane {
    margin-top: 1rem;
    animation: fadeIn 0.25s ease-out;
}

.hidden {
    display: none !important;
}

/* Color Picker */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-inactive);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.color-picker-row.mini {
    padding: 0.25rem 0.5rem;
    background: none;
    border: none;
}

.color-picker-row.mini .slider-label {
    margin-bottom: 0;
    flex-grow: 1;
}

input[type="color"] {
    appearance: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    outline: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: 50%;
}

#color-hex-value {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 600;
}

.preset-colors-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.preset-color {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.preset-color:hover {
    transform: scale(1.15);
}

.preset-color.active {
    border: 2px solid var(--text-main);
    transform: scale(1.1);
}

/* Backdrop Grid */
.backdrop-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--accent-glow);
    border: 1px dashed var(--accent-primary);
    color: var(--accent-primary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.backdrop-upload-label:hover {
    background-color: var(--accent-primary);
    color: #ffffff;
}

.backdrop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.backdrop-card {
    aspect-ratio: 1.35;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-inactive);
    cursor: pointer;
    font-size: 0.65rem;
    font-family: var(--font-sans);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.backdrop-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.backdrop-card.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: scale(1.03);
}

/* Canvas Aspect Ratio Grid */
.ratio-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.ratio-btn {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-inactive);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    transition: all 0.2s ease;
}

.ratio-btn strong {
    font-size: 0.85rem;
    color: var(--text-main);
}

.ratio-btn span {
    font-size: 0.68rem;
    font-weight: 500;
}

.ratio-btn:hover {
    border-color: var(--border-color);
    color: var(--text-main);
}

.ratio-btn.active {
    border-color: var(--accent-primary);
    background-color: var(--accent-glow);
    color: var(--accent-primary);
}

.ratio-btn.active strong {
    color: var(--accent-primary);
}

.btn-secondary-mini {
    background: none;
    border: 1px solid var(--border-inactive);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary-mini i {
    width: 12px;
    height: 12px;
}

.btn-secondary-mini:hover {
    color: var(--text-main);
    border-color: var(--border-color);
}

/* Operations footer */
.editor-controls-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-operations {
    padding: 1.25rem;
    border-top: 1px solid var(--border-inactive);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.2rem;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.38);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary i {
    width: 18px;
    height: 18px;
}

.btn-secondary {
    background: none;
    border: 1px solid var(--border-inactive);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.2rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-secondary:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.02);
}

.btn-secondary i {
    width: 16px;
    height: 16px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-inactive);
    background-color: rgba(0, 0, 0, 0.1);
    margin-top: auto;
}

.privacy-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background-color: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.12);
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.85rem;
}

.privacy-box i {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.privacy-box p {
    font-size: 0.68rem;
    line-height: 1.35;
    color: var(--text-main);
}

.privacy-box p strong {
    color: var(--accent-primary);
}

.legal-links {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-links a:hover {
    color: var(--accent-primary);
}

.copyright {
    text-align: center;
    font-size: 0.62rem;
    color: var(--text-muted);
}

/* Main Workspace layout */
.workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.workspace-header {
    height: var(--header-height);
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    background-color: rgba(9, 13, 22, 0.7);
    z-index: 5;
}

.title-area h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.title-area p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-inactive);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: var(--text-main);
    border-color: var(--border-color);
    background-color: rgba(255, 255, 255, 0.03);
}

.btn-icon i {
    width: 18px;
    height: 18px;
}

/* Tool Workspace Content Area */
.tool-content {
    flex-grow: 1;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Upload Dropzone */
.dropzone-area {
    width: 100%;
    max-width: 680px;
    aspect-ratio: 1.5;
    background-color: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.dropzone-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(16, 185, 129, 0.05), transparent);
    transform: skewX(-25deg);
    transition: none;
}

.dropzone-area:hover::before {
    left: 150%;
    transition: left 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropzone-area:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.08);
}

.dropzone-area.drag-over {
    border-color: var(--accent-secondary);
    background-color: var(--accent-glow-cyan);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.2);
    transform: scale(1.015);
}

.dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 420px;
}

.dropzone-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.dropzone-inner h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.dropzone-inner p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.or-separator {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.or-separator::before,
.or-separator::after {
    content: '';
    height: 1px;
    background-color: var(--border-inactive);
    flex-grow: 1;
}

.select-files-btn {
    width: auto;
    display: inline-flex;
    padding: 0.65rem 1.5rem;
}

.privacy-guarantee {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-primary);
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 1.25rem;
    background-color: var(--accent-glow);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
}

.privacy-guarantee i {
    width: 12px;
    height: 12px;
}

/* Spinner / Progress View */
.processing-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 450px;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

.spinner-container {
    margin-bottom: 1.5rem;
}

.quantum-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3.5px solid transparent;
    border-top-color: var(--accent-primary);
    border-bottom-color: var(--accent-secondary);
    animation: spinCircle 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    position: relative;
}

.quantum-spinner::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-left-color: var(--accent-primary);
    border-right-color: var(--accent-secondary);
    opacity: 0.6;
    animation: spinCircle 0.8s linear infinite reverse;
}

.processing-panel h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

.processing-panel p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: var(--border-inactive);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
}

#progress-bar-percentage {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Image Visualizer / Slider Editor workspace */
.workspace-editor-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.visualizer-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Before / After Slider Widget */
.comparison-slider-widget {
    position: relative;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-inactive);
    overflow: hidden;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.composite-wrapper {
    position: relative;
    display: block;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

.canvas-checkerboard {
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: 
        linear-gradient(45deg, var(--checkerboard-color-1) 25%, transparent 25%), 
        linear-gradient(-45deg, var(--checkerboard-color-1) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, var(--checkerboard-color-1) 75%), 
        linear-gradient(-45deg, transparent 75%, var(--checkerboard-color-1) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: var(--checkerboard-color-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

#output-canvas {
    max-width: 100%;
    max-height: 70vh; /* Keep responsive bounds */
    display: block;
    object-fit: contain;
}

.original-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%; /* Managed dynamically by JS */
    height: 100%;
    overflow: hidden;
    border-right: none;
}

#original-image-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Slider Drag Bar */
.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%; /* Managed dynamically by JS */
    width: 2px;
    background-color: #ffffff;
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.handle-button {
    position: absolute;
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    color: #000000;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: ew-resize;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.handle-button i {
    width: 16px;
    height: 16px;
}

.slider-handle:hover .handle-button,
.comparison-slider-widget.active .handle-button {
    transform: translate(-50%, -50%) scale(1.12);
    background-color: var(--accent-primary);
    color: #ffffff;
}

.workspace-quick-actions {
    position: absolute;
    bottom: 1.5rem;
    z-index: 12;
}

.btn-quick {
    background-color: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.btn-quick:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
}

.btn-quick i {
    width: 14px;
    height: 14px;
}

/* Batch Processing Layout */
.batch-workspace-panel {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease-out;
}

.batch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-inactive);
    margin-bottom: 1.5rem;
}

.batch-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
}

.batch-actions {
    display: flex;
    gap: 0.5rem;
}

.batch-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
    width: auto;
}

.batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    max-height: 60vh;
}

/* Batch cards */
.batch-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-inactive);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.batch-card:hover {
    border-color: var(--border-color);
}

.batch-card-preview {
    aspect-ratio: 1.1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background-image: 
        linear-gradient(45deg, var(--checkerboard-color-1) 25%, transparent 25%), 
        linear-gradient(-45deg, var(--checkerboard-color-1) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, var(--checkerboard-color-1) 75%), 
        linear-gradient(-45deg, transparent 75%, var(--checkerboard-color-1) 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    background-color: var(--checkerboard-color-2);
}

.batch-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.batch-card-info {
    margin-top: 0.5rem;
}

.batch-filename {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-status-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.batch-status-label.pending { color: var(--text-muted); }
.batch-status-label.processing { color: var(--accent-secondary); }
.batch-status-label.completed { color: var(--success); }
.batch-status-label.error { color: var(--danger); }

/* Progress loader layer for batch card */
.batch-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(9, 13, 22, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    text-align: center;
}

.batch-progress-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spinCircle 1s linear infinite;
    margin-bottom: 0.4rem;
}

.batch-progress-overlay span {
    font-size: 0.62rem;
    font-family: monospace;
    color: var(--accent-primary);
    font-weight: 700;
}

/* Ad Placements */
.ad-slot {
    background-color: var(--bg-card);
    border: 1px solid var(--border-inactive);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.ad-slot:hover {
    border-color: rgba(148, 163, 184, 0.22);
}

.ad-label {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    background-color: var(--border-inactive);
    padding: 2px 6px;
    border-bottom-right-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.4;
}

.sidebar-ad {
    height: 110px;
    margin: 1.25rem;
    flex-shrink: 0;
}

.content-bottom-ad {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 1.5rem auto 0;
    flex-shrink: 0;
}

/* Animations */
@keyframes spinCircle {
    to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    from { box-shadow: 0 4px 10px var(--accent-glow); }
    to { box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive design overrides */
@media (max-width: 960px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 45vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-ad {
        display: none;
    }
    
    .tool-content {
        padding: 1rem;
        height: calc(100vh - 45vh - var(--header-height));
    }
    
    .dropzone-area {
        aspect-ratio: 1.7;
    }
    
    .content-bottom-ad {
        display: none;
    }
    
    #output-canvas {
        max-height: 38vh;
    }
}
