:root {
  --bg: #0d1117;
  --surface: rgba(22,27,34,0.85);
  --card: rgba(31,36,45,0.85);
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --border: #30363d;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg);
  overflow-x: hidden;
}

/* Star & Moon container */
#space {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Star common style */
.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  box-shadow: 0 0 4px rgba(255,255,255,0.6);
}

/* Moon */
.moon {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f0f0f0, #aaaaaa);
  box-shadow: 0 0 50px rgba(255,255,255,0.5);
}

/* Header */
.navbar {
  text-align: center;
  padding: 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
}

.navbar h1 {
  margin: 0;
  font-size: 2.0rem;
  font-family: "Bebas Neue", sans-serif;
  color: var(--text);
  text-align: center;
  letter-spacing: 1.5px;
}

.navbar p {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Filters */
.filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.filters input {
  flex: 1;
  height: 2.8rem;
  padding: 0 1rem;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.filters input::placeholder {
  color: var(--muted);
}

.filters input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(88,166,255,0.4);
}

/* Settings Button */
.filters-toggle {
  height: 2.8rem;
  width: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filters-toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.filters-toggle .material-symbols-outlined {
  font-size: 1.6rem;
  color: var(--text);
}

.filters-toggle:hover .material-symbols-outlined {
  color: #fff;
}

/* Collapsible Filters */
.filters-collapse {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  transition: max-height 0.35s ease, opacity 0.35s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.filters-collapse.open {
  max-height: 500px;
  opacity: 1;
}

/* Dropdowns */
.filters select {
  appearance: none;
  background: var(--card)
    url("data:image/svg+xml;utf8,<svg fill='%23e6edf3' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>")
    no-repeat right 0.8rem center;
  background-size: 1rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 2rem 0.55rem 0.9rem;
  font-size: 0.9rem;
  min-width: 140px;
  cursor: pointer;
}

.filters select:hover {
  border-color: var(--accent);
}

.filters select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(88,166,255,0.4);
}

/* Results grid */
#results {
  max-width: 1000px;
  margin: 2rem auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
  gap: 1.5rem;
  padding: 0 1rem;
}

/* Card */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(6px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.card h3 {
  font-size: 1rem;
  margin: 0.4rem 0 0.5rem 0;
  line-height: 1.5;
  color: var(--text);
}

.meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.tags {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: rgba(88,166,255,0.15);
  color: var(--accent);
  padding: 0.3rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--accent);
  color: #fff;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
  backdrop-filter: blur(6px);
}

/* Mobile */
@media (max-width: 480px) {
  #results {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
  }

  .filters-collapse {
    width: 100%;
  }

  .filters select {
    width: calc(50% - 0.4rem);
  }
}
