/* style.css — Saturn Web UI */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0f1117;
  --surface:      #1a1d27;
  --surface2:     #22263a;
  --border:       #2e3350;
  --text:         #e2e8f0;
  --text-muted:   #6b7280;
  --accent:       #6366f1;
  --accent-hover: #4f46e5;
  --pending:      #f59e0b;
  --archived:     #10b981;
  --danger:       #ef4444;
  --radius:       10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}
header h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; }
.header-status { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

/* Main */
main { flex: 1; max-width: 900px; width: 100%; margin: 0 auto; padding: 28px 16px; }

/* Drop Zone */
#uploadSection { margin-bottom: 36px; }

#dropZone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  outline: none;
}
#dropZone:hover, #dropZone.drag-over {
  border-color: var(--accent);
  background: var(--surface2);
}
#dropZone:focus-visible { box-shadow: 0 0 0 3px rgba(99,102,241,.4); }

.drop-icon { font-size: 2.5rem; margin-bottom: 12px; }
#dropZone p { color: var(--text-muted); margin-bottom: 4px; }
#dropZone .sub { font-size: 0.875rem; }
.link { color: var(--accent); cursor: pointer; text-decoration: underline; }

/* Upload Queue */
#uploadQueue { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

.upload-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.upload-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.875rem;
}
.upload-item-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.upload-item-pct  { color: var(--text-muted); font-size: 0.8rem; }

.progress-bar-wrap {
  background: var(--surface2);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width .15s ease;
}
.upload-item.done .progress-bar  { background: var(--archived); }
.upload-item.error .progress-bar { background: var(--danger); }

/* File List */
.list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.list-header h2 { font-size: 1.1rem; }

.tab-bar { display: flex; gap: 4px; }
.tab {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 12px;
  transition: background .15s, color .15s;
}
.tab:hover  { background: var(--surface2); color: var(--text); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.refresh-indicator {
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: default;
  user-select: none;
  transition: transform .4s;
}
.refresh-indicator.spinning { animation: spin .5s linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Table */
#fileTableWrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface); }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .04em;
  white-space: nowrap;
}
tbody tr {
  border-top: 1px solid var(--border);
  transition: background .1s;
}
tbody tr:hover { background: var(--surface2); }
td { padding: 11px 14px; font-size: 0.875rem; vertical-align: middle; }
td.empty { text-align: center; color: var(--text-muted); padding: 40px; }

/* Status badges */
.badge {
  display: inline-block;
  border-radius: 100px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending  { background: rgba(245,158,11,.15);  color: var(--pending); }
.badge-archived { background: rgba(16,185,129,.15); color: var(--archived); }

/* Buttons */
.btn-download {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 12px;
  text-decoration: none;
  display: inline-block;
  transition: background .15s, border-color .15s;
}
.btn-download:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-archive-now {
  background: none;
  border: 1px solid var(--archived);
  border-radius: 6px;
  color: var(--archived);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 12px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-archive-now:hover:not(:disabled)  { background: var(--archived); color: #fff; }
.btn-archive-now:disabled { opacity: .5; cursor: default; }
.btn-archive-now.syncing  { opacity: .7; }

/* Footer */
footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
footer a { color: var(--accent); text-decoration: none; }

/* Responsive */
@media (max-width: 600px) {
  th:nth-child(3), td:nth-child(3) { display: none; } /* hide Uploaded column */
  th:nth-child(2), td:nth-child(2) { display: none; } /* hide Size column */
}
