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

:root {
  --bg:       #d6eaf0;
  --surface:  #c2dce6;
  --card:     #ffffff;
  --border:   #a8cdd9;
  --text:     #2a2a2a;
  --muted:    #6a8a96;
  --accent:   #4a9eb5;
  --accent-h: #3a8da3;
  --btn-bg:   #7ec8da;
  --btn-text: #1a5a6a;
  --success:  #2e9e6e;
  --danger:   #c0392b;
  --radius:   8px;
  --font:     Georgia, 'Times New Roman', serif;
  --mono:     'Courier New', monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── PAGE ────────────────────────────────────────────────────────────────── */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  text-align: center;
}

/* ── LOGO ────────────────────────────────────────────────────────────────── */
.logo-area { margin-bottom: 24px; }
.logo-box {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.logo-icon {
  font-size: 52px;
  color: var(--accent);
}
.logo-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.logo-name {
  font-size: 36px;
  font-weight: bold;
  color: var(--text);
  line-height: 1;
}
.logo-sub {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
}

/* ── DESCRIPTION ─────────────────────────────────────────────────────────── */
.description {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 28px;
  line-height: 1.7;
}
.description strong { color: var(--accent); }

/* ── UPLOAD FORM ─────────────────────────────────────────────────────────── */
.upload-form {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  text-align: left;
}

/* Form Row */
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.form-row label {
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  font-family: var(--font);
}
.expiry-group { display: flex; gap: 6px; flex-wrap: wrap; }
.expiry-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--btn-text);
  font-family: var(--font);
  cursor: pointer;
  transition: all .15s;
}
.expiry-btn:hover { border-color: var(--accent); }
.expiry-btn.active {
  background: var(--btn-bg);
  border-color: var(--accent);
  color: var(--btn-text);
  font-weight: bold;
}

/* Drop Zone */
.drop-zone {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #e8f4f8;
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 16px;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: #d8eef5;
}
.drop-text {
  color: var(--accent);
  font-size: 16px;
  font-family: var(--font);
}

/* Preview */
.preview-wrap {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.preview-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.preview-thumb {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
}
.preview-icon-box {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--muted);
}
.preview-info { padding: 6px 8px; }
.preview-fname {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  font-family: var(--mono);
}
.preview-fsize { font-size: 10px; color: var(--muted); font-family: var(--mono); }

/* Upload Button */
.btn-upload {
  width: 100%;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s;
}
.btn-upload:hover:not(:disabled) { background: var(--accent); color: #fff; }
.btn-upload:disabled { opacity: .45; cursor: not-allowed; }

/* ── PROGRESS ────────────────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  text-align: left;
}
.progress-bar {
  background: var(--surface);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width .2s;
}
.progress-info { display: flex; justify-content: space-between; }
#progress-text { font-size: 13px; color: var(--muted); font-family: var(--mono); }
#progress-pct { font-size: 13px; font-weight: bold; color: var(--accent); font-family: var(--mono); }

/* ── RESULT ──────────────────────────────────────────────────────────────── */
#upload-result {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  text-align: left;
}
.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.result-check { font-size: 20px; color: var(--success); }
.result-header h2 { font-size: 17px; }
.result-item {
  background: #f0f8fb;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.result-fname { font-size: 14px; font-weight: bold; display: block; margin-bottom: 4px; font-family: var(--mono); }
.result-fmeta { font-size: 12px; color: var(--muted); font-family: var(--mono); display: block; margin-bottom: 10px; }
.result-link-row { display: flex; gap: 6px; }
.result-input {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  min-width: 0;
}
.btn-copy-sm, .btn-view-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.btn-copy-sm:hover, .btn-view-sm:hover { border-color: var(--accent); color: var(--accent); }
.result-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color .15s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── HISTORY ─────────────────────────────────────────────────────────────── */
.history-section { margin: 20px 0; text-align: left; }
.section-label {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 8px;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 5px;
  gap: 10px;
}
.history-info { flex: 1; min-width: 0; }
.history-name {
  font-size: 13px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-bottom: 1px;
}
.history-meta { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.history-actions { display: flex; gap: 4px; }
.btn-icon {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .15s;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.btn-icon:hover { color: var(--accent); text-decoration: none; }
.history-empty { font-size: 13px; color: var(--muted); font-family: var(--mono); padding: 10px 0; }

/* ── FOOTER LINKS ────────────────────────────────────────────────────────── */
.footer-links {
  margin: 20px 0 16px;
  font-size: 14px;
  color: var(--muted);
}
.footer-links a { color: var(--accent); margin: 0 4px; }

/* ── DONATION ────────────────────────────────────────────────────────────── */
.donation-box {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 8px;
}
.donation-box > p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 14px;
}
.donation-bar-wrap { margin-top: 4px; }
.donation-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  height: 18px;
  overflow: hidden;
  margin-bottom: 6px;
}
.donation-fill {
  height: 100%;
  background: linear-gradient(90deg, #0070ba, #00b4ff);
  border-radius: 99px;
  transition: width .3s;
}
.donation-meta {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
  text-align: center;
}
.donation-raised { color: var(--accent); font-weight: bold; }

/* ── FILE PAGE ───────────────────────────────────────────────────────────── */
.page-file { max-width: 560px; margin: 0 auto; padding: 40px 20px; }
.file-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.file-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.file-icon-big {
  width: 48px; height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--accent); flex-shrink: 0;
}
.file-info h1 { font-size: 18px; margin-bottom: 8px; word-break: break-all; }
.file-meta { display: flex; flex-wrap: wrap; gap: 12px; }
.file-meta span { font-size: 13px; color: var(--muted); font-family: var(--mono); display: flex; align-items: center; gap: 5px; }
.file-meta strong { color: var(--accent); }
.file-countdown {
  background: #f0f8fb;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.countdown-label { font-size: 13px; color: var(--muted); }
.countdown-value { font-family: var(--mono); font-size: 15px; font-weight: bold; color: var(--accent); }
.file-preview { margin-bottom: 18px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.file-preview img { max-width: 100%; max-height: 460px; object-fit: contain; display: block; margin: 0 auto; }
.file-preview video { width: 100%; max-height: 460px; }
.audio-preview { padding: 18px; }
.audio-preview audio { width: 100%; }
.file-link-row { display: flex; gap: 6px; margin-bottom: 14px; }
.file-link-row input {
  flex: 1; background: #f0f8fb; border: 1px solid var(--border);
  border-radius: 6px; padding: 9px 12px; color: var(--accent);
  font-family: var(--mono); font-size: 12px; outline: none;
}
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-primary {
  background: var(--btn-bg); color: var(--btn-text); border: 2px solid var(--accent);
  border-radius: 6px; padding: 10px 18px; font-size: 14px; font-weight: bold;
  font-family: var(--font); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px; transition: background .15s;
}
.btn-primary:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* Expired */
.expired-box { text-align: center; padding: 60px 20px; }
.expired-box i { font-size: 40px; color: var(--danger); margin-bottom: 16px; display: block; }
.expired-box h2 { font-size: 22px; margin-bottom: 10px; }
.expired-box p { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

/* ── 404 ─────────────────────────────────────────────────────────────────── */
.page-404 { max-width: 560px; margin: 0 auto; padding: 80px 20px; text-align: center; }
.error-code { font-size: 80px; font-weight: bold; color: var(--border); font-family: var(--mono); margin-bottom: 12px; }
.error-box h2 { font-size: 20px; margin-bottom: 8px; }
.error-box p { color: var(--muted); margin-bottom: 24px; }

/* ── HISTORY PAGE ────────────────────────────────────────────────────────── */
.page-history { max-width: 560px; margin: 0 auto; padding: 40px 20px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; margin-bottom: 6px; }
.page-header p { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state i { font-size: 36px; color: var(--border); margin-bottom: 14px; display: block; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.history-grid { display: flex; flex-direction: column; gap: 6px; }
.history-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.history-card.expired { opacity: .4; }
.hcard-icon { width: 34px; height: 34px; background: var(--surface); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--accent); flex-shrink: 0; }
.hcard-info { flex: 1; min-width: 0; }
.hcard-name { font-size: 13px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; margin-bottom: 2px; }
.hcard-meta { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.active-tag { color: var(--success); }
.expired-tag { color: var(--danger); }
.hcard-link { color: var(--muted); font-size: 14px; transition: color .15s; }
.hcard-link:hover { color: var(--accent); }

/* ── ADMIN ───────────────────────────────────────────────────────────────── */
.admin-panel { max-width: 720px; margin: 0 auto; padding: 32px 20px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.admin-header h1 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.admin-badge { background: var(--surface); border: 1px solid var(--border); color: var(--muted); border-radius: 20px; padding: 4px 12px; font-size: 12px; font-family: var(--mono); display: flex; align-items: center; gap: 5px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.stat-card i { font-size: 20px; color: var(--accent); }
.stat-num { font-size: 22px; font-weight: bold; display: block; font-family: var(--mono); }
.stat-label { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.admin-actions { margin-bottom: 16px; }
.btn-admin-warn { background: #fdf0f0; border: 1px solid #e8a0a0; color: var(--danger); border-radius: 6px; padding: 8px 14px; font-size: 13px; font-family: var(--font); cursor: pointer; display: flex; align-items: center; gap: 7px; transition: background .15s; }
.btn-admin-warn:hover { background: #fde0e0; }
.admin-section { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 18px; }
.admin-section h2 { font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: bold; text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); }
.admin-section h2 i { color: var(--accent); }
.admin-table-wrapper { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--mono); }
.admin-table th { text-align: left; padding: 8px 10px; color: var(--muted); border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; }
.admin-table td { padding: 10px 10px; border-bottom: 1px solid #eef4f6; vertical-align: middle; }
.file-link-admin { color: var(--accent); text-decoration: none; }
.file-link-admin:hover { text-decoration: underline; }
.status-badge { border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: bold; }
.status-badge.active { background: #e8f8ee; color: var(--success); }
.status-badge.inactive { background: #f0f0f0; color: #999; }
.btn-admin-sm { border: none; border-radius: 4px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: var(--font); }
.btn-danger { background: #fdf0f0; color: var(--danger); border: 1px solid #e8a0a0; }
.btn-danger:hover { background: #fde0e0; }
.admin-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 16px 0; font-family: var(--mono); }

/* ── TOAST ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 16px; font-size: 13px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  pointer-events: none; max-width: 280px;
  font-family: var(--mono);
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: #8dd0b0; color: var(--success); }
.toast-error { border-color: #e0a0a0; color: var(--danger); }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .form-row { flex-direction: column; align-items: flex-start; }
  .logo-name { font-size: 28px; }
  .logo-icon { font-size: 40px; }
}
