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

:root {
    --bg:          #0a0a0b;
    --bg-card:     #141416;
    --bg-hover:    #1a1a1e;
    --border:      #2a2a2e;
    --text:        #e4e4e7;
    --text-muted:  #71717a;
    --text-dim:    #52525b;
    --accent:      #6366f1;
    --accent-hover:#818cf8;
    --accent-glow: rgba(99,102,241,0.15);
    --success:     #22c55e;
    --success-bg:  rgba(34,197,94,0.1);
    --warning:     #eab308;
    --warning-bg:  rgba(234,179,8,0.1);
    --danger:      #ef4444;
    --radius:      10px;
    --radius-sm:   6px;
    --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --mono:        "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
}

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

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

/* ── Layout ─────────────────────────────────────────────── */
.app {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.header {
    padding: 40px 0 32px;
    text-align: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
}
a.logo:hover { color: var(--accent-hover); }

.tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

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

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-accent { border-color: var(--accent); background: linear-gradient(135deg, var(--accent-glow), transparent); }
.card-success { border-color: var(--success); text-align: center; }

/* ── Upload Zone ────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.upload-icon { color: var(--text-muted); margin-bottom: 16px; }
.upload-text { font-size: 1.05rem; font-weight: 500; margin-bottom: 4px; }
.upload-hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 20px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: var(--font);
    text-decoration: none;
}

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

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

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

.btn-block { display: flex; justify-content: center; width: 100%; }

/* ── Progress ───────────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.2s ease;
}
.progress-fill.success { background: var(--success); }

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.overall-progress {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ── File Progress Items ────────────────────────────────── */
.file-progress-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.file-progress-item:last-child { border-bottom: none; }

.file-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.file-progress-name {
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.file-progress-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-progress-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.file-progress-status.complete { color: var(--success); }
.file-progress-status.error { color: var(--danger); }

/* ── Share Link ─────────────────────────────────────────── */
.share-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.share-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.share-link-box code {
    flex: 1;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--accent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-feedback {
    font-size: 0.8rem;
    color: var(--success);
    margin-top: 4px;
    display: block;
    min-height: 1.2em;
}

/* ── Success ────────────────────────────────────────────── */
.success-icon { color: var(--success); margin-bottom: 12px; }
.success-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

#success-area h2 { margin-bottom: 4px; }
#success-area p { color: var(--text-muted); font-size: 0.9rem; }

/* ── File Meta ──────────────────────────────────────────── */
.file-meta, .share-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.meta-row:last-child { border-bottom: none; }

.meta-label { color: var(--text-muted); }
.meta-value { font-weight: 500; text-align: right; max-width: 60%; overflow-wrap: break-word; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

/* ── Share Actions ──────────────────────────────────────── */
.share-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ── Files List ─────────────────────────────────────────── */
.files-list { display: flex; flex-direction: column; gap: 8px; }

.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.file-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon { font-size: 1.5rem; flex-shrink: 0; }

.file-card-details { flex: 1; min-width: 0; }
.file-card-name {
    font-weight: 500;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.file-card-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resume-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.resume-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Resume Section (download page) ─────────────────────── */
.resume-info {
    background: var(--warning-bg);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--warning);
}

#resume-progress { margin-top: 16px; }
#download-actions { margin-top: 16px; }
#resume-section { margin-top: 16px; }

/* ── Error ──────────────────────────────────────────────── */
.error-message {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 16px;
}

/* ── Empty / Loading ────────────────────────────────────── */
.empty-state, .loading {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .app { padding: 0 12px 40px; }
    .header { padding: 24px 0 20px; }
    .card { padding: 16px; }
    .upload-zone { padding: 32px 16px; }
    .file-card-info { flex-wrap: wrap; }
    .success-actions { flex-direction: column; }
    .success-actions .btn { width: 100%; justify-content: center; }
}
