/* Comparison Page Specific Styles */

.comparison-container {
  display: grid;
  grid-template-columns: 400px 250px 400px;
  gap: 25px;
  margin-bottom: 30px;
  justify-content: center;
}

/* Columns */
.comparison-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 400px;
}

.difference-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 250px;
}

/* Column Headers */
.column-header {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

.column-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
  font-family: 'Press Start 2P', cursive;
  line-height: 1.4;
}

/* Pokemon Dropdown */
.pokemon-dropdown {
  width: 100%;
  padding: 12px;
  margin-top: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  font-size: 0.75rem;
  font-family: 'Press Start 2P', cursive;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.pokemon-dropdown:hover {
  border-color: #cbd5e0;
}

.pokemon-dropdown:focus {
  outline: none;
  border-color: #667eea;
}

/* Pokemon Cards */
.pokemon-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  box-shadow: var(--shadow);
  text-align: center;
  height: 420px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.pokemon-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  min-height: 80px;
  max-height: 80px;
  flex-shrink: 0;
}

.pokemon-name {
  font-size: clamp(1rem, 5vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: capitalize;
  max-width: 100%;
  word-wrap: break-word;
  line-height: 1.2;
  text-align: center;
}

.pokemon-sprite-container {
  width: 200px;
  height: 200px;
  margin: 0 auto 15px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 50%;
  padding: 20px;
  flex-shrink: 0;
}

.pokemon-sprite-compare {
  width: 160px;
  height: 160px;
  object-fit: contain;
  image-rendering: pixelated;
}

.type-container {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 40px;
  max-height: 40px;
  overflow: hidden;
  flex-shrink: 0;
}

/* Stats List */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stat-card-compare {
  background: #f7fafc;
  border-radius: 15px;
  padding: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  height: 230px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.stat-header-compare {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  height: 20px;
  flex-shrink: 0;
}

.stat-chart-small-compare {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-bottom: 12px;
  padding: 5px;
  background: white;
  border-radius: 8px;
  flex-shrink: 0;
}

.stat-bar-small-compare {
  flex: 1;
  background: #e2e8f0;
  border-radius: 3px 3px 0 0;
  transition: all 0.3s ease;
  min-height: 5%;
}

.stat-bar-small-compare.highlighted {
  background: linear-gradient(180deg, var(--stat-color) 0%, var(--stat-color-dark) 100%);
  box-shadow: 0 0 10px var(--stat-color);
}

.stat-values-compare {
  display: flex;
  position: relative;
  width: 100%;
  flex-shrink: 0;
  height: 70px;
  align-items: center;
}

.stat-value-item-compare {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-value-compare {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label-compare {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Difference Column Styling */
.difference-spacer {
  height: 420px;
}

.difference-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.difference-card {
  background: #f7fafc;
  border-radius: 15px;
  padding: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  height: 230px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.difference-stat-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  height: 20px;
  flex-shrink: 0;
}

.difference-chart-spacer {
  height: 80px;
  margin-bottom: 12px;
  padding: 10px;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.difference-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 70px;
  justify-content: center;
  flex-shrink: 0;
}

.difference-bar-wrapper-compare {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.difference-bar-compare {
  position: relative;
  height: 30px;
  background: #e2e8f0;
  border-radius: 15px;
  overflow: hidden;
}

.difference-center-line-compare {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #cbd5e0;
  z-index: 2;
}

.difference-fill-compare {
  position: absolute;
  top: 0;
  bottom: 0;
  transition: all 0.3s ease;
  border-radius: 15px;
}

.difference-fill-compare.left {
  right: 50%;
  background: linear-gradient(90deg, var(--stat-color) 0%, var(--stat-color-dark) 100%);
}

.difference-fill-compare.right {
  left: 50%;
  background: linear-gradient(90deg, var(--stat-color-dark) 0%, var(--stat-color) 100%);
}

.difference-value-compare {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.difference-value-compare.left {
  text-align: left;
}

.difference-value-compare.right {
  text-align: right;
}

.difference-labels-compare {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.difference-label-compare {
  text-transform: capitalize;
}

/* Responsive Design */
@media (max-width: 1100px) {
  .comparison-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .comparison-column,
  .difference-column {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }
  
  .difference-column {
    order: 3;
  }
  
  .difference-spacer {
    display: none;
  }
}

/* Difference Winner Sprite */
.difference-winner-sprite {
  width: 60px;
  height: 60px;
  object-fit: contain;
  image-rendering: pixelated;
  margin: 0 auto;
  display: block;
  opacity: 0.9;
}

/* Searchable Dropdown Styling */
.searchable-dropdown {
  position: relative;
  width: 100%;
}

.pokemon-search-input {
  width: 100%;
  box-sizing: border-box;
}

.pokemon-search-input::placeholder {
  color: #a0aec0;
  opacity: 0.7;
}

/* Searchable Select Wrapper */
.searchable-select-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 15px;
}

.pokemon-search-box {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  font-size: 0.75rem;
  font-family: 'Press Start 2P', cursive;
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.pokemon-search-box:focus {
  outline: none;
  border-color: #667eea;
}

.pokemon-search-box::placeholder {
  color: #a0aec0;
  opacity: 0.7;
}

/* Adjust dropdown styling for visible list */
.pokemon-dropdown[size] {
  height: auto;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 0;
}

/* Custom Searchable Dropdown */
.custom-dropdown {
  position: relative;
  width: 100%;
  margin-top: 15px;
}

.custom-dropdown-selected {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  font-size: 0.75rem;
  font-family: 'Press Start 2P', cursive;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.custom-dropdown-selected:hover {
  border-color: #cbd5e0;
}

.dropdown-arrow {
  font-size: 0.6rem;
  transition: transform 0.3s ease;
}

.custom-dropdown-menu.open .custom-dropdown-selected .dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #667eea;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.custom-dropdown-menu.open {
  max-height: 400px;
  opacity: 1;
}

.dropdown-search {
  width: 100%;
  padding: 10px;
  border: none;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.75rem;
  font-family: 'Press Start 2P', cursive;
  color: var(--text-primary);
  box-sizing: border-box;
  outline: none;
}

.dropdown-search::placeholder {
  color: #a0aec0;
  opacity: 0.7;
}

.dropdown-options {
  max-height: 300px;
  overflow-y: auto;
  padding: 5px 0;
}

.dropdown-option {
  padding: 10px 15px;
  font-size: 0.7rem;
  font-family: 'Press Start 2P', cursive;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dropdown-option:hover {
  background-color: #f7fafc;
}

.dropdown-option:active {
  background-color: #e2e8f0;
}

/* Scrollbar styling for dropdown */
.dropdown-options::-webkit-scrollbar {
  width: 8px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: #f7fafc;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Restructured Stat Values Layout */
.metadata-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
}
/* Restructured Stat Values Layout */
.stat-values-compare {
  display: flex;
  position: relative;
  width: 100%;
  flex-shrink: 0;
  height: 70px;
  align-items: center;
}

.stat-metadata {
  position: absolute;
  left: 25%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.65rem;
}

.stat-main-value {
  position: absolute;
  left: 75%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
/* Restructured Stat Values Layout */
.stat-values-compare {
  display: flex;
  position: relative;
  width: 100%;
  flex-shrink: 0;
  height: 70px;
  align-items: center;
}

.stat-main-value {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-value-large {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.stat-label-small {
  font-size: 0.6rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.stat-metadata {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
}

.stat-metadata-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
}

.stat-metadata-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  left: 25%;
  transform: translateX(-50%);
}

.stat-values-compare .stat-main-value:last-child {
  position: absolute;
  left: 75%;
  transform: translateX(-50%);
}

/* Right side: value at 33%, metadata at 67% */
.stat-values-compare .stat-main-value:first-child {
  position: absolute;
  left: 25%;
  transform: translateX(-50%);
}

.stat-values-compare .stat-metadata:last-child {
  position: absolute;
  left: 75%;
  transform: translateX(-50%);
}

/* Game Appearances in Comparison Page */
.game-appearances-compare {
  margin-top: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.game-appearances-compare .generation-section {
  margin-bottom: 20px;
}

.game-appearances-compare .generation-section:last-child {
  margin-bottom: 0;
}

.game-appearances-compare .generation-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
  font-family: 'Press Start 2P', cursive;
}

.game-appearances-compare .game-item {
  display: block;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  font-size: 0.7rem;
  text-align: center;
  transition: background-color 0.2s ease;
}

.game-appearances-compare .game-item:last-child {
  margin-bottom: 0;
}

.game-appearances-compare .game-item.available {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

.game-appearances-compare .game-item.not-available {
  background: #e2e8f0;
  color: #a0aec0;
  text-decoration: line-through;
}

.game-appearances-compare .game-item:hover {
  opacity: 0.9;
}
