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

:root {
  --bg:        #0f0f1a;
  --surface:   #1a1a2e;
  --surface2:  #16213e;
  --border:    #1e2a45;
  --accent:    #00d4ff;
  --accent2:   #7b5ea7;
  --text:      #e0e0e0;
  --text-muted:#888;
  --green:     #00ff88;
  --red:       #ff4444;
  --radius:    10px;
  --shadow:    0 4px 16px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ────────────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon { font-size: 1.6em; }

.logo-text {
  font-size: 1.25em;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.stat-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85em;
  color: var(--accent);
  font-weight: 600;
}

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

/* ─── Toolbar ───────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.search-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  gap: 10px;
  transition: border-color 0.2s;
}

.search-wrap:focus-within {
  border-color: var(--accent);
}

#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1em;
  padding: 12px 0;
}

#searchInput::placeholder { color: var(--text-muted); }

.search-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.search-icon-btn:hover {
  color: var(--accent);
  background: var(--surface2);
}

.clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9em;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
}

.clear-btn:hover { color: var(--red); }


/* ─── Results Info ──────────────────────────────────────────────────────── */
.results-info {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 12px;
  min-height: 20px;
}

/* ─── File List ─────────────────────────────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
}

.file-card:hover {
  border-color: var(--accent);
  transform: translateX(3px);
}

.file-icon {
  font-size: 1.6em;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.97em;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.file-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.file-size {
  font-size: 0.8em;
  color: var(--accent);
  font-weight: 600;
}

.file-type-tag {
  font-size: 0.75em;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: 4px;
  padding: 1px 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Loading / Empty States ────────────────────────────────────────────── */
.loading-state, .empty-state, .error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state .empty-icon { font-size: 3em; margin-bottom: 12px; }
.error-state { color: var(--red); }

/* ─── Pagination ────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 40px;
  text-align: center;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f0f1a;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.85em;
  color: var(--text-muted);
  padding: 0 8px;
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8em;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

footer strong { color: var(--accent); }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .logo-text { font-size: 1em; }
  .file-card { padding: 12px 14px; }
  .file-name { font-size: 0.9em; }
}
