:root {
  --bg: #0b0f17;
  --panel: rgba(16, 24, 38, 0.78);
  --panel2: rgba(16, 24, 38, 0.58);
  --text: #e7eefc;
  --muted: #9fb0cc;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.35);
  --ok: #2dd475;
  --no: #fb7185;
  --na: #2dd475;
  --team-bg: rgba(255, 153, 0, 0.08);
  --team-border: rgba(255, 153, 0, 0.3);
  --team-text: rgba(255, 153, 0, 0.9);
  --transition-fast: 120ms;
  --transition-base: 200ms;
  --radius-sm: 0.625rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.125rem;
  --spacing-xs: 0.375rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1.125rem;
  --dark-65: rgba(11, 15, 23, 0.65);
  --dark-95: rgba(11, 15, 23, 0.95);
  --panel-60: rgba(16, 24, 38, 0.6);
  --panel-80: rgba(16, 24, 38, 0.8);
  --panel-90: rgba(16, 24, 38, 0.9);
  --panel-95: rgba(16, 24, 38, 0.95);
  --white-08: rgba(255, 255, 255, 0.08);
  --white-15: rgba(255, 255, 255, 0.15);
  --white-18: rgba(255, 255, 255, 0.18);
  --white-25: rgba(255, 255, 255, 0.25);
  --white-30: rgba(255, 255, 255, 0.3);
  --error-light: rgba(251, 113, 133, 0.1);
  --error-border: rgba(251, 113, 133, 0.2);
  --orange-15: rgba(255, 153, 0, 0.15);
  --orange-08: rgba(255, 153, 0, 0.08);
  --orange-25: rgba(255, 153, 0, 0.25);
  --orange-12: rgba(255, 153, 0, 0.12);
  --orange-40: rgba(255, 153, 0, 0.4);
  --orange-50: rgba(255, 153, 0, 0.5);
  --white-40: rgba(255, 255, 255, 0.4);
  --panel-65: rgba(16, 24, 38, 0.65);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100%;
  margin: 0;
}

.page {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(75rem 43.75rem at 20% 0%, rgba(255, 153, 0, 0.12), transparent 55%),
    radial-gradient(56.25rem 37.5rem at 80% 10%, rgba(59, 130, 246, 0.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--dark-95);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-lg);
  display: grid;
  grid-template-columns: 1fr minmax(13.75rem, 22.5rem);
  gap: var(--spacing-md);
  align-items: center;
}

.topbar__left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.topbar__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.0125rem;
  line-height: 1.2;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.8125rem;
}

.topbar__timestamp {
  color: var(--muted);
  white-space: nowrap;
}

.topbar__right {
  display: flex;
  align-items: center;
}

.search-bar {
  background: var(--dark-65);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-lg) var(--spacing-lg) 1.25rem;
}

.search-bar__container {
  max-width: 75rem;
  margin: 0 auto;
}

.search-bar__form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.search-bar__input-wrapper {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  position: relative;
}

.search-bar__icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.search-bar__input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--panel-80);
  color: var(--text);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.9375rem;
}

.search-bar__input:focus {
  border-color: var(--orange-50);
  background: var(--panel-95);
}

.search-bar__input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.search-bar__submit {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--orange-15), var(--orange-08));
  color: var(--text);
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-bar__submit:hover {
  border-color: var(--orange-40);
  background: linear-gradient(180deg, var(--orange-25), var(--orange-15));
}

.search-bar__submit:active {
}

.search-bar__submit svg {
  width: 1.25rem;
  height: 1.25rem;
}

.search-bar__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.search-options {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.search-option {
  border: 1px solid var(--border);
  background: var(--panel-60);
  color: var(--muted);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.search-option:hover {
  border-color: var(--white-15);
  background: var(--panel-80);
  color: var(--text);
}

.search-option[aria-pressed="true"] {
  border-color: var(--orange-40);
  background: var(--orange-12);
  color: var(--text);
  font-weight: 600;
}

.search-filters {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}

.search-filter {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 1;
  min-width: 0;
}

.search-filter__label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-filter__input,
.search-filter__select {
  border: 1px solid var(--border);
  background: var(--panel-60);
  color: var(--text);
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.75rem;
  min-width: 6.5rem;
  max-width: 9rem;
  flex-shrink: 1;
}

.search-filter__input:focus,
.search-filter__select:focus {
  border-color: var(--orange-40);
}

.search-filter__input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.search-filter__select {
  cursor: pointer;
}

@media (max-width: 48rem) {
  .search-bar__options {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
  }

  .search-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .search-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .search-filter__input,
  .search-filter__select {
    max-width: none;
  }
}

.search {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-65);
  color: var(--text);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.875rem;
}

.search:focus {
  border-color: var(--orange-40);
}

.search::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.button {
  border: 1px solid var(--border);
  background: var(--panel-90);
  color: var(--text);
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.button:hover:not(:disabled) {
  border-color: var(--white-18);
  background: var(--panel-95);
}

.button:active:not(:disabled) {
  display: hidden;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-select {
  border: 1px solid var(--border);
  background: var(--panel-90);
  color: var(--text);
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.page-select:hover {
  border-color: var(--white-18);
  background: var(--panel-95);
}

.page-select:focus {
  outline: none;
  border-color: var(--white-30);
  background: var(--panel-95);
}

.content {
  padding: var(--spacing-lg);
  max-width: 75rem;
  margin: 0 auto;
  width: 100%;
}

.loading {
  color: var(--muted);
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.875rem;
}

.error-message {
  color: var(--no);
  padding: 2.5rem;
  text-align: center;
  font-size: 0.875rem;
  background: var(--error-light);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

.section {
  margin: var(--spacing-lg) 0 1.625rem;
}

.section:first-of-type {
  margin-top: 0;
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.section__title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.0375rem;
  text-transform: uppercase;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: var(--spacing-md);
}

@media (min-width: 68.75rem) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 68.74rem) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 50rem) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 32.5rem) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 11rem;
  position: relative;
  transition: transform var(--transition-fast) ease, border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
}

.card:hover {
  border-color: var(--orange-40);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4);
  transform: scale(1.02);
}

.card:active {
  display: hidden;
}

.card__icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--white-08);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.card__meta {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  text-align: center;
  min-width: 0;
}

.card__label {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  word-break: break-word;
}

.card__url {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__team {
  margin-top: auto;
  padding: 0.375rem 0.75rem;
  background: var(--team-bg);
  border: 1px solid var(--team-border);
  border-radius: var(--radius-sm);
  color: var(--team-text);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge {
  position: absolute;
  top: 0rem;
  right: 0rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  border: 1px solid var(--white-25);
  background: var(--white-08);
}

.card:hover .badge {
  border-color: var(--white-40);
}

.badge--ok {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: 0 0 0.5rem rgba(45, 212, 191, 0.3);
}

.badge--no {
  background: var(--no);
  border-color: var(--no);
  box-shadow: 0 0 0.5rem rgba(251, 113, 133, 0.3);
}

.badge--na {
  background: var(--na);
  border-color: var(--na);
  box-shadow: 0 0 0.5rem rgba(251, 191, 36, 0.3);
}

.footer-note {
  margin-top: 1.625rem;
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  opacity: 0.8;
}

.footer-note kbd {
  background: var(--panel-80);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  font-family: ui-monospace, monospace;
  margin: 0 0.125rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* login page */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0b0f17 0%, #1a1f2e 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.login-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 3rem;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
  margin: 0 0 1rem 0;
  color: #ffffff;
  font-size: 2rem;
  text-align: center;
  font-weight: 600;
}

.login-card p {
  margin: 0 0 2rem 0;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  font-size: 0.95rem;
}

.login-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.4);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn img {
  width: 20px;
  height: 20px;
}

.error-message {
  color: #ef4444;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .login-card {
    padding: 2rem;
    margin: 1rem;
  }

  .login-card h1 {
    font-size: 1.5rem;
  }
}

.logout-button {
  border: 1px solid var(--border);
  background: var(--panel-90);
  color: var(--text);
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  margin-left: var(--spacing-md);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast) ease;
}

.logout-button:hover:not(:disabled) {
  border-color: var(--no);
  background: linear-gradient(180deg, rgba(251, 113, 133, 0.15), rgba(251, 113, 133, 0.08));
  color: var(--no);
}

.logout-button:active:not(:disabled) {
  opacity: 0.8;
}

.logout-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
