/**
 * Compatibility shims for legacy template class names (.tile, .app-title, …).
 * Remove gradually as pages migrate to native BS5 markup (Phase 2).
 */

/* Page title bar (was Vali .app-title) */
.app-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--site-surface);
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  box-shadow: var(--site-shadow);
  border-bottom: 1px solid var(--site-border-subtle);
  border-radius: var(--site-radius);
}

.clasher-main .page-header {
  margin: 0 0 1rem;
}

@media (max-width: 575.98px) {
  .app-title {
    padding: 0.65rem 0.75rem;
  }
}

.app-title h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--site-text);
}

.app-title p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--site-text-muted);
  font-style: italic;
}

/* Content card (was Vali .tile) */
.tile {
  background: var(--site-surface);
  border: 1px solid var(--site-border-subtle);
  border-radius: var(--site-radius, 0.375rem);
  padding: 1rem;
  box-shadow: var(--site-shadow);
  margin-bottom: 1rem;
  color: var(--site-text);
}

.tile.small {
  padding: 0;
}

.tile .tile-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.tile .tile-title-w-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tile .overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-bs-theme="dark"] .tile .overlay {
  background: rgba(30, 34, 38, 0.92);
}

.line-head {
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--site-border);
}

/* BS4 badge-* still used in some templates */
.badge-primary { background-color: var(--bs-primary, #0d6efd); color: #fff; }
.badge-secondary { background-color: var(--bs-secondary, #6c757d); color: #fff; }
.badge-success { background-color: var(--bs-success, #198754); color: #fff; }
.badge-danger { background-color: var(--bs-danger, #dc3545); color: #fff; }
.badge-warning { background-color: var(--bs-warning, #ffc107); color: #212529; }
.badge-info { background-color: var(--bs-info, #0dcaf0); color: #212529; }

.badge-primary,
.badge-secondary,
.badge-success,
.badge-danger,
.badge-warning,
.badge-info {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 0.25rem;
}

/* BS4 custom-select shim */
.custom-select {
  display: block;
  width: 100%;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--site-border);
  border-radius: 0.375rem;
  background-color: var(--site-surface);
  color: var(--site-text);
}

/* Pagination: some templates use ul.nav + .page-item (legacy) */
ul.nav:has(.page-item) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding-left: 0;
  list-style: none;
}

ul.nav .page-item .page-link,
ul.nav .page-item .page-link span {
  border-radius: 0.375rem;
}

map-title {
  display: block;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.lookup-links a {
  margin: 0.25rem;
}

[data-bs-theme="dark"] table.stats_table {
  background-color: var(--site-surface);
  border-color: var(--site-border);
}

[data-bs-theme="dark"] table.stats_table th {
  background-color: var(--site-surface-raised);
}
