/* Scoped CSS for Superhero & Supervillain Database */
.shvd-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
  line-height: 1.5;
}

.shvd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.shvd-card-wrapper {
  margin-bottom: 2rem;
}

.shvd-toolbar {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.shvd-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
}

.shvd-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #ffffff;
  color: #111827;
  outline: none;
  transition: border-color 0.15s ease;
}

.shvd-input:focus {
  border-color: #dc2626;
}

.shvd-btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shvd-btn-primary {
  background-color: #dc2626;
  color: #ffffff;
}

.shvd-btn-primary:hover {
  background-color: #b91c1c;
}

.shvd-btn-secondary {
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.shvd-btn-secondary:hover {
  background-color: #e5e7eb;
}

.shvd-btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.shvd-btn-view {
  background-color: #f3f4f6;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

.shvd-btn-view:hover {
  background-color: #e5e7eb;
}

.shvd-btn-battle {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.shvd-btn-battle:hover {
  background-color: #fee2e2;
}

.shvd-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shvd-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.shvd-filter-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4b5563;
}

.shvd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shvd-pill {
  background-color: #f9fafb;
  border: 1px solid #d1d5db;
  color: #4b5563;
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shvd-pill:hover {
  background-color: #f3f4f6;
}

.shvd-pill.active {
  background-color: #dc2626;
  color: #ffffff;
  font-weight: 600;
  border-color: #dc2626;
}

.shvd-status-row {
  margin: 1rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b7280;
}

.shvd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.shvd-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem;
  color: #6b7280;
  background-color: #ffffff;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
}

.shvd-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shvd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.shvd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.shvd-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.shvd-badge-hero {
  background-color: #dbeafe;
  color: #1e40af;
}

.shvd-badge-villain {
  background-color: #fee2e2;
  color: #b91c1c;
}

.shvd-badge-anti-hero {
  background-color: #fef3c7;
  color: #b45309;
}

.shvd-pub-tag {
  font-size: 0.8rem;
  font-weight: 600;
}

.shvd-pub-marvel {
  color: #e11d48;
}

.shvd-pub-dc {
  color: #2563eb;
}

.shvd-card-title {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.shvd-alter-ego,
.shvd-first-app {
  margin: 0.2rem 0;
  font-size: 0.85rem;
  color: #4b5563;
}

.shvd-powers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0.75rem 0;
}

.shvd-power-tag {
  background-color: #f3f4f6;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: #374151;
}

.shvd-card-bio {
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
  color: #6b7280;
  flex-grow: 1;
}

.shvd-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

/* Battle Simulator Panel */
.shvd-battle-panel {
  background-color: #1e293b;
  color: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid #ef4444;
}

.shvd-battle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.shvd-battle-title {
  margin: 0;
  font-size: 1.35rem;
  color: #fca5a5;
}

.shvd-battle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.shvd-battle-fighter {
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.25rem;
}

.shvd-fighter-name {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: #ffffff;
}

.shvd-stat-row {
  margin: 0.6rem 0;
}

.shvd-stat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 2px;
}

.shvd-stat-bar-bg {
  background-color: #334155;
  border-radius: 9999px;
  height: 8px;
  overflow: hidden;
}

.shvd-stat-bar-fill {
  background-color: #ef4444;
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.shvd-battle-verdict {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1rem;
  background-color: #0f172a;
  border-radius: 8px;
  border: 1px solid #ef4444;
  margin-top: 0.5rem;
}

.shvd-verdict-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f87171;
}

/* Modal View */
.shvd-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.shvd-modal-box {
  background-color: #ffffff;
  border-radius: 12px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.shvd-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #6b7280;
  cursor: pointer;
}

.shvd-modal-content {
  display: block;
}

.shvd-modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  color: #111827;
}

.shvd-modal-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 1rem;
}

.shvd-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.shvd-table th,
.shvd-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

.shvd-table th {
  color: #6b7280;
  width: 35%;
}

@media (max-width: 768px) {
  .shvd-search-bar {
    flex-direction: column;
  }
  .shvd-battle-grid {
    grid-template-columns: 1fr;
  }
}
