/* Data Page Specific Styles */

.filters-section {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  margin-top: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.filters-title {
  font-size: 1.2rem;
  font-family: 'Press Start 2P', cursive;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
}

.filters-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
  font-style: italic;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #edf2f7;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e0;
  transition: box-shadow 0.2s ease;
}

.filter-group:hover {
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.filter-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Press Start 2P', cursive;
  line-height: 1.2;
}

.filter-input {
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: border-color 0.2s;
}

.filter-input:focus {
  outline: none;
  border-color: #667eea;
}

/* Filter Dropdown */
.filter-dropdown {
  position: relative;
}

.filter-dropdown-button {
  width: 100%;
  padding: 10px 12px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s;
}

.filter-dropdown-button:hover {
  border-color: #667eea;
}

.filter-dropdown-button.open {
  border-color: #667eea;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.filter-dropdown-text {
  flex: 1;
  text-align: left;
  color: var(--text-primary);
}

.filter-dropdown-arrow {
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.filter-dropdown-button.open .filter-dropdown-arrow {
  transform: rotate(180deg);
}

.filter-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #667eea;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-dropdown-menu.open {
  display: block;
}

.dropdown-search-input {
  width: 100%;
  padding: 10px;
  border: none;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  outline: none;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.dropdown-search-input:focus {
  border-bottom-color: #667eea;
}

.filter-checkbox-list {
  padding: 10px;
  max-height: 250px;
  overflow-y: auto;
}

.filter-checkbox-item {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.2s;
}

.filter-checkbox-item:hover {
  background-color: #f7fafc;
}

.filter-checkbox-item input[type="checkbox"] {
  margin-right: 10px;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.filter-checkbox-item label {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-primary);
  flex: 1;
}

/* Range Sliders */
.range-slider-container {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.range-slider {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid #667eea;
  cursor: pointer;
  transition: transform 0.2s;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid #667eea;
  cursor: pointer;
  transition: transform 0.2s;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Filter Actions */
.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 15px;
}

.btn-reset {
  padding: 12px 24px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-reset:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-reset:active {
  transform: translateY(0);
}

.results-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.results-count span {
  font-weight: 700;
  color: #667eea;
  font-size: 0.85rem;
}

/* Data Table */
.data-table-section {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  box-shadow: var(--shadow);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.table-container {
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 10px;
  max-height: 800px; /* Shows approximately 20 Pokemon rows */
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.data-table thead {
  background: #718096;
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th {
  padding: 15px 12px;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  user-select: none;
}

.data-table th.sortable {
  cursor: pointer;
  transition: background-color 0.2s;
}

.data-table th.sortable:hover {
  background: #5a6c7d;
}

.sort-indicator {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.7rem;
  opacity: 0.5;
}

.data-table th.sorted-asc .sort-indicator::after {
  content: '▲';
  opacity: 1;
}

.data-table th.sorted-desc .sort-indicator::after {
  content: '▼';
  opacity: 1;
}

.data-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.2s;
}

.data-table tbody tr:hover {
  background-color: #f7fafc;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table td {
  padding: 12px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table td:first-child {
  font-weight: 700;
}

/* Pokemon Name Cell with Sprite */
.pokemon-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pokemon-sprite-small {
  width: 30px;
  height: 30px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.pokemon-name {
  text-transform: capitalize;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Type Badges in Table - uses type-badge classes from styles.css */
.data-table .type-badge {
  font-size: 0.65rem;
  padding: 4px 8px;
}

.loading-cell {
  text-align: center;
  padding: 40px !important;
  color: var(--text-secondary);
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn-reset {
    width: 100%;
  }
  
  .results-count {
    text-align: center;
  }
  
  .table-container {
    overflow-x: scroll;
  }
  
  .data-table {
    min-width: 900px;
  }
}
