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

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d3a;
    --text: #e4e4e7;
    --text-muted: #9ca3af;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --accent: #8b5cf6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────── */
header {
    text-align: center;
    padding: 2rem 1rem 1rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lock-icon {
    font-size: 2rem;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.25rem;
}

.privacy-banner {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.25rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 2rem;
    font-size: 0.85rem;
    color: var(--success);
}

.shield {
    margin-right: 0.25rem;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 0.6rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text);
    background: var(--surface);
}

.tab.active {
    color: var(--primary);
    background: var(--surface);
    font-weight: 600;
}

/* ── Main ────────────────────────────────────────────────────── */
main {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    width: 100%;
}

.tab-content {
    display: none;
}

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

/* ── Drop Zone ───────────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

.drop-zone.small {
    padding: 2rem 1rem;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.drop-zone.loaded {
    border-color: var(--success);
    border-style: solid;
    background: rgba(34, 197, 94, 0.05);
}

.drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
}

.drop-zone .hint {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ── Two Column Layout ───────────────────────────────────────── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.two-col h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

@media (max-width: 600px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

/* ── Options ─────────────────────────────────────────────────── */
.options {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.options input[type="checkbox"] {
    accent-color: var(--primary);
    width: 1.1em;
    height: 1.1em;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0.25rem;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--accent);
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #7c3aed;
}

.download-buttons {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ── Status Messages ─────────────────────────────────────────── */
.status {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.status.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary);
}

.status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.status.loading {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* ── Results ─────────────────────────────────────────────────── */
.result-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    min-width: 140px;
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.warning {
    color: var(--warning);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ── Validate Results ────────────────────────────────────────── */
.validate-ok {
    color: var(--success);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.validate-fail {
    color: var(--danger);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.columns-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.columns-table th,
.columns-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.columns-table th {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.transform-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.transform-badge.hash { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.transform-badge.offset { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.transform-badge.scale { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.transform-badge.shuffle { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.transform-badge.keep { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }
.transform-badge.anonymize { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
