/* ===== CSS Variables (Light Theme) ===== */
:root {
  --bg: #f5f5f5;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e0e0e0;
  --nav-bg: #ffffffdd;
  --hero-bg: linear-gradient(135deg, #2563eb, #7c3aed);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 10px;
}

/* ===== Dark Theme ===== */
.dark {
  --bg: #121212;
  --bg-card: #1e1e1e;
  --text: #e4e4e4;
  --text-muted: #999;
  --accent: #60a5fa;
  --accent-hover: #93bbfd;
  --border: #2a2a2a;
  --nav-bg: #1a1a1add;
  --hero-bg: linear-gradient(135deg, #1e40af, #5b21b6);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

/* ===== Navbar ===== */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  position: relative;
  position: sticky;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

#navLinks {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

#navLinks a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

#navLinks a:hover {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#themeToggle,
.menu-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text);
}

.menu-btn {
  display: none;
}

/* ===== Hero ===== */
#hero {
  background: var(--hero-bg);
  color: #fff;
  text-align: center;
  padding: 4rem 1.25rem 3rem;
}

#hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

#hero p {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

#searchBox {
  width: 100%;
  max-width: 480px;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  outline: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
}

#searchBox::placeholder {
  color: rgba(255,255,255,0.7);
}

#searchBox:focus {
  background: rgba(255,255,255,0.3);
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.filter {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter:hover,
.filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Main Content ===== */
#content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.section-title {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.sub-heading {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 1.5rem 0 0.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.card .tag {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  border-radius: 50px;
  background: var(--accent);
  color: #fff;
}

/* ===== No Results ===== */
#noResults {
  text-align: center;
  padding: 3rem 1rem;
  display: none;
  color: var(--text-muted);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

footer .muted {
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  #navLinks {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }

  #navLinks.open {
    display: flex;
  }

  .menu-btn {
    display: block;
  }

  #hero h1 {
    font-size: 1.6rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}