:root {
  --bg: #f7f8fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #1e40af;
  --accent-light: #dbeafe;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  color: #fff;
  padding: 2.5rem 1rem;
  text-align: center;
}

.header-inner h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 0.5rem;
  font-size: 1rem;
  opacity: 0.85;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.search-bar {
  position: relative;
  margin-bottom: 2rem;
}

#search {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s;
  font-family: inherit;
}

#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-count {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.category {
  margin-bottom: 2rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.category-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.category-badge {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
}

.file-list {
  display: grid;
  gap: 0.75rem;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}

.file-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.file-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-type-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--border);
  color: var(--text-muted);
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* File type colors */
.icon-pdf { background: #dc2626; }
.icon-doc { background: #2563eb; }
.icon-img { background: #7c3aed; }
.icon-video { background: #ea580c; }
.icon-audio { background: #0891b2; }
.icon-archive { background: #65a30d; }
.icon-default { background: #6b7280; }

.badge-pdf { background: #fee2e2; color: #dc2626; }
.badge-doc { background: #dbeafe; color: #2563eb; }
.badge-img { background: #ede9fe; color: #7c3aed; }
.badge-video { background: #ffedd5; color: #ea580c; }
.badge-audio { background: #cffafe; color: #0891b2; }
.badge-archive { background: #ecfccb; color: #65a30d; }
.badge-default { background: #f3f4f6; color: #6b7280; }

@media (max-width: 600px) {
  .file-card { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .file-type-badge { align-self: flex-start; }
  .header-inner h1 { font-size: 1.4rem; }
}
