/* ============================================
   Table & Filter Styles
   ============================================ */

/* === FILTER BAR === */
.filter-bar {
  background: var(--color-dark-card);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-md), var(--shadow-glow-gold);
  position: sticky;
  top: 80px;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.filter-select {
  padding: 0.625rem 1rem;
  border: 2px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  color: var(--color-white);
  background: rgba(26, 26, 46, 0.5);
  cursor: pointer;
  transition: all var(--transition-base);
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2), var(--shadow-glow-gold);
  background: rgba(26, 26, 46, 0.8);
}

.filter-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.filter-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  accent-color: var(--color-primary);
}

.filter-buttons {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.results-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--gradient-gold);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-dark);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

/* === COMPARISON TABLE === */
.table-wrapper {
  background: var(--color-dark-card);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
  overflow: hidden;
  margin-bottom: var(--spacing-xl);
  width: 100%;
  max-width: 100%;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.comparison-table thead {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
  color: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.comparison-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.comparison-table tbody tr {
  border-bottom: 1px solid rgba(251, 191, 36, 0.1);
  transition: all var(--transition-base);
  background: rgba(26, 26, 46, 0.3);
}

.comparison-table tbody tr:hover {
  background: rgba(251, 191, 36, 0.05);
  transform: scale(1.005);
  box-shadow: var(--shadow-md), 0 0 20px rgba(251, 191, 36, 0.1);
}

.comparison-table td {
  padding: 1.25rem 1rem;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.9);
}

.comparison-table td:last-child,
.comparison-table th:last-child {
  padding-right: 1.5rem;
}

/* Brand Column */
.brand-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 220px;
}

.brand-logo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--color-light);
  padding: 0.5rem;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.brand-info {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.brand-info h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.4);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-type {
  font-size: 0.75rem;
  color: var(--color-dark);
  background: var(--gradient-gold);
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  display: inline-block;
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3), 0 0 15px rgba(251, 191, 36, 0.2);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Rating Column */
.rating-cell {
  min-width: 120px;
}

.rating-stars {
  display: flex;
  gap: 0.25rem;
  font-size: 1.25rem;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.rating-score {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

/* Features Column */
.features-cell {
  min-width: 200px;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-dark-lighter);
  margin: 0;
}

.features-list li::before {
  content: "✓";
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 1.125rem;
}

/* Icon Badges */
.icon-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  transition: all var(--transition-base);
}

.icon-badge:hover {
  background: rgba(251, 191, 36, 0.2);
  color: var(--color-primary);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.icon-badge.active {
  background: var(--gradient-gold);
  color: var(--color-dark);
  border-color: transparent;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
  font-weight: 700;
}

/* Payment Icons */
.payment-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.payment-icon {
  width: 40px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray);
  border: 1px solid var(--color-gray-light);
}

/* Actions Column */
.actions-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 150px;
}

/* Sort Buttons */
.sort-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-white);
  font-weight: 600;
  transition: all var(--transition-base);
}

.sort-btn:hover {
  opacity: 0.8;
}

.sort-icon {
  font-size: 0.75rem;
}

/* === MOBILE CARDS (for responsive) === */
.table-cards {
  display: none;
  gap: var(--spacing-md);
}

.table-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.table-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-light);
}

.table-card-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.table-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.table-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.table-card-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray);
}

.table-card-value {
  font-weight: 600;
  color: var(--color-dark);
  text-align: right;
}

.table-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: var(--spacing-md);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .comparison-table {
    font-size: 0.875rem;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 0.875rem 0.75rem;
  }
  
  .brand-cell {
    min-width: 180px;
    gap: 0.75rem;
  }
  
  .brand-logo {
    width: 50px;
    height: 50px;
  }
  
  .brand-info h4 {
    font-size: 1.125rem;
  }
  
  .brand-type {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}

@media (max-width: 768px) {
  .filter-bar {
    position: static;
  }
  
  .filter-controls {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
    min-width: unset;
  }
  
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0.25rem;
  }
  
  .table-cards {
    display: none;
  }
  
  .table-wrapper {
    border-radius: 1rem;
    padding: 0.5rem;
  }
  
  .comparison-table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
  }
  
  .comparison-table thead th {
    border-radius: 0.75rem 0.75rem 0 0;
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
  }
  
  .comparison-table tbody tr {
    border-bottom: none;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  }
  
  .comparison-table tbody tr td {
    background: linear-gradient(135deg, rgba(38, 28, 26, 0.9) 0%, rgba(28, 20, 18, 0.95) 100%);
    padding: 1rem 1.25rem;
    border: 1px solid rgba(251, 191, 36, 0.12);
    border-left: none;
  }
  
  .comparison-table tbody tr td:first-child {
    border-radius: 0.75rem 0 0 0.75rem;
    border-left: 1px solid rgba(251, 191, 36, 0.12);
  }
  
  .comparison-table tbody tr td:last-child {
    border-radius: 0 0.75rem 0.75rem 0;
  }
  
  .comparison-table tbody tr:hover td {
    background: linear-gradient(135deg, rgba(48, 36, 34, 0.95) 0%, rgba(36, 26, 24, 0.98) 100%);
    border-color: rgba(251, 191, 36, 0.2);
  }
  
  .brand-logo {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(251, 191, 36, 0.15);
  }
  
  .brand-type {
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.35);
  }
  
  .rating-score {
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4));
  }
}

@media (max-width: 420px) {
  .btn, .btn-primary, .btn-outline {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .actions-cell .btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }
}

/* === LOADING STATE === */
.table-loading {
  display: none;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-xl);
  color: var(--color-gray);
}

.table-loading.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-gray-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* === EMPTY STATE === */
.table-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  text-align: center;
  color: var(--color-gray);
}

.table-empty.active {
  display: flex;
}

.table-empty-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.table-empty-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.5rem;
}

.table-empty-hint {
  color: var(--color-gray);
}
