/* PixiConvert — Modern dark design system */

/* Self-hosted Inter font (no Google Fonts dependency) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/inter-latin-400.dd05e326cf.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/static/fonts/inter-latin-500.b0e7558f47.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/static/fonts/inter-latin-600.62553d1591.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/static/fonts/inter-latin-700.aac638f750.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Core palette — true gray dark */
    --bg-body: #09090b;
    --bg-dark: #0a0a0c;
    --bg-mid: #111113;
    --bg-card: #16161a;
    --bg-elevated: #1c1c21;
    --bg-input: #111113;
    --bg-hover: #1e1e23;

    --border: #27272a;
    --border-light: #3f3f46;
    --border-accent: rgba(124, 58, 237, 0.3);

    /* Accent — purple-blue gradient */
    --accent-purple: #7c3aed;
    --accent-blue: #3b82f6;
    --accent-light: #8b5cf6;
    --accent-glow: rgba(124, 58, 237, 0.25);
    --accent-glow-blue: rgba(59, 130, 246, 0.2);

    /* Text */
    --text: #fafafa;
    --text-secondary: #c8c8d0;
    --text-muted: #9898a4;
    --text-dim: #7e7e8a;

    /* Status */
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Misc */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-full: 9999px;
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;

    /* Glass */
    --glass-bg: rgba(22, 22, 26, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: 16px;
}

html {
    font-size: 15px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #a78bfa;
    text-decoration: underline;
}

/* Gradient mesh orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 600px;
    height: 600px;
    background: var(--accent-purple);
    top: -200px;
    right: -150px;
}

body::after {
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    bottom: -100px;
    left: -150px;
}

/* ===== HEADER — sticky with glass ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 0 24px var(--accent-glow);
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trust-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: border-color var(--transition);
}

.badge:hover {
    border-color: var(--border-light);
}

.badge-icon {
    font-size: 0.8rem;
}

/* ===== MAIN LAYOUT ===== */
.main {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== DROP ZONE ===== */
.drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-glow) 0%, var(--accent-glow-blue) 100%);
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-light);
    background: var(--bg-elevated);
}

.drop-zone:hover::before,
.drop-zone.dragover::before {
    opacity: 1;
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.drop-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.drop-zone h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.drop-zone p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ===== SETTINGS — glass card ===== */
.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
}

.setting-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    transition: border-color var(--transition);
}

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

.setting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.setting-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 40px;
    height: 22px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 22px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: white;
}

/* Inputs */
.setting-fields {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.field-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.field-row label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 32px;
}

input[type="number"],
select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    padding: 0.45rem 0.6rem;
    font-size: 0.82rem;
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1aa'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 1.8rem;
}

/* ===== HOME SECTIONS (trust, how-it-works, comparison) ===== */
.trust-section {
    margin-top: 0.5rem;
}

.home-section {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
}

.home-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.6rem;
}

/* ===== FILE LIST ===== */
.file-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-count {
    font-size: 0.72rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: white;
    padding: 0.12rem 0.55rem;
    border-radius: var(--radius-full);
}

#empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.file-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== FILE CARD — expandable ===== */
.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    animation: fadeIn 0.25s ease;
    overflow: hidden;
}

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

.file-card.status-done {
    border-left: 3px solid var(--success);
}

.file-card.status-processing {
    border-left: 3px solid var(--accent-light);
}

.file-card.status-error {
    border-left: 3px solid var(--error);
}

.file-card-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
}

.file-card-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-dark);
}

.file-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-elevated);
}

.file-card-info {
    flex: 1;
    min-width: 0;
}

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

.file-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    flex-wrap: wrap;
}

.arrow {
    color: var(--text-muted);
}

.file-size-result {
    font-weight: 600;
}

.savings {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.08rem 0.4rem;
    border-radius: var(--radius-full);
}

.savings-positive {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.savings-negative {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.file-dims {
    color: var(--text-dim);
    font-size: 0.7rem;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-done .status-dot {
    background: var(--success);
}

.status-processing .status-dot {
    background: var(--accent-light);
    animation: pulse 1s infinite;
}

.status-error .status-dot {
    background: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.error-msg {
    color: var(--error);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent-purple);
    color: var(--text);
}

.btn-icon.btn-gear {
    font-size: 1rem;
}

.btn-icon.btn-gear.active {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--accent-purple);
    color: var(--accent-light);
}

/* ===== FILE SETTINGS PANEL (expandable) ===== */
.file-settings {
    border-top: 1px solid var(--border);
    background: var(--bg-mid);
    padding: 1rem 1.2rem;
    display: none;
}

.file-card.expanded .file-settings {
    display: block;
}

.file-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

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

.file-setting-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-setting-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.file-setting-row label {
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 22px;
}

.file-setting-row input[type="number"] {
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
}

.file-setting-row select {
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
}

/* Compression mode toggle (Auto / Manual) */
.compression-toggle {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.compression-toggle button {
    flex: 1;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.compression-toggle button.active {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: white;
}

/* Per-file transparency toggle */
.transparency-toggle {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.transparency-toggle button {
    flex: 1;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.transparency-toggle button.active {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: white;
}

/* Global transparency hint */
.transparency-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Per-file quality slider */
.file-quality-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

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

.file-quality-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.file-quality-value {
    font-weight: 600;
    color: var(--accent-light);
    font-size: 0.78rem;
}

/* Range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: transform var(--transition);
}

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

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--accent-glow);
}

.file-quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* ===== ACTION BAR ===== */
.action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.55rem 1.3rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: white;
    box-shadow: 0 2px 16px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

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

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-danger {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.btn-danger:hover {
    color: var(--error);
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.08);
}

/* Progress bar */
.progress-bar {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.progress-track {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.7;
}

.footer a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition);
}

.footer a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* ===== PRIVACY PAGE ===== */
.privacy-page {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.privacy-page h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.privacy-page .privacy-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 2.5rem;
}

.privacy-section {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1rem;
}

.privacy-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.privacy-section p,
.privacy-section ul {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.privacy-section ul {
    padding-left: 1.2rem;
    margin-top: 0.4rem;
}

.privacy-section ul li {
    margin-bottom: 0.25rem;
}

.privacy-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-light);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: color var(--transition);
}

.privacy-back:hover {
    color: var(--text);
}

/* Privacy hero with animated shield */
.privacy-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.privacy-hero h2 {
    margin-bottom: 0.4rem;
}

.shield-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.shield {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shield-icon {
    position: relative;
    z-index: 2;
    animation: shieldFloat 3s ease-in-out infinite;
}

@keyframes shieldFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.shield-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shield-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--accent-purple);
    opacity: 0;
    animation: ringPulse 3s ease-out infinite;
}

.ring-1 {
    width: 60px;
    height: 60px;
    animation-delay: 0s;
}

.ring-2 {
    width: 90px;
    height: 90px;
    animation-delay: 0.6s;
}

.ring-3 {
    width: 120px;
    height: 120px;
    animation-delay: 1.2s;
}

@keyframes ringPulse {
    0% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(1.3); }
}

/* Zero Knowledge Badges */
.zero-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.zero-badge {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.4rem 1rem;
    text-align: center;
    transition: border-color var(--transition), transform var(--transition);
}

.zero-badge:hover {
    border-color: rgba(34, 197, 94, 0.3);
    transform: translateY(-2px);
}

.zero-badge-icon {
    position: relative;
    display: inline-flex;
    margin-bottom: 0.75rem;
}

.zero-badge-x {
    position: absolute;
    bottom: -4px;
    right: -8px;
    background: var(--bg-card);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zero-badge-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.zero-badge-desc {
    font-size: 0.73rem;
    color: var(--text-muted);
}

/* How It Works diagram */
.how-it-works {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.2rem 0;
    flex-wrap: wrap;
}

.hiw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 120px;
    max-width: 180px;
    position: relative;
}

.hiw-icon {
    width: 56px;
    height: 56px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
}

.hiw-num {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-light);
    background: rgba(124, 58, 237, 0.15);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.3rem;
}

.hiw-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.hiw-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.hiw-arrow {
    display: flex;
    align-items: center;
    padding-top: 1rem;
}

.hiw-browser-box {
    margin-top: 0.8rem;
    padding: 0.5rem;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    text-align: center;
}

.hiw-browser-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* Data Flow Diagram */
.dataflow {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.8rem;
}

.dataflow-browser {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-dark);
}

.dataflow-browser-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.dataflow-dots {
    display: flex;
    gap: 5px;
}

.dataflow-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-light);
}

.dataflow-dots span:first-child { background: #ef4444; }
.dataflow-dots span:nth-child(2) { background: #f59e0b; }
.dataflow-dots span:last-child { background: #22c55e; }

.dataflow-browser-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dataflow-pipeline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 1.2rem 1rem;
    overflow-x: auto;
    justify-content: center;
    flex-wrap: wrap;
}

.df-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 80px;
}

.df-node-output {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.05);
}

.df-node-icon {
    font-size: 1.2rem;
}

.df-node-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: center;
}

.df-arrow {
    color: var(--accent-light);
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dataflow-server {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    opacity: 0.85;
}

.dataflow-server-icon {
    flex-shrink: 0;
}

.dataflow-server-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dataflow-server-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-left: auto;
}

/* Comparison table */
.compare-table-wrap {
    overflow-x: auto;
    margin-top: 0.6rem;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.compare-table th,
.compare-table td {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.compare-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.compare-table th.compare-us {
    color: var(--accent-light);
}

.compare-table td:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.compare-table td.compare-us {
    background: rgba(124, 58, 237, 0.04);
}

.compare-good {
    color: var(--success);
    font-weight: 600;
}

.compare-bad {
    color: var(--text-muted);
}

/* Verify it yourself */
.verify-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.8rem;
}

.verify-step {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.verify-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.verify-step strong {
    color: var(--text);
    font-size: 0.85rem;
}

.verify-step p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* FAQ accordion */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}

.faq-item:hover {
    border-color: var(--border-light);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition);
}

.faq-question:hover {
    background: var(--bg-elevated);
}

.faq-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.faq-item.open .faq-chevron {
    transform: rotate(90deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 200px;
    padding: 0 1rem 0.8rem 1rem;
}

.faq-answer p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-top: 0.4rem;
}

/* Changelog */
.privacy-changelog {
    border-left: 3px solid var(--accent-purple);
}

.changelog-entries {
    margin-top: 0.5rem;
}

.changelog-entry {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.4rem 0;
}

.changelog-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-light);
    white-space: nowrap;
    min-width: 90px;
}

.changelog-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== CROP PREVIEW ===== */
.crop-toggle {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.crop-toggle button {
    flex: 1;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.crop-toggle button.active {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: white;
}

.crop-preview {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-dark);
    max-width: 200px;
    margin-top: 0.5rem;
    cursor: grab;
}

.crop-preview:active {
    cursor: grabbing;
}

.crop-preview img {
    position: absolute;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.crop-hint {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* ===== LIGHT THEME ===== */
body.light-theme {
    --bg-body: #f5f5f7;
    --bg-dark: #e8e8ec;
    --bg-mid: #ebebef;
    --bg-card: #ffffff;
    --bg-elevated: #f0f0f4;
    --bg-input: #ffffff;
    --bg-hover: #e5e5ea;

    --border: #d1d1d6;
    --border-light: #b0b0b8;
    --border-accent: rgba(124, 58, 237, 0.25);

    --text: #1c1c1e;
    --text-secondary: #48484a;
    --text-muted: #8e8e93;
    --text-dim: #aeaeb2;

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
}

body.light-theme::before,
body.light-theme::after {
    opacity: 0.06;
}

/* ===== TRANSFORM CONTROLS ===== */
.transform-controls {
    display: flex;
    gap: 0.3rem;
}

.transform-controls .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
}

.transform-info {
    font-size: 0.68rem;
    color: var(--accent-light);
    margin-top: 0.2rem;
}

/* ===== FILE ACTIONS ROW ===== */
.file-actions-row {
    display: flex;
    gap: 0.4rem;
}

.btn-small {
    padding: 0.3rem 0.7rem;
    font-size: 0.72rem;
    border-radius: var(--radius-xs);
}

.btn-apply-all {
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid var(--border-accent);
    color: var(--accent-light);
}

.btn-apply-all:hover {
    background: rgba(124, 58, 237, 0.25);
}

.btn-reset-settings {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-reset-settings:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ===== BEFORE/AFTER COMPARE ===== */
.compare-overlay {
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
    padding: 0.75rem 1rem;
}

.compare-container {
    display: flex;
    gap: 0.75rem;
}

.compare-side {
    flex: 1;
    text-align: center;
}

.compare-side img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.compare-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.compare-size {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ===== EXIF BADGE ===== */
.exif-info {
    margin-top: 0.4rem;
}

.exif-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.68rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-full);
    color: var(--warning);
}

/* ===== DRAG HANDLE & SORTING ===== */
.drag-handle {
    width: 28px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    cursor: grab;
    font-size: 0.9rem;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
    user-select: none;
}

.drag-handle:hover {
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.drag-handle:active {
    cursor: grabbing;
}

.file-card.dragging {
    opacity: 0.4;
}

.file-card.drag-over-top {
    border-top: 2px solid var(--accent-purple);
}

.file-card.drag-over-bottom {
    border-bottom: 2px solid var(--accent-purple);
}

/* ===== PER-FILE PROGRESS ===== */
.file-progress {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 0.25rem;
    overflow: hidden;
}

.file-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    border-radius: 2px;
    transition: width 0.15s ease;
}

/* ===== RATIO LOCK ===== */
.ratio-lock-row {
    display: flex;
    justify-content: center;
    margin: -0.15rem 0;
}

.btn-ratio-lock {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    transition: all var(--transition);
}

.btn-ratio-lock.active {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-light);
}

/* ===== TEXT INPUT ===== */
.text-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    padding: 0.45rem 0.6rem;
    font-size: 0.82rem;
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    cursor: pointer;
}

.range-val {
    font-size: 0.75rem;
    color: var(--accent-light);
    font-weight: 600;
    min-width: 28px;
    text-align: right;
}

.field-hint {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

/* ===== THEME TOGGLE IN HEADER ===== */
#btn-theme {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

#btn-theme:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
    color: var(--text);
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 300px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .header {
        padding: 0.75rem 1rem;
        justify-content: center;
        text-align: center;
    }

    .trust-badges {
        justify-content: center;
    }

    .main {
        padding: 1.25rem 1rem;
    }

    .drop-zone {
        padding: 2rem 1.25rem;
    }

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

    .file-card-main {
        flex-wrap: wrap;
    }

    .file-settings-grid {
        grid-template-columns: 1fr !important;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .progress-bar {
        min-width: unset;
    }

    .privacy-page {
        padding: 1.5rem 1rem;
    }

    .zero-badges {
        grid-template-columns: 1fr;
    }

    .how-it-works {
        flex-direction: column;
        align-items: center;
    }

    .hiw-arrow {
        transform: rotate(90deg);
        padding-top: 0;
    }

    .hiw-step {
        max-width: none;
    }

    .dataflow-pipeline {
        justify-content: flex-start;
    }

    .compare-table {
        font-size: 0.75rem;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}
