:root {
  --bg-body: #0a0a0a;
  --bg-card: #111111;
  --bg-element: #1c1c1c;
  --border-subtle: #2a2a2a;
  --border-focus: #525252;
  --text-main: #ededed;
  --text-muted: #a1a1aa;
  --text-subtle: #525252;
  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 4px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-family: "Open Sans", sans-serif;
}

h1,
h2 {
  line-height: 1.2;
}

button,
input {
  font: inherit;
  color: inherit;
}

.wrapper {
  padding: 4rem 1.5rem;
  width: 100%;
  max-width: 900px;
}

.sr-only {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

header {
  margin-bottom: 3rem;
}

.page-title {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.page-description {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
}

.search-group {
  margin-bottom: 3rem;
}

.search-bar {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  background: var(--bg-card);
}

.search-bar:focus-within {
  border-color: #fff;
  outline: 1px solid #fff;
}

input {
  border: none;
  background: transparent;
  padding-left: 12px;
  width: 100%;
  outline: none;
  font-size: 1rem;

  &::placeholder {
    color: #4b4a4a;
  }
}

.card-wrapper {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;

  @media (min-width: 768px) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.single-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  height: 100%;
}

.single-card:hover {
  border-color: var(--border-focus);
}

.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--bg-element);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.card-details h3 {
  font-size: 1.25rem;
}

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

.card-labels {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.label {
  display: inline-flex;
  align-items: center;
  border-radius: 100px;
  padding: 4px 12px;
  background-color: var(--bg-element);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.single-card:hover .label {
  color: var(--text-main);
  background-color: var(--border-subtle);
}

footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;

  @media (min-width: 640px) {
    flex-direction: row;
    justify-content: space-between;
  }
}

footer div {
  display: flex;
  align-items: center;
  gap: 6px;
}

footer a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Api detail page */
.go-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2rem;
  padding: 8px 0;
}

.go-back-btn:hover {
  color: var(--text-main);
}

.project-list {
  margin-top: 1rem;
  list-style: none;
}

.project-list h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.project-list p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.loading-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.loader {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--text-main);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-description {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.resources-section {
  margin-bottom: 2rem;
}

.resources-section h2,
.projects-section h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.resources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.resource-link:hover {
  border-color: var(--border-focus);
  color: var(--text-main);
}

.projects-section {
  margin-top: 2rem;
}

.project-list li {
  padding-block: 1rem;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
}

.project-list li:last-child {
  margin-bottom: 0;
}
