/**
 * Rating Pages - Modern Dark Theme Design
 * Inspired by CPU Database style
 */

/* ============================================
   PAGE HEADER
   ============================================ */
.rating-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-content {
  flex: 1;
}

.header-title {
  font-size: 2rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 0.25rem;
}

.header-title .accent {
  color: #00d4ff;
}

.header-title .accent.green {
  color: #00ff88;
}

.header-meta {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: 1px solid #00d4ff;
  border-radius: 8px;
  color: #00d4ff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-action:hover {
  background: rgba(0, 212, 255, 0.1);
}

.btn-action.green {
  border-color: #00ff88;
  color: #00ff88;
}

.btn-action.green:hover {
  background: rgba(0, 255, 136, 0.1);
}

.btn-action svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #64748b;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.search-box input::placeholder {
  color: #64748b;
}

.search-box input:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.filter-tabs-inline {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.25rem;
  border-radius: 8px;
}

.tab-btn {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.tab-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: #00d4ff;
  color: #0f172a;
}

.tab-btn.intel.active {
  background: #0071c5;
  color: #fff;
}

.tab-btn.amd.active {
  background: #ed1c24;
  color: #fff;
}

.tab-btn.nvidia.active {
  background: #76b900;
  color: #fff;
}

/* ============================================
   TOP CARDS GRID
   ============================================ */
.top-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 1100px) {
  .top-cards-grid {
    grid-template-columns: 1fr;
  }
}

.top-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.top-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.top-card.intel::before {
  background: linear-gradient(90deg, #0071c5, #00a8e8);
}

.top-card.amd::before {
  background: linear-gradient(90deg, #ed1c24, #ff6b6b);
}

.top-card.nvidia::before {
  background: linear-gradient(90deg, #76b900, #9be22d);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.rank-badge {
  padding: 0.25rem 0.75rem;
  background: rgba(0, 212, 255, 0.15);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #00d4ff;
}

.rank-badge.gold {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.15) 100%);
  color: #fbbf24;
}

.rank-badge.silver {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.rank-badge.bronze {
  background: rgba(217, 119, 6, 0.15);
  color: #f59e0b;
}

.price-tag {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.card-title a {
  color: #f1f5f9;
  text-decoration: none;
  transition: color 0.2s;
}

.card-title a:hover {
  color: #00d4ff;
}

.gpu-grid .card-title a:hover {
  color: #00ff88;
}

.card-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 1.25rem;
}

/* Specs Row */
.specs-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
}

.spec-item {
  flex: 1;
  text-align: center;
}

.spec-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.spec-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}

/* Score Section */
.score-section {
  margin-bottom: 1.25rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.score-label {
  font-size: 0.8rem;
  color: #94a3b8;
}

.score-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.score-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4ff, #00a8e8);
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

.score-bar.gpu .score-bar-fill {
  background: linear-gradient(90deg, #00ff88, #00cc6a);
}

/* Card Button */
.card-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  color: #00d4ff;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
}

.card-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
}

.card-btn.green {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.3);
  color: #00ff88;
}

.card-btn.green:hover {
  background: rgba(0, 255, 136, 0.2);
  border-color: #00ff88;
}

/* ============================================
   SPECS TABLE SECTION
   ============================================ */
.specs-table-section {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title svg {
  width: 22px;
  height: 22px;
  color: #00d4ff;
}

.section-title h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.result-count {
  font-size: 0.85rem;
  color: #64748b;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.specs-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.specs-table tbody tr {
  transition: background 0.15s;
}

.specs-table tbody tr:hover {
  background: rgba(0, 212, 255, 0.03);
}

.specs-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table Columns */
.col-rank {
  width: 70px;
}

.table-rank {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
}

.table-rank.top {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.model-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vendor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vendor-dot.intel {
  background: #0071c5;
}

.vendor-dot.amd {
  background: #ed1c24;
}

.vendor-dot.nvidia {
  background: #76b900;
}

.model-name {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.model-name:hover {
  color: #00d4ff;
}

.col-score {
  text-align: right;
}

.score-num {
  font-weight: 600;
  color: #f1f5f9;
}

.col-action {
  text-align: right;
}

.details-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: #00d4ff;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.details-link:hover {
  color: #00a8e8;
}

.details-link.green {
  color: #00ff88;
}

.details-link.green:hover {
  color: #00cc6a;
}

/* Table Pagination */
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.85rem;
  color: #64748b;
}

.pagination-btns {
  display: flex;
  gap: 0.5rem;
}

.page-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.page-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.page-btn.primary {
  background: #00d4ff;
  border-color: #00d4ff;
  color: #0f172a;
}

.page-btn.primary:hover {
  background: #00a8e8;
}

.page-btn.primary.green {
  background: #00ff88;
  border-color: #00ff88;
}

.page-btn.primary.green:hover {
  background: #00cc6a;
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] .rating-header .header-title {
  color: #1e293b;
}

[data-theme="light"] .filter-bar {
  background: #fff;
  border-color: #e2e8f0;
}

[data-theme="light"] .search-box input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .filter-tabs-inline {
  background: #f1f5f9;
}

[data-theme="light"] .tab-btn {
  color: #64748b;
}

[data-theme="light"] .tab-btn:hover {
  color: #1e293b;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .top-card {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .card-title a,
[data-theme="light"] .price-tag {
  color: #1e293b;
}

[data-theme="light"] .specs-row {
  background: #f8fafc;
}

[data-theme="light"] .spec-value,
[data-theme="light"] .score-value {
  color: #1e293b;
}

[data-theme="light"] .specs-table-section {
  background: #fff;
  border-color: #e2e8f0;
}

[data-theme="light"] .section-header {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .section-title h2 {
  color: #1e293b;
}

[data-theme="light"] .specs-table th {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .specs-table td {
  border-bottom-color: #f1f5f9;
}

[data-theme="light"] .specs-table tbody tr:hover {
  background: rgba(0, 212, 255, 0.03);
}

[data-theme="light"] .model-name {
  color: #1e293b;
}

[data-theme="light"] .score-num {
  color: #1e293b;
}

[data-theme="light"] .table-pagination {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .page-btn {
  background: #fff;
  border-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .page-btn:hover:not(.disabled) {
  background: #f1f5f9;
  color: #1e293b;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .rating-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-title {
    font-size: 1.5rem;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    min-width: 100%;
  }
  
  .filter-tabs-inline {
    justify-content: center;
  }
  
  .specs-row {
    flex-wrap: wrap;
  }
  
  .spec-item {
    min-width: 80px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .table-pagination {
    flex-direction: column;
    text-align: center;
  }
}
