body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  color: #333;
  margin: 0;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1,
p {
  text-align: center;
}

/* Toggle Buttons */
.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 25px;
}

.mode-toggle button {
  padding: 10px 20px;
  font-size: 16px;
  border: 2px solid #0369a1;
  background: white;
  color: #0369a1;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.mode-toggle button.active {
  background: #0369a1;
  color: white;
}

.control-section {
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.hidden {
  display: none;
}

select {
  padding: 10px 15px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-top: 10px;
  min-width: 250px;
  cursor: pointer;
}

/* Checkbox Grid for Favorites */
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.checkbox-label {
  background: white;
  border: 1px solid #cbd5e1;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
}

.checkbox-label:hover {
  background: #e0f2fe;
}

/* Card Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.pokemon-card {
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pokemon-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.pokemon-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
  background-color: #f1f5f9;
  border-radius: 50%;
  padding: 5px;
  margin-bottom: 10px;
}

.pokemon-card h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #1e293b;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.2;
}

.match-badge {
  background: #10b981;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 10px;
}

/* Container for the tags */
.shared-traits-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px; /* Space between the tags */
  margin-top: 10px;
  width: 100%;
}

/* Base style for every tag */
.trait-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap; /* Prevents a single tag from breaking onto two lines */
}

/* Color Coding - Specialties (Purple) */
.pill-specialty {
  background-color: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}

/* Color Coding - Habitats (Green) */
.pill-habitat {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* Color Coding - Favorites (Orange) */
.pill-favorite {
  background-color: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

/* Styling for dynamically disabled checkboxes */
.checkbox-label.disabled-label {
  background-color: #e2e8f0;
  color: #94a3b8;
  border-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.5;
  /* Adds a diagonal line pattern to make it look "blocked" */
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    #cbd5e1 10px,
    #cbd5e1 12px
  );
}

/* Make sure the actual tiny square checkbox also shows the "no entry" cursor */
.checkbox-label.disabled-label input {
  cursor: not-allowed;
}

/* Styling for actively selected Pokémon in the group */
.pokemon-card.selected-card {
  border: 2px solid #0284c7; /* Bold blue border */
  background-color: #e0f2fe; /* Light blue background */
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
  transform: translateY(-5px); /* Keeps it visually "lifted" */
}

/* Clear Button Styling */
#btn-clear-group {
  padding: 8px 16px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

#btn-clear-group:hover {
  background-color: #dc2626;
}

/* Search Bar Styling */
.search-bar {
  width: 100%;
  max-width: 400px;
  padding: 12px 20px;
  margin: 15px auto;
  display: block;
  box-sizing: border-box;
  border: 2px solid #cbd5e1;
  border-radius: 25px;
  font-size: 16px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  background-color: white;
}

.search-bar:focus {
  border-color: #0369a1;
  box-shadow: 0 0 8px rgba(3, 105, 161, 0.2);
}

/* Match Settings Toggles */
.match-settings {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  background: white;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  display: inline-flex;
}

.match-settings span {
  color: #475569;
}

/* Hide the native checkbox completely */
.hidden-toggle {
  display: none;
}

/* Base styling for the UNSELECTED (grayed out) state */
.toggle-pill {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  background-color: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  display: inline-block;
}

.toggle-pill:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

/* Specialties (Purple) */
#match-specialties:checked + .pill-toggle-specialty {
  background-color: #f3e8ff;
  color: #7e22ce;
  border-color: #d8b4fe;
}

/* Habitats (Green) */
#match-habitats:checked + .pill-toggle-habitat {
  background-color: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

/* Favorites (Orange) */
#match-favorites:checked + .pill-toggle-favorite {
  background-color: #ffedd5;
  color: #c2410c;
  border-color: #fdba74;
}

/* Shared Clear Button Styling */
#btn-clear-group,
#btn-clear-favorites {
  padding: 8px 16px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

#btn-clear-group:hover,
#btn-clear-favorites:hover {
  background-color: #dc2626;
}

/* Styling for Mode 2 Headings */
.trait-heading {
  text-align: left;
  margin: 20px 0 10px 10px;
  font-size: 16px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 5px;
}

.text-specialty {
  color: #7e22ce;
  border-color: #d8b4fe;
}
.text-habitat {
  color: #15803d;
  border-color: #86efac;
}
.text-favorite {
  color: #c2410c;
  border-color: #fdba74;
}

/* Let the colored pills look right when used as checkbox labels */
.checkbox-label.pill-specialty,
.checkbox-label.pill-habitat,
.checkbox-label.pill-favorite {
  border-radius: 20px;
}

/* Ensure disabled items lose their bright colors so they actually look blacked out */
.checkbox-label.disabled-label {
  background-color: #f1f5f9 !important;
  color: #cbd5e1 !important;
  border-color: #e2e8f0 !important;
}

/* Share the Clear button style */
#btn-clear-group,
#btn-clear-traits {
  padding: 8px 16px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

#btn-clear-group:hover,
#btn-clear-traits:hover {
  background-color: #dc2626;
}
