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

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #222632;
    --border: #2a2e3b;
    --text: #e4e5e9;
    --text-muted: #8b8fa3;
    --primary: #6366f1;
    --primary-hover: #5457e5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --green: #22c55e;
    --orange: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
}

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

/* Layout */
.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.page-dashboard {
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Login */
.login-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-icon {
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

input[type="password"],
input[type="text"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: #fff;
}

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

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }

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

.btn-full { width: 100%; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-xs { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

/* Top bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.topbar-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

/* Upload Zone */
.upload-card { padding: 0; overflow: hidden; }

.drop-zone {
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.drop-zone.drag-over {
    background: rgba(99, 102, 241, 0.08);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.drop-zone-content .link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

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

.drop-zone-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.file-name {
    font-weight: 500;
    word-break: break-all;
    max-width: 100%;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
}

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

.drop-zone-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.done-text {
    font-weight: 600;
    color: var(--green);
}

.link-box {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 500px;
}

.link-box input {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.upload-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-options select {
    width: auto;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

/* Table */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

.cell-name {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expired-row { opacity: 0.5; }

/* Badge */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-red { background: rgba(239,68,68,0.15); color: var(--danger); }

/* Download Page */
.download-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.download-icon { color: var(--primary); margin-bottom: 1rem; }

.file-title {
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.file-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.file-meta .sep { margin: 0 0.4rem; }

/* Status pages */
.status-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.status-icon { margin-bottom: 1rem; }
.status-expired { color: var(--orange); }
.status-deleted { color: var(--danger); }

.status-card h1 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.status-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Misc */
.powered-by {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.alert {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.alert-error {
    background: rgba(239,68,68,0.12);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.25);
}

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

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .card { padding: 1rem; }
    .drop-zone { padding: 1.5rem 1rem; }
    .cell-name { max-width: 150px; }
}
