/* ============================================================
   Car Review Detail Page
   ============================================================ */

/* Breadcrumb */
.breadcrumb {
  margin-bottom: var(--space-md);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin-left: var(--space-xs);
  color: var(--color-border);
}

.breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

/* Review Hero */
.review-hero {
  padding: var(--space-lg) 0 var(--space-xl);
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.review-hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
  margin-bottom: var(--space-lg);
}

.review-hero-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.review-hero-content h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0;
}

.review-hero-content h1 .year {
  font-weight: 400;
  color: var(--color-text-muted);
}

.title-score {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.title-score-circle {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.title-score-ring {
  width: 100%;
  height: 100%;
  display: block;
}

.title-score-track {
  fill: none;
  stroke: #E2E8F0;
  stroke-width: 7;
}

.title-score-progress {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dasharray 0.6s ease;
}

.title-score-circle.poor .title-score-progress { stroke: #EF4444; }
.title-score-circle.moderate .title-score-progress { stroke: #F59E0B; }
.title-score-circle.good .title-score-progress { stroke: #22C55E; }

.title-score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.title-score-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
}

.title-score-max {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.title-score-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.title-score-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.title-score-badge {
  font-size: 0.75rem;
  color: #22C55E;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  align-self: flex-start;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
}

.review-hero-desc {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  max-width: 560px;
  line-height: 1.5;
  margin-bottom: 0;
}

/* Verified Reports Widget */
.verified-reports-widget {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-sm);
  margin-top: var(--space-md);
}

.verified-reports-main {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.verified-reports-count {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.verified-reports-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.verified-reports-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  padding-left: var(--space-md);
  border-left: 1px solid var(--color-border);
}

/* Review Body Layout */
.review-body {
  padding: var(--space-xl) 0;
}

.review-body-inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-2xl);
  align-items: start;
}

/* Tabs */
.detail-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.tab-btn {
  padding: 0.65rem 0.9rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Detail Cards */
.detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.detail-card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.link-arrow {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.link-arrow::after {
  content: ' →';
}

.link-arrow:hover {
  text-decoration: underline;
}

/* Parts List */
.parts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

.part-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.part-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.part-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.part-reports {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Engine Reliability Table */
.engine-table-wrap {
  overflow-x: auto;
}

.engine-group {
  margin-bottom: var(--space-lg);
}

.engine-group:last-child {
  margin-bottom: 0;
}

.engine-group-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-sm);
  padding: 0 0.75rem;
}

.engine-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.engine-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.engine-table tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

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

.engine-table .engine-name {
  font-weight: 600;
  white-space: nowrap;
}

.engine-table .engine-score-value {
  font-weight: 700;
  white-space: nowrap;
}

.engine-table .engine-score-value.good { color: #22C55E; }
.engine-table .engine-score-value.moderate { color: #F59E0B; }
.engine-table .engine-score-value.poor { color: #EF4444; }

.engine-table .engine-reports {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.engine-table .engine-issues {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.engine-reveal-row td {
  padding: 0;
  border-bottom: none;
}

.engine-reveal {
  margin: 0;
}

.engine-reveal summary {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.engine-reveal summary::-webkit-details-marker {
  display: none;
}

.engine-reveal summary::before {
  content: '+';
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.engine-reveal[open] summary::before {
  content: '−';
}

.engine-reveal summary:hover {
  color: var(--color-primary-hover, var(--color-primary));
}

.engine-table-nested {
  margin-top: 0.25rem;
}

.engine-table-nested tbody td {
  border-bottom: 1px solid var(--color-border-light);
}

.engine-table-nested tbody tr:last-child td {
  border-bottom: none;
}

/* Reviews */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.review-item {
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border-light);
}

.review-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.review-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.review-author {
  font-weight: 700;
  font-size: 0.95rem;
}

.review-verified {
  font-size: 0.75rem;
  color: #22C55E;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.review-rating {
  display: flex;
  gap: 0.1rem;
}

.star {
  color: var(--color-border);
  font-size: 1rem;
}

.star.filled {
  color: #F59E0B;
}

.review-tags {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.review-tag {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.review-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.review-body-text {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.review-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  font-size: 0.9rem;
}

.pros-cons-block strong {
  display: block;
  margin-bottom: 0.2rem;
}

.pros strong { color: #22C55E; }
.cons strong { color: #EF4444; }

.pros-cons-block span {
  color: var(--color-text-secondary);
}

/* Alternatives */
.alternatives-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.alternative-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.alt-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.alt-years {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Sidebar */
.review-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.sidebar-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.sidebar-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-md);
}

.cta-card {
  text-align: center;
}

.cta-icon {
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.btn-block {
  width: 100%;
}

.cta-privacy {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
  margin-bottom: 0;
}

.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about-list li strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.about-list li p {
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* Bottom CTA */
.bottom-cta {
  padding: var(--space-2xl) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
}

.bottom-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
}

.bottom-cta-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.bottom-cta-content p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* Detail Page Responsive */
@media (max-width: 1024px) {
  .review-hero-inner {
    grid-template-columns: 1fr;
  }

  .review-body-inner {
    grid-template-columns: 1fr;
  }

  .review-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .engine-table .engine-name {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .review-hero-content h1 {
    font-size: 1.65rem;
  }

  .review-hero-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .verified-reports-widget {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .verified-reports-text {
    padding-left: 0;
    border-left: none;
  }

  .detail-tabs {
    gap: 0;
  }

  .tab-btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  .parts-list {
    grid-template-columns: 1fr;
  }

  .review-pros-cons {
    grid-template-columns: 1fr;
  }

  .review-sidebar {
    grid-template-columns: 1fr;
  }

  .bottom-cta-inner {
    flex-direction: column;
    text-align: center;
  }

  .engine-table thead {
    display: none;
  }

  .engine-table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    border-bottom: none;
  }

  .engine-table tbody tr {
    display: block;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
  }

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

  .engine-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
  }

  .engine-group-heading {
    padding: 0 0.5rem;
  }

  .engine-reveal summary {
    padding: 0.5rem;
  }

  .engine-table-nested tbody tr {
    padding: var(--space-xs) 0;
  }

}

