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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3347;
  --accent: #6366f1;
  --accent-glow: rgba(99,102,241,0.3);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #e2e8f0;
  --muted: #64748b;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  padding: 24px 16px 64px;
}

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

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.logo svg { color: var(--accent); }
.stats {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  color: var(--muted);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  margin-bottom: 32px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.upload-icon { color: var(--muted); margin-bottom: 16px; }
.upload-zone.drag-over .upload-icon { color: var(--accent); }
.upload-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.upload-sub { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.browse-link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.upload-types { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* Section */
.section { margin-bottom: 32px; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title { font-size: 16px; font-weight: 600; color: var(--text); }

/* Filter tabs */
.filter-tabs { display: flex; gap: 6px; }
.tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab:hover { border-color: var(--accent); color: var(--text); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Upload Queue */
.queue-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.queue-item-header { display: flex; justify-content: space-between; align-items: center; }
.queue-name { font-size: 14px; font-weight: 500; }
.queue-status { font-size: 12px; color: var(--muted); }
.queue-status.error { color: var(--danger); }
.queue-status.success { color: var(--success); }
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
  width: 0%;
}
.error-reasons {
  font-size: 12px;
  color: var(--danger);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.6;
}

/* File Grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  color: var(--muted);
  padding: 48px;
  font-size: 14px;
}

/* File Card */
.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.file-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.file-preview {
  height: 160px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-preview .file-icon {
  font-size: 48px;
  opacity: 0.6;
}
.category-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-image  { background: rgba(99,102,241,0.8); color:#fff; }
.badge-video  { background: rgba(236,72,153,0.8); color:#fff; }
.badge-document { background: rgba(245,158,11,0.8); color:#fff; }

.file-info { padding: 12px 14px; }
.file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.file-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.file-actions { display: flex; gap: 8px; }
.btn {
  flex: 1;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
  pointer-events: none;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger); }

@media (max-width: 600px) {
  .file-grid { grid-template-columns: 1fr; }
  .upload-zone { padding: 32px 16px; }
}
