:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 20px 40px rgba(15, 23, 42, 0.12);
  --radius: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Inter, Segoe UI, Roboto, sans-serif;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.container > p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.search-box {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: white;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
}

.search-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 2.5rem;
}

.filter-btn {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.reset-btn {
  background: #111827;
  color: white;
  border-color: #111827;
}

.reset-btn:hover {
  background: #1f2937;
}

.category {
  margin-top: 2rem;
}

.category h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: all 0.25s ease;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--primary),
    #60a5fa
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  background: var(--surface-hover);
}

.card:hover::before {
  opacity: 1;
}

.icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.card h3 {
  font-size: 0.8rem;
  font-weight: 700;
}

.card p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.7rem;
}

.card::after {
  content: "↗";
  position: absolute;
  top: 18px;
  right: 18px;
  opacity: 0;
  font-size: 1rem;
  transition: all 0.25s ease;
}

.card:hover::after {
  opacity: 1;
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .filters {
    gap: 0.2rem;
  }

  .filter-btn {
    font-size: 0.5rem;
  }
}

/* Dark Mode */

body.dark-mode {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --border: #334155;

  background: linear-gradient(
    180deg,
    #0f172a,
    #111827
  );
  color: var(--text);
}

body.dark-mode .search-box {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .filter-btn {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .reset-btn {
  background: #111827;
  color: white;
  border-color: var(--border);
}

body.dark-mode .filter-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
}

body.dark-mode .card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

body.dark-mode .card p {
  color: var(--text-muted);
}

body.dark-mode .category h2 {
  border-bottom-color: var(--border);
}

body.dark-mode .icon {
  background: rgba(59, 130, 246, 0.15);
}

body.dark-mode .search-box::placeholder {
  color: #94a3b8;
}