:root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f232c;
    --border: #2a2f3a;
    --text: #e8eaed;
    --text-dim: #9aa1ac;
    --accent: #5b8cff;
    --accent-hover: #4a76e0;
    --danger: #ef5a6f;
    --danger-hover: #d84a5e;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
}

.logo {
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
}

.stats {
    color: var(--text-dim);
    font-size: 14px;
}

.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

.back-link {
    display: inline-block;
    color: var(--text-dim);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 14px;
}
.back-link:hover { color: var(--text); }

/* Uploader / dropzone */
.uploader {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--surface);
    margin-bottom: 28px;
}
.uploader:hover, .uploader.dragover {
    border-color: var(--accent);
    background: var(--surface-2);
}
.uploader-icon { font-size: 32px; margin-bottom: 8px; }
.uploader-inner p { margin: 4px 0; }
.uploader-hint { color: var(--text-dim); font-size: 13px; }

.upload-progress {
    margin-top: 18px;
    background: var(--surface-2);
    border-radius: 8px;
    height: 24px;
    position: relative;
    overflow: hidden;
}
.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width .15s ease;
}
.upload-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text);
}

#uploadResult { margin-bottom: 16px; }
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}
.alert-error { background: rgba(239,90,111,0.12); color: var(--danger); border: 1px solid rgba(239,90,111,0.3); }
.alert-success { background: rgba(91,140,255,0.12); color: var(--accent); border: 1px solid rgba(91,140,255,0.3); }

/* File list */
.file-list { display: flex; flex-direction: column; gap: 10px; }

.file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.file-row-icon { font-size: 26px; flex-shrink: 0; }
.file-row-info { flex: 1; min-width: 0; }
.file-row-name {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-row-name:hover { color: var(--accent); }
.file-row-meta { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.short-code { color: var(--accent); font-family: monospace; }

.file-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.empty-state {
    color: var(--text-dim);
    text-align: center;
    padding: 30px 0;
}

/* Buttons */
.btn {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn-small { padding: 6px 10px; font-size: 13px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(239,90,111,0.12); border-color: var(--danger); }

/* Single file page */
.file-page {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px;
    text-align: center;
}
.file-page-icon { font-size: 48px; margin-bottom: 10px; }
.file-page-name { font-size: 20px; margin: 0 0 6px; word-break: break-word; }
.file-page-meta { color: var(--text-dim); font-size: 13px; display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }

.file-preview { margin: 16px 0; }
.file-preview img {
    max-width: 100%;
    max-height: 420px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.short-link-box {
    display: flex;
    gap: 8px;
    max-width: 420px;
    margin: 0 auto 22px;
}
.short-link-box input {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: monospace;
}

.file-page-actions { display: flex; gap: 10px; justify-content: center; }

@media (max-width: 480px) {
    .file-page-actions, .short-link-box { flex-direction: column; }
}
