/* neo-open-viewer — custom styles on top of Tailwind CDN. */

/* ---------- layout ---------- */

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* ---------- tabs ---------- */

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color 200ms, background-color 200ms, border-color 200ms, box-shadow 200ms;
}
.tab:hover {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f8fafc;
}
.tab-active,
.tab-active:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.tabs-scroll {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.tabs-scroll::-webkit-scrollbar {
  height: 4px;
}
.tabs-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

/* ---------- view toggle ---------- */

.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  color: #64748b;
  cursor: pointer;
  transition: background-color 200ms, color 200ms;
}
.view-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.view-btn-active,
.view-btn-active:hover {
  background: #0f172a;
  color: #fff;
}

/* ---------- data table ---------- */

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}
.data-table th {
  position: sticky;
  top: 4rem; /* sit under the sticky 64px header */
  z-index: 1;
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  white-space: nowrap;
  border-bottom: 1px solid #e2e8f0;
}
.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background-color 150ms;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- states ---------- */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  font-size: 14px;
  color: #64748b;
}
.spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid #cbd5e1;
  border-top-color: #4f46e5;
  border-radius: 9999px;
  animation: spin 800ms linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading.is-error .spinner {
  border-top-color: #dc2626;
}
.loading.is-error {
  color: #b91c1c;
}

.page-info {
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: #94a3b8;
}

.no-data {
  display: flex;
}

/* ---------- misc ---------- */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
