@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --bg: #f9fafb;
  --bg-accent: #ececec;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #131a2a;
  --muted: #5f6b84;
  --border: rgba(19, 26, 42, 0.14);
  --code-bg: #111827;
  --code-text: #e7ecf8;
  --implemented: #1f7a50;
  --implemented-bg: #e6f6ee;
  --pending: #9c2f2f;
  --pending-bg: #fbeaea;
  --shadow: 0 14px 30px rgba(18, 27, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body.explorer-page {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
}

.layout {
  width: min(1100px, 100% - 2.5rem);
  margin: 0 auto;
  padding: 2.1rem 0 2.5rem;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 1rem;
}

.hero-kicker {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
  color: #6a7693;
}

h1 {
  margin: 0;
  line-height: 1.05;
  font-size: clamp(2.05rem, 4vw, 3.25rem);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero-copy {
  margin: 0.55rem 0 0;
  max-width: 46rem;
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  color: var(--muted);
}

.hero-stats {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.stat-card {
  margin: 0;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 0.72rem 0.85rem;
  display: grid;
  gap: 0.2rem;
}

.stat-card--implemented {
  border-color: color-mix(in srgb, var(--implemented) 28%, #ffffff);
  background: #eff9f3;
}

.stat-card--pending {
  border-color: color-mix(in srgb, var(--pending) 24%, #ffffff);
  background: #fdf1f1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  font-weight: 700;
}

.controls {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: 1fr repeat(2, minmax(170px, 220px));
  gap: 0.8rem;
  align-items: end;
}

.search-wrap {
  display: grid;
  gap: 0.3rem;
}

.search-label {
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.66rem 0.82rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font: inherit;
}

.search-input:focus {
  outline: none;
  border-color: rgba(31, 122, 80, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 122, 80, 0.12);
}

.filter-wrap {
  display: grid;
  gap: 0.3rem;
  min-width: 210px;
}

.filter-select {
  width: 100%;
  border: 1px solid var(--border);
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%235f6b84' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
  color: var(--text);
  border-radius: 0.75rem;
  padding: 0.52rem 2.1rem 0.52rem 0.68rem;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.filter-select:focus {
  outline: none;
  border-color: rgba(31, 122, 80, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 122, 80, 0.12);
}

.filter-select:active {
  border-color: rgba(31, 122, 80, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 122, 80, 0.12);
}

.filter-select:hover {
  border-color: rgba(19, 26, 42, 0.24);
}

.filter-select option {
  color: var(--text);
  background: #ffffff;
}

.filter-select option:checked {
  background: #e6f6ee;
  color: #135535;
}

.status {
  margin: 0.8rem 0;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(6px);
  width: 100%;
}

.status--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-align: center;
}

.status-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  border: 2px solid rgba(95, 107, 132, 0.22);
  border-top-color: #5f6b84;
  animation: spin 0.75s linear infinite;
}

.status--error {
  border-color: color-mix(in srgb, var(--pending) 35%, #ffffff);
  background: var(--pending-bg);
  color: #6d1e1e;
}

.meta {
  margin: 0 0 0.9rem;
  color: #5f6b84;
  font-size: 0.87rem;
  text-align: right;
}

.empty-state {
  margin: 1rem 0 1.2rem;
  padding: 1.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #ffffff;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.48rem;
}

.empty-state__title {
  margin: 0.18rem 0 0;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.empty-state__message {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 0.93rem;
}

.empty-state__action {
  margin-top: 0.2rem;
  border: 1px solid rgba(19, 26, 42, 0.2);
  border-radius: 0.72rem;
  background: #ffffff;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.empty-state__action:hover {
  border-color: rgba(19, 26, 42, 0.34);
}

.empty-state__action:focus-visible {
  outline: none;
  border-color: rgba(31, 122, 80, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 122, 80, 0.12);
}

.empty-state--error {
  border-color: rgba(156, 47, 47, 0.26);
  background: #fff8f8;
}

.empty-state[hidden] {
  display: none;
}

.endpoint-list {
  display: grid;
  gap: 0.8rem;
}

.endpoint {
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
  opacity: 0;
  transform: translateY(12px);
  animation: endpoint-in 420ms ease forwards;
  animation-delay: var(--stagger, 0ms);
}

.endpoint[open] {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(20, 35, 28, 0.11);
}

.endpoint--implemented {
  border-color: color-mix(in srgb, var(--implemented) 40%, #ffffff);
  background: #f3fbf6;
}

.endpoint--pending {
  border-color: color-mix(in srgb, var(--pending) 34%, #ffffff);
  background: #fff4f4;
}

summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem 0.95rem;
}

summary::-webkit-details-marker {
  display: none;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.method {
  min-width: 4.2rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.82);
}

.method--get {
  color: #1f7a50;
  border-color: rgba(31, 122, 80, 0.3);
}

.method--post {
  color: #b36109;
  border-color: rgba(179, 97, 9, 0.32);
}

.method--patch,
.method--put {
  color: #9a8500;
  border-color: rgba(154, 133, 0, 0.35);
}

.method--delete {
  color: #b42323;
  border-color: rgba(180, 35, 35, 0.34);
}

.path {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.92rem;
}

.state-text {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.state-text--implemented {
  color: #1f7a50;
}

.state-text--pending {
  color: #b42323;
}

.description {
  margin-top: 0.46rem;
  color: var(--muted);
}

.content {
  border-top: 1px solid var(--border);
  padding: 0.95rem 1rem 0.2rem;
}

.section-title {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #34415d;
}

pre {
  margin: 0 0 0.9rem;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.82rem;
  border-radius: 0.58rem;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.5;
  font-family: "IBM Plex Mono", "Courier New", monospace;
}

@keyframes endpoint-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 760px) {
  .layout {
    width: min(1100px, 100% - 1.3rem);
    padding-top: 1.35rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  summary {
    padding-inline: 0.85rem;
  }

  .content {
    padding-inline: 0.85rem;
  }

  .state-text {
    margin-left: 0;
  }
}
