/* CSS Reset & Variables */
:root {
    --bg-primary: #07080d;
    --bg-secondary: #0d0f1a;
    --bg-tertiary: #141727;
    --bg-card: rgba(20, 23, 39, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --accent-glow: rgba(99, 102, 241, 0.25);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
    --font-sans: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme overrides */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #4f46e5;
    --accent-hover: #3730a3;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent-glow: rgba(79, 70, 229, 0.15);
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.1);
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Area */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--accent-glow);
    color: #fff;
}

.logo-icon i {
    width: 24px;
    height: 24px;
}

.logo-area h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Stats Dashboard */
.stats-dashboard {
    display: flex;
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: scale(1.05);
}

/* Main Workspace */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Drop Zone Styles */
.drop-zone {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 64px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    backdrop-filter: blur(16px);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.03);
    box-shadow: 0 0 32px var(--accent-glow);
}

.drop-zone.dragover .upload-icon {
    transform: translateY(-8px) scale(1.1);
    color: #a855f7;
}

.file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Animated Background Canvas */
.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    backdrop-filter: blur(16px);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition-smooth);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

.toast.toast-out {
    animation: toastOut 0.3s forwards ease;
}

.toast i { flex-shrink: 0; }
.toast .toast-success-icon { color: var(--success); }
.toast .toast-error-icon { color: var(--danger); }
.toast .toast-info-icon { color: var(--accent); }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    to { transform: translateX(120%); opacity: 0; }
}

/* Format Badges */
.format-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
    margin-top: 4px;
}

.format-badge {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Quality Presets */
.quality-presets {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.quality-preset-btn {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.quality-preset-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

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

/* Add More Bar */
.add-more-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.batch-info kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
}

.info-icon { width: 14px; height: 14px; color: var(--text-muted); }
.header-icon { width: 18px; height: 18px; color: var(--accent); }

/* Stat card icon */
.stat-icon { display: flex; margin-bottom: 4px; }
.stat-lucide { width: 16px; height: 16px; color: var(--accent); }

/* Footer */
.app-footer {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-icon { width: 14px; height: 14px; color: var(--success); }
.footer-heart { width: 12px; height: 12px; color: #ef4444; }

/* Spinner */
.spin {
    animation: spinRotate 1s linear infinite;
}

@keyframes spinRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal icon */
.modal-icon { width: 18px; height: 18px; color: var(--accent); display: inline; vertical-align: middle; margin-right: 4px; }

.upload-icon-container {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.drop-zone:hover .upload-icon-container {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.drop-zone h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.or-divider {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.drop-zone-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 480px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
    transform: translateY(-2px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 16px var(--success-glow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-text-danger {
    background: transparent;
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
}

.btn-text-danger:hover {
    background: var(--danger-glow);
    border-radius: var(--radius-sm);
}

.btn-large {
    padding: 14px 24px;
    font-size: 15px;
    width: 100%;
}

.btn-select {
    padding: 12px 28px;
    font-size: 15px;
}

.hidden {
    display: none !important;
}

/* Active Workspace Grid */
.workspace-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
}

@media (max-width: 1024px) {
    .workspace-layout {
        grid-template-columns: 1fr;
    }
}

/* Left Column: Images List */
.images-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.column-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.images-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Image Card Styles */
.image-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    /* Native CSS Virtualization */
    content-visibility: auto;
    contain-intrinsic-size: 155px;
}

.image-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-md);
}

.image-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.image-card-preview {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-card-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.image-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.image-meta-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.image-card-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-badge.processing {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: var(--border-color);
    border-color: var(--text-secondary);
}

.btn-icon.btn-delete:hover {
    background: var(--danger-glow);
    border-color: var(--danger);
    color: var(--danger);
}

/* Image Card Controls (Accordion for individual settings) */
.image-card-controls {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .image-card-controls {
        grid-template-columns: 1fr;
    }
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-item label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Progress bar inside Card */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.1s ease;
}

/* Right Column: Settings Panel */
.settings-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 24px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.settings-card-header i {
    color: var(--accent);
    width: 22px;
    height: 22px;
}

.settings-card-header h3 {
    font-size: 18px;
    font-weight: 700;
}

/* Inputs & Form Styling */
.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.select-wrapper {
    position: relative;
}

select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    outline: none;
    font-size: 14px;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.select-wrapper::after {
    content: "▼";
    font-size: 10px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

.setting-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

.label-with-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label-with-value label {
    margin-bottom: 0;
}

.value-badge {
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Quality Range Slider */
.range-slider-wrapper {
    padding: 8px 0;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 0 10px var(--accent-glow);
}

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

/* Resize presets */
.resize-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.resize-preset-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.resize-preset-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

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

.custom-resize-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.custom-resize-input input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    width: 100px;
    outline: none;
    font-size: 13px;
}

.custom-resize-input input:focus {
    border-color: var(--accent);
}

.custom-resize-input span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Checkbox container styling */
.checkbox-group {
    margin-top: 24px;
    margin-bottom: 24px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 500 !important;
    user-select: none;
    color: var(--text-secondary) !important;
    line-height: 1.4;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.action-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Before / After Slider Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s forwards ease;
}

.modal-container {
    width: 90%;
    max-width: 1000px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: slideUp 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

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

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    flex-grow: 1;
    overflow: hidden;
    min-height: 400px;
    max-height: 60vh;
}

/* Image Comparison Slider Engine */
.comparison-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    border-radius: var(--radius-md);
    background: radial-gradient(circle, #25252d 0%, #0c0c12 100%);
    aspect-ratio: 16/9;
}

.comparison-container img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.before-wrapper {
    z-index: 10;
}

.after-wrapper {
    z-index: 20;
    width: 100%; /* Full width */
    clip-path: inset(0 0 0 50%); /* Initial state split half screen */
}

.image-label {
    position: absolute;
    bottom: 16px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    z-index: 30;
}

.label-before {
    left: 16px;
    border-left: 3px solid var(--accent);
}

.label-after {
    right: 16px;
    border-right: 3px solid var(--success);
}

/* Slider Handle styling */
.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 4px;
    background: #fff;
    z-index: 40;
    cursor: ew-resize;
    transform: translateX(-50%);
}

.slider-line {
    position: absolute;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
    left: 1px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    color: var(--bg-primary);
}

.slider-button i {
    width: 18px;
    height: 18px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-details p {
    font-size: 14px;
    font-weight: 600;
}

.modal-details .text-secondary {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========================================= */
/*       RESPONSIVE DESIGN (TABLET & MOBILE) */
/* ========================================= */

@media (max-width: 768px) {
    /* Header & Hero */
    .app-header {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 16px;
        text-align: center;
    }

    .stats-dashboard {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .stat-card {
        min-width: calc(50% - 8px); /* 2 columns on mobile */
    }

    /* Main Container */
    .container {
        padding: 0 16px;
    }

    /* Drop Zone */
    .drop-zone {
        padding: 40px 16px;
    }
    
    .drop-zone h2 {
        font-size: 20px;
    }

    /* Add More Bar */
    .add-more-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 12px;
    }

    .btn-add-more {
        width: 100%;
        justify-content: center;
    }

    /* Image Card Controls */
    .image-card-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .image-card-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .image-card-preview {
        width: 100%;
        height: 120px;
        margin-right: 0;
    }

    .image-card-status {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Modal Layout */
    .modal-container {
        width: 95vw;
        max-height: 90vh;
    }

    .modal-body {
        padding: 16px;
        min-height: 250px;
    }

    .comparison-container {
        aspect-ratio: auto;
        height: 300px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        text-align: center;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Settings Group Action Buttons */
    .action-buttons-group {
        flex-direction: column;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
