/* ============================================================
   Neon Image Compressor PRO — Style Sheet
   Design System: Neon Dark (matches Audio Trimmer PRO & Image Converter PRO)
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --bg-color: #0a0a0a;
    --surface-color: #141414;
    --surface-light: #222;
    --primary-color: #a3ff00;
    --primary-glow: rgba(163, 255, 0, 0.4);
    --danger-color: #ff4444;
    --text-color: #ffffff;
    --text-muted: #888899;
    --border-color: #333;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2rem;
    min-height: 100vh;
    background-image: radial-gradient(
        circle at 50% 0%,
        rgba(163, 255, 0, 0.08) 0%,
        transparent 70%
    );
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- App Container --- */
.app-container {
    width: 100%;
    max-width: 1400px;
    padding: 2.5rem;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(163, 255, 0, 0.1);
    margin: 2rem;
}

/* --- Header --- */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 1rem;
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 800;
    box-shadow: 0 0 15px var(--primary-glow);
    line-height: 1.4;
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--primary-glow);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: 0.4rem;
}

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(163, 255, 0, 0.05);
    box-shadow: 0 0 40px rgba(163, 255, 0, 0.1) inset;
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    pointer-events: none;
}

.drop-content p {
    font-size: 1.2rem;
    font-weight: 600;
}

.drop-content svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 15px var(--primary-glow));
    transition: var(--transition);
}

.drop-zone:hover .drop-content svg {
    transform: translateY(-10px) scale(1.1);
}

.drop-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Editor Layout --- */
.editor {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    position: relative;
    align-items: flex-start;
    animation: fadeIn 0.4s ease;
}

/* --- Sidebar --- */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 780px;
}

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

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-actions {
    display: flex;
    gap: 0.4rem;
}

.count-badge {
    font-size: 0.75rem;
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-weight: 800;
    min-width: 24px;
    text-align: center;
    display: inline-block;
    line-height: 1.4;
}

/* --- Buttons --- */
.btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-color);
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.btn-small {
    padding: 0.4rem;
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: 'Outfit', sans-serif;
}

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

.btn-danger-subtle {
    color: var(--danger-color);
}

.btn-danger-subtle:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(163, 255, 0, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.9rem;
    gap: 0.5rem;
    box-shadow: 0 0 20px var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: 'Outfit', sans-serif;
}

.btn-primary:hover {
    box-shadow: 0 0 35px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* --- File List --- */
.file-list {
    list-style: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.5rem;
    flex-grow: 1;
    scroll-behavior: smooth;
}

.file-list::-webkit-scrollbar { width: 6px; }
.file-list::-webkit-scrollbar-track { background: transparent; }
.file-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.file-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.file-list { scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }

/* --- File Item --- */
.file-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface-light);
    border: 1px solid transparent;
    position: relative;
    animation: fileItemIn 0.3s ease both;
}

.file-item:hover { border-color: rgba(163, 255, 0, 0.3); }
.file-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(163, 255, 0, 0.1);
}
.file-item.done {
    opacity: 0.55;
}
.file-item.done .savings-pill {
    display: inline-block;
}

/* Checkbox */
.file-item input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
    background: transparent;
}
.file-item input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}
.file-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 4px;
    height: 9px;
    border: solid var(--bg-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Thumbnail */
.file-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* File info */
.file-details {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
    font-weight: 500;
    display: block;
}

.file-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.format-tag {
    font-size: 0.6rem;
    background: rgba(163, 255, 0, 0.15);
    color: var(--primary-color);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1.4;
}

.savings-pill {
    display: none;
    font-size: 0.6rem;
    background: rgba(163, 255, 0, 0.2);
    color: var(--primary-color);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 800;
    line-height: 1.4;
}

/* Delete button */
.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
    opacity: 0;
    font-family: 'Outfit', sans-serif;
}
.file-item:hover .btn-delete { opacity: 1; }
.btn-delete:hover {
    color: var(--danger-color);
    background: rgba(255, 68, 68, 0.1);
}

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}

/* --- Main Editor --- */
.main-editor {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* ============================================================
   COMPARISON PANEL
   ============================================================ */
.compare-container {
    background: var(--surface-light);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Before / After labels */
.compare-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.compare-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.label-after {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(163, 255, 0, 0.4);
}

.savings-badge {
    font-size: 0.7rem;
    background: rgba(163, 255, 0, 0.2);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-weight: 800;
    animation: pulseGreen 2s infinite;
}

/* Compare wrapper — the split-view area */
.compare-wrapper {
    width: 100%;
    height: 360px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background:
        repeating-conic-gradient(
            rgba(255, 255, 255, 0.03) 0% 25%,
            transparent 0% 50%
        ) 50% / 20px 20px;
    user-select: none;
}

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

.compare-side canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    image-rendering: auto;
}

/* After side is clipped by the divider */
.side-after {
    clip-path: inset(0 0 0 50%);
    transition: clip-path 0s; /* instant while dragging */
}

/* Divider line */
.compare-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 10;
}

.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: 0 0 20px var(--primary-glow);
    color: var(--bg-color);
    cursor: ew-resize;
}

/* Empty state overlay */
.compare-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.compare-empty svg {
    opacity: 0.3;
}

.compare-empty p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Hide empty state when image loaded */
.compare-wrapper.has-image .compare-empty {
    display: none;
}

/* View mode: single before / after */
.compare-wrapper.view-before .side-after,
.compare-wrapper.view-before .compare-divider {
    display: none;
}
.compare-wrapper.view-before .side-before {
    clip-path: none;
}

.compare-wrapper.view-after .side-before,
.compare-wrapper.view-after .compare-divider {
    display: none;
}
.compare-wrapper.view-after .side-after {
    clip-path: none !important;
}

/* Preview bar */
.preview-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.image-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.info-text {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-text svg { opacity: 0.6; }

.preview-bar .format-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

/* View toggle buttons */
.view-toggle {
    display: flex;
    gap: 0.4rem;
    background: var(--surface-color);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.view-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 0.4rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.view-btn.active {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 12px var(--primary-glow);
}

.view-btn:hover:not(.active) {
    color: var(--text-color);
    background: rgba(255,255,255,0.05);
}

/* ============================================================
   COMPRESSION SETTINGS PANEL
   ============================================================ */
.compression-panel {
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.compression-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.pro-col {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pro-col > label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.slider-header label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slider-header span {
    color: var(--primary-color);
}

/* PNG = lossless — show styled badge in place of the % number */
#quality-col.is-lossless #quality-label {
    font-size: 0.7rem;
    background: rgba(163, 255, 0, 0.15);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- Pro Select --- */
.pro-select {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888899' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
}

.pro-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(163, 255, 0, 0.15);
}

.pro-select option {
    background: var(--surface-color);
    color: var(--text-color);
}

/* --- Pro Slider --- */
.pro-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    height: 4px;
    cursor: pointer;
    width: 100%;
}

.pro-slider:focus { outline: none; }

.pro-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

.pro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--primary-glow);
    border: none;
    transition: box-shadow 0.2s ease;
}

.pro-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 18px var(--primary-glow);
}

.pro-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    border: none;
}

.pro-slider::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    border: none;
}

/* --- Custom Resize Row --- */
.resize-custom {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    justify-content: center;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-light);
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(163, 255, 0, 0.1);
}

.input-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    user-select: none;
}

.size-input {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    width: 70px;
    outline: none;
    font-variant-numeric: tabular-nums;
}

.size-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.btn-lock {
    padding: 0.5rem;
    border-radius: 10px;
    background: var(--surface-light);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
}

.btn-lock.active {
    color: var(--primary-color);
    border-color: rgba(163, 255, 0, 0.3);
    box-shadow: 0 0 8px rgba(163, 255, 0, 0.1);
}

.btn-lock:hover { background: rgba(163, 255, 0, 0.1); }

/* --- Advanced Options Row --- */
.advanced-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.pro-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    user-select: none;
}

.pro-checkbox:hover { color: var(--text-color); }

.pro-checkbox input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* --- ZIP Toggle --- */
.zip-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
    user-select: none;
    white-space: nowrap;
}

.zip-toggle:hover {
    border-color: rgba(163, 255, 0, 0.3);
    color: var(--text-color);
}

.zip-toggle input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
    background: transparent;
}

.zip-toggle input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-glow);
}

.zip-toggle input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 4px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.zip-toggle:has(input:checked) {
    border-color: rgba(163, 255, 0, 0.3);
    color: var(--primary-color);
    background: rgba(163, 255, 0, 0.05);
}

/* --- Export Actions --- */
.export-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* --- Progress Bar --- */
.progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-info span:first-child { color: var(--text-muted); }
.progress-info span:last-child { color: var(--primary-color); }

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #c8ff50);
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* ============================================================
   STATS PANEL
   ============================================================ */
.stats-panel {
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid rgba(163, 255, 0, 0.2);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: space-around;
    animation: fadeIn 0.5s ease;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.stat-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.stat-highlight svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 32px;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px var(--primary-glow);
}

#loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* --- Privacy Footer --- */
.privacy-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.privacy-footer svg {
    color: var(--primary-color);
    opacity: 0.7;
}

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

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

@keyframes fileItemIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(163, 255, 0, 0.3); }
    50%       { box-shadow: 0 0 0 6px rgba(163, 255, 0, 0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .editor { flex-direction: column; }
    .sidebar { width: 100%; max-height: 280px; }
    .compression-options { grid-template-columns: 1fr; }
    .export-actions { flex-direction: column; align-items: stretch; }
    .preview-bar { flex-direction: column; align-items: flex-start; }
    .stats-panel { flex-wrap: wrap; gap: 1rem; }
    .stat-divider { display: none; }
}

@media (max-width: 600px) {
    .app-container { padding: 1.2rem; border-radius: 20px; margin: 1rem; }
    h1 { font-size: 1.8rem; }
    .compare-wrapper { height: 250px; }
    .drop-zone { padding: 3rem 1.2rem; }
    .resize-custom { flex-direction: column; gap: 0.8rem; }
    .advanced-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}
