/* File Share Drop — compact single-column layout, menu-bar-app ready (~400 px). */

:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --text: #1a1d21;
  --muted: #6b7280;
  --border: #e2e4e9;
  --accent: #5b6cf0;
  --accent-strong: #4655e0;
  --accent-soft: rgba(91, 108, 240, 0.09);
  --danger: #d2404b;
  --amber: #b45309;
  --shadow: 0 1px 3px rgba(20, 22, 28, 0.07);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1f26;
    --surface-2: #232933;
    --text: #e8eaee;
    --muted: #9aa2ad;
    --border: #2b323c;
    --accent: #7583f5;
    --accent-strong: #8b98ff;
    --accent-soft: rgba(117, 131, 245, 0.14);
    --danger: #ef6b74;
    --amber: #e8a33d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.error { color: var(--danger); font-size: 13px; margin: 10px 0 0; }

.view { max-width: 560px; margin: 0 auto; padding: 14px 16px 32px; }

/* ---------- Icon ---------- */

.icon-drop { fill: var(--accent); }
.icon-arrow {
  fill: none;
  stroke: var(--surface);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Login ---------- */

#login-view { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
#login-view.hidden { display: none; }

.login-card {
  width: min(340px, 90vw);
  text-align: center;
  padding: 32px 28px;
}
.login-card .app-icon { width: 56px; height: 56px; }
.login-card h1 { font-size: 20px; margin: 10px 0 2px; }
.login-card p.muted { margin: 0 0 18px; font-size: 13.5px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

input[type="password"], input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}
input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Header & Tabs ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 12px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.brand-icon { width: 22px; height: 22px; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 14px;
}
.tab {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  padding: 7px 6px;
  cursor: pointer;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* ---------- Buttons ---------- */

.btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.small { font-size: 12px; padding: 5px 9px; border-radius: 7px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.block { width: 100%; }
.btn.copied { color: var(--accent); border-color: var(--accent); }

/* ---------- Dropzone ---------- */

#dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 36px 16px 30px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
#dropzone:hover, #dropzone:focus-visible { border-color: var(--accent); outline: none; }
#dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop-icon { width: 44px; height: 44px; margin-bottom: 4px; }
.drop-title { margin: 0; font-weight: 600; }
.drop-hint { margin: 0; color: var(--muted); font-size: 13px; }

kbd {
  font-family: inherit;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
}

#paste-btn { margin-top: 10px; }

/* ---------- Rows (uploads & files) ---------- */

.rows { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.row.expiring-out { opacity: 0; transform: translateY(4px); }

.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.row .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  min-width: 0;
}
.row .countdown { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.row.low .countdown { color: var(--amber); font-weight: 600; }

.track {
  height: 3px;
  border-radius: 2px;
  background: var(--surface-2);
  margin: 8px 0;
  overflow: hidden;
}
.bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s linear;
}
.row.low .bar.ttl { background: var(--amber); }

.row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.upload-row .status { flex-shrink: 0; }
.upload-row.failed { border-color: var(--danger); }
.upload-row.failed .status { color: var(--danger); }
.upload-row .row-actions { margin-top: 2px; }

#quota-line { margin-top: 14px; }
#empty-hint { margin-top: 22px; }

/* ---------- Toasts ---------- */

#toast-container {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  width: max-content;
  max-width: 90vw;
}
.toast {
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.2s ease;
  max-width: 100%;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 420px) {
  .view { padding: 10px 10px 24px; }
  body { font-size: 14px; }
}
