/* ============================================================
   IMAGESECTOR — STYLES.CSS
   Professional Image Compressor
   Dark industrial theme · Red accents · Syne + IBM Plex Mono
   ============================================================ */

/* ── CSS VARIABLES ─────────────────────────────────────── */
:root {
    /* Colors */
    --bg-deepest:   #0f001c;
    --bg-dark:      #0a0f1e;
    --bg-surface:   #0f172a;
    --bg-card:      #1a2235;
    --bg-card-hover:#1e2a42;
    --bg-input:     #0d1526;

    --red:          #dc2626;
    --red-bright:   #ef4444;
    --red-dim:      rgba(220, 38, 38, 0.15);
    --red-glow:     rgba(220, 38, 38, 0.3);
    --red-border:   rgba(220, 38, 38, 0.25);

    --text-primary: #f5f4f4e4;
    --text-secondary:#f2ecec;
    --text-muted:   #7c7c7c;
    --text-accent:  #f87171;

    --border:       rgba(148, 163, 184, 0.08);
    --border-hover: rgba(148, 163, 184, 0.18);
    --border-red:   var(--red-border);

    --success:      #10b981;
    --success-dim:  rgba(16, 185, 129, 0.12);
    --warning:      #f59e0b;

    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-mono:    'IBM Plex Mono', monospace;

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
    --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
    --shadow-red: 0 0 20px rgba(220,38,38,0.2);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --fast: 150ms var(--ease);
    --normal: 250ms var(--ease);
    --slow: 400ms var(--ease);
}

/* ── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-display);
    background-color: var(--bg-deepest);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* Remove number input arrows */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ── BACKGROUND TEXTURE ─────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 10% 20%, rgba(220,38,38,0.04) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 90% 80%, rgba(30,40,80,0.3) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── HEADER ─────────────────────────────────────────────── */
/* .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
} */

/* .nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
}

.logo-icon {
    font-size: 1.4rem;
    color: var(--red);
    line-height: 1;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--text-primary);
}

.logo-accent {
    color: var(--red);
} */

.nav-badges {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-items: center;
    justify-content: center;
    padding-top: 20px;
}

.nav-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(127, 32, 4, 0.358);
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── TOOL WRAPPER ───────────────────────────────────────── */
.tool-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

/* ── HERO ───────────────────────────────────────────────── */
.tool-hero {
    text-align: center;
    padding: var(--space-xl) 0;
}

.hero-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--red);
    border: 2px solid var(--red-border);
    border-radius: 3px;
    padding: 0.25rem 0.75rem;
    margin-bottom: var(--space-lg);
    background: var(--red-dim);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.text-accent { color: var(--red-bright); }

.hero-sub {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

/* ── UPLOAD ZONE ────────────────────────────────────────── */
.upload-section {
    width: 100%;
}

.upload-zone {
    border: 3px dashed var(--red-border);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--normal), background var(--normal), box-shadow var(--normal);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 100%, var(--red-dim), transparent);
    opacity: 0;
    transition: opacity var(--normal);
    pointer-events: none;
}

.upload-zone:hover,
.upload-zone:focus,
.upload-zone.drag-over {
    border-color: var(--red);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px var(--red-dim), var(--shadow-red);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
    opacity: 1;
}

.upload-zone.drag-over {
    border-style: solid;
    transform: scale(1.01);
}

.upload-icon {
    color: var(--red);
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: center;
}

.upload-icon svg {
    filter: drop-shadow(0 0 12px var(--red-glow));
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.upload-link {
    color: var(--red-bright);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.upload-hint {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    letter-spacing: 0.04em;
}

/* ── SETTINGS PANEL ─────────────────────────────────────── */
.settings-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.preset-group {
    grid-column: 1 / -1;
}

.setting-label {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(255, 0, 0, 0.655);
    text-transform: uppercase;
}

/* Presets */
.preset-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--normal);
    white-space: nowrap;
}

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

.preset-btn.active {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red-bright);
    box-shadow: 0 0 12px var(--red-glow);
}

.preset-icon { 
    font-size: 1rem; 
}

/* Quality Slider */
.quality-group { min-width: 280px; }

.quality-display {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--red-bright);
    margin-left: auto;
    float: right;
}

.slider-wrapper {
    position: relative;
    padding: 0.25rem 0;
}

.quality-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--red);
    cursor: pointer;
    border: 2px solid var(--bg-deepest);
    box-shadow: 0 0 8px var(--red-glow);
    transition: transform var(--fast), box-shadow var(--fast);
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 14px var(--red-glow);
}

.quality-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--red);
    cursor: pointer;
    border: 2px solid var(--bg-deepest);
    box-shadow: 0 0 8px var(--red-glow);
}

.slider-track-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red), var(--red-bright));
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
    transition: width var(--fast);
    z-index: 0;
    margin-top: 0.25rem;
}

.slider-hints {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgb(150, 150, 150);
    margin-top: 0.4rem;
}

/* Toggle Mode */
.toggle-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
}

.toggle-btn {
    flex: 1;
    padding: 0.55rem var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--normal);
}

.toggle-btn.active {
    background: var(--red-dim);
    color: var(--red-bright);
}

.toggle-btn:not(.active):hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
}

.mode-hint {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgb(150, 150, 150);
}

/* Select */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 0.9rem;
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md);
    color: var(--text-primary) !important;
    font-family: var(--font-display);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none;
    transition: border-color var(--fast), box-shadow var(--fast);
}

.select-wrapper select:focus {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px var(--red-dim) !important;
}

.select-wrapper select option {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

.select-arrow {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.8rem;
}

.format-hint {
    font-family: var(--font-mono);
    font-size: 0.63rem;
    color: rgb(150, 150, 150);
}

/* Number Input */
.input-wrapper {
    position: relative;
}

.number-input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--fast), box-shadow var(--fast);
}

.number-input::placeholder { color: var(--text-muted); }

.number-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-dim);
}

.input-unit {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    pointer-events: none;
}

.resize-hint {
    font-family: var(--font-mono);
    font-size: 0.63rem;
    color: rgb(150, 150, 150);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--fast);
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--red);
    border-color: var(--red);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '✓';
    font-size: 0.75rem;
    color: white;
    font-weight: 700;
}

.exif-desc {
    font-family: var(--font-mono);
    font-size: 0.63rem;
    color: rgb(150, 150, 150);
}

/* ── ACTION BAR ─────────────────────────────────────────── */
.action-bar {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--normal);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--red);
    color: white;
    border-color: var(--red);
    box-shadow: 0 4px 12px rgba(220,38,38,0.35);
}

.btn-primary:hover:not(:disabled) {
    background: var(--red-bright);
    border-color: var(--red-bright);
    box-shadow: 0 6px 20px rgba(220,38,38,0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--red-border);
    color: var(--red-bright);
    background: var(--red-dim);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

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

/* ── BATCH PANEL ─────────────────────────────────────────── */
.batch-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.batch-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.batch-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--red-bright);
    background: var(--red-dim);
    border: 1px solid var(--red-border);
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
}

.batch-summary {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.summary-label { color: var(--text-muted); font-size: 0.62rem; letter-spacing: 0.08em; }
.summary-value { color: var(--text-primary); font-weight: 600; }

.summary-divider {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.summary-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    background: var(--success-dim);
    border: 1px solid rgba(16,185,129,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
}

/* Image Card */
.img-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--normal);
    position: relative;
}

.img-card:hover {
    border-color: var(--red-border);
    box-shadow: 0 4px 20px rgba(220,38,38,0.12);
    transform: translateY(-2px);
}

.img-card.active {
    border-color: var(--red);
    box-shadow: 0 0 0 2px var(--red-dim), var(--shadow-red);
}

.img-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--bg-input);
    display: block;
}

.img-card-body {
    padding: 0.75rem;
}

.img-card-name {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.4rem;
}

.img-card-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
}

.card-stat-orig { color: var(--text-muted); }
.card-stat-arrow { color: var(--text-muted); }
.card-stat-comp { color: var(--text-primary); }

.card-savings {
    margin-left: auto;
    font-weight: 700;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.card-savings.good  { color: var(--success); background: var(--success-dim); }
.card-savings.ok    { color: var(--warning); background: rgba(245,158,11,0.12); }
.card-savings.bad   { color: var(--text-muted); background: rgba(255,255,255,0.04); }

.img-card-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
}

.card-btn {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--fast);
    text-align: center;
}

.card-btn-preview {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.card-btn-preview:hover {
    border-color: var(--red-border);
    color: var(--red-bright);
    background: var(--red-dim);
}

.card-btn-dl {
    background: var(--red-dim);
    border-color: var(--red-border);
    color: var(--red-bright);
}

.card-btn-dl:hover {
    background: var(--red);
    color: white;
}

.card-btn-dl:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Status badge on card */
.img-card-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}

.status-pending   { background: rgba(100,116,139,0.7); color: #cbd5e1; }
.status-compressing { background: rgba(245,158,11,0.7); color: #fef3c7; animation: blink 0.8s infinite; }
.status-done      { background: rgba(16,185,129,0.7); color: #d1fae5; }
.status-error     { background: rgba(220,38,38,0.7); color: #fee2e2; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* Remove button on card */
.card-remove {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(2,6,23,0.75);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--fast), background var(--fast);
}

.img-card:hover .card-remove { opacity: 1; }
.card-remove:hover { background: var(--red); color: white; border-color: var(--red); }

/* ── COMPARISON PANEL ───────────────────────────────────── */
.comparison-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.comparison-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.comparison-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.comparison-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 180px;
    text-align: center;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--fast);
    line-height: 1;
}

.nav-btn:hover {
    border-color: var(--red-border);
    color: var(--red-bright);
    background: var(--red-dim);
}

/* Comparison Layout */
.comparison-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-xl);
    align-items: start;
}

/* Comparison Figure */
.comparison-figure {
    border: 0;
    margin: 0;
    padding: 0;
}

.comparison-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: ew-resize;
    user-select: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    touch-action: none;
}

.comp-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.comp-after {
    /* shown fully — the "after" (compressed) base layer */
}

.comp-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    clip-path: inset(0 50% 0 0);
    will-change: clip-path;
}

/* Handle */
.comp-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    transform: translateX(-50%);
    z-index: 10;
    cursor: ew-resize;
}

.handle-line {
    width: 2px;
    height: 100%;
    background: white;
    box-shadow: 0 0 8px rgba(0,0,0,0.8);
    margin: 0 auto;
}

.handle-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform var(--fast);
}

.comp-handle:hover .handle-knob,
.comp-handle.dragging .handle-knob {
    transform: translate(-50%, -50%) scale(1.1);
}

.comp-badge {
    position: absolute;
    top: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.65rem;
    border-radius: 3px;
    z-index: 5;
    pointer-events: none;
}

.comp-badge-before {
    left: var(--space-md);
    background: rgba(0,0,0,0.7);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.comp-badge-after {
    right: var(--space-md);
    background: rgba(220,38,38,0.8);
    color: white;
}

/* ── STATS PANEL ─────────────────────────────────────────── */
.stats-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.stats-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.stat-highlight {
    background: var(--red-dim);
    border-color: var(--red-border);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

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

.stat-highlight .stat-value { color: var(--red-bright); }
.mono { font-family: var(--font-mono); }

.download-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

/* ── SEO ARTICLE ─────────────────────────────────────────── */
.seo-article {
    position: relative;
    z-index: 1;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: var(--space-3xl) var(--space-xl);
    margin-top: var(--space-3xl);
}

.seo-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

.seo-header { text-align: center; padding-bottom: var(--space-xl); border-bottom: 1px solid var(--border); }

.seo-main-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.seo-intro {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.seo-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-left: var(--space-md);
    border-left: 3px solid var(--red);
}

.seo-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: 0.5rem;
    margin-top: var(--space-lg);
}

.seo-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.seo-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: var(--space-md);
}

.seo-section ul li {
    color: var(--text-secondary);
    font-size: 0.92rem;
    padding-left: var(--space-lg);
    position: relative;
}

.seo-section ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--red);
    font-size: 0.8rem;
}

/* FAQ */
.faq-section { display: flex; flex-direction: column; gap: var(--space-sm); }
.faq-section h3 { margin-bottom: var(--space-md); }

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--fast);
}

.faq-item[open] {
    border-color: var(--red-border);
}

.faq-question {
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color var(--fast);
}

.faq-question:hover { color: var(--red-bright); }

.faq-question::after {
    content: '+';
    color: var(--red);
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.faq-item[open] .faq-question::after { content: '−'; }

.faq-answer {
    padding: 0 var(--space-lg) var(--space-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
    position: relative;
    z-index: 1;
    background: var(--bg-deepest);
    border-top: 1px solid var(--border);
    padding: var(--space-xl);
    text-align: center;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-xs);
}

.footer-tagline {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ── TOAST NOTIFICATIONS ────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.1rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: toast-in var(--normal) forwards;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 320px;
}

.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error   { border-color: var(--red-border); }
.toast.info    { border-color: rgba(100,116,139,0.3); }

.toast-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast.success .toast-dot { background: var(--success); }
.toast.error   .toast-dot { background: var(--red); }
.toast.info    .toast-dot { background: var(--text-muted); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
}

/* ── PROGRESS OVERLAY ───────────────────────────────────── */
.progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.85);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-modal {
    background: var(--bg-card);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-md), var(--shadow-red);
    animation: modal-in var(--slow) var(--ease) forwards;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.progress-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    animation: spin-glow 1s linear infinite;
}

@keyframes spin-glow {
    0%   { filter: drop-shadow(0 0 4px var(--red-glow)); }
    50%  { filter: drop-shadow(0 0 12px var(--red-glow)); }
    100% { filter: drop-shadow(0 0 4px var(--red-glow)); }
}

.progress-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
}

.progress-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--red-bright));
    border-radius: 3px;
    width: 0%;
    transition: width 200ms var(--ease);
    box-shadow: 0 0 8px var(--red-glow);
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .comparison-layout {
        grid-template-columns: 1fr;
    }

    .stats-panel {
        order: -1;
    }
}

@media (max-width: 680px) {
    .tool-wrapper {
        padding: var(--space-xl) var(--space-md);
        gap: var(--space-xl);
    }

    .nav-container {
        padding: 0.75rem var(--space-md);
        flex-wrap: wrap;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .preset-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .action-bar {
        flex-direction: column;
    }

    .action-bar .btn {
        width: 100%;
        justify-content: center;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    }

    .comparison-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .batch-header {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .toast-container {
        right: var(--space-md);
        left: var(--space-md);
        bottom: var(--space-md);
    }

    .seo-article {
        padding: var(--space-2xl) var(--space-md);
    }
}

@media (max-width: 400px) {
    .nav-badges { display: none; }
    .hero-title { font-size: 1.6rem; }
    .preset-buttons { grid-template-columns: 1fr; }
}
