/* ==========================================================================
   KickAssCars.com -Car Detail Page
   ========================================================================== */

/* ── Hero Image ─────────────────────────────────────────────────────────── */

.car-hero {
  width: 100%;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  background-color: var(--surface);
}

.car-hero img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  transition: transform var(--transition-slow);
}

.car-hero:hover img {
  transform: scale(1.02);
}

/* ── Thumbnail Strip ────────────────────────────────────────────────────── */

.car-photo-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: var(--space-md);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.car-photo-grid::-webkit-scrollbar {
  height: 6px;
}

.car-photo-grid::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 3px;
}

.thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  overflow: hidden;
  flex-shrink: 0;
  transition: opacity var(--transition-base), border-color var(--transition-base);
}

.thumb:hover {
  opacity: 0.85;
}

.thumb.active {
  opacity: 1;
  border-color: var(--primary);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Detail Content Layout ──────────────────────────────────────────────── */

.car-detail-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-xl);
}

@media (max-width: 1024px) {
  .car-detail-content {
    grid-template-columns: 1fr;
  }
}

/* ── Main Column ────────────────────────────────────────────────────────── */

.car-info {
  min-width: 0;
}

.car-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.car-info-header h1 {
  font-size: 2rem;
  margin: 0;
}

.car-year-make {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

/* ── Specs Grid ─────────────────────────────────────────────────────────── */

.car-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  padding: var(--space-lg);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

@media (max-width: 640px) {
  .car-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.spec {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
}

/* ── Description ────────────────────────────────────────────────────────── */

.car-description {
  margin-top: var(--space-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.car-description p {
  margin-bottom: var(--space-md);
}

/* ── Mods List ──────────────────────────────────────────────────────────── */

.car-mods {
  margin-top: var(--space-xl);
}

.car-mods h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--text);
}

.car-mods ul {
  list-style: none;
  padding: 0;
}

.car-mods ul li {
  position: relative;
  padding-left: var(--space-lg);
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: var(--leading-normal);
}

.car-mods ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
}

/* ── Actions ────────────────────────────────────────────────────────────── */

.car-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.car-author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
  transition: color var(--transition-base);
}

.car-author:hover {
  color: var(--text);
  text-decoration: none;
}

.car-author .avatar {
  width: 32px;
  height: 32px;
}

.liked {
  color: var(--primary) !important;
}

.liked .icon-heart {
  color: var(--primary);
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.comments-section h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.comment-form .form-textarea {
  min-height: 80px;
}

.comment {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.comment:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: 2px;
}

.comment-author {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.comment-body {
  margin: 2px 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 4px;
}

.comment-actions button {
  font-size: 0.75rem;
  color: var(--text-subtle);
  cursor: pointer;
  transition: color var(--transition-base);
}

.comment-actions button:hover {
  color: var(--text);
}

.comment-replies {
  margin-left: 24px;
  border-left: 2px solid var(--border);
  padding-left: 12px;
}

.comment-replies .comment {
  padding: var(--space-sm) 0;
}

.comment-replies .comment:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-lightbox);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.lightbox.show {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color var(--transition-base);
  border: none;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color var(--transition-base);
  border: none;
}

.lightbox-nav:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

/* ==========================================================================
   Upload Zone
   ========================================================================== */

.upload-zone {
  border: 2px dashed var(--border-strong);
  padding: var(--space-xl);
  text-align: center;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition-base), background-color var(--transition-base);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.upload-zone:hover {
  border-color: var(--text-subtle);
}

.upload-zone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-muted);
  color: var(--text);
}

.upload-zone-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  color: var(--text-subtle);
}

.upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.upload-previews .preview-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.upload-previews .preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-previews .preview-thumb .preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-base);
}

.upload-previews .preview-thumb .preview-remove:hover {
  background-color: var(--error);
}

.upload-preview-item {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 2px solid var(--border);
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-preview-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 4px;
  font-size: 0.625rem;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.upload-preview-status.success {
  background-color: var(--success);
}

.upload-preview-status.error {
  background-color: var(--error);
}

/* ==========================================================================
   Build Section
   ========================================================================== */

.car-build-section {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.car-build-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.car-build-header h3 {
  font-size: 1.25rem;
  margin: 0;
}

.car-build-traction {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.car-build-parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
}

.car-build-parts-table th {
  text-align: left;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.car-build-parts-table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.car-build-parts-table .gain-hp {
  color: var(--success);
  font-weight: 600;
}

.car-build-parts-table .gain-tq {
  color: var(--info);
  font-weight: 600;
}

.car-build-parts-table a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.car-build-parts-table a:hover {
  text-decoration: underline;
}

.car-build-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (max-width: 640px) {
  .car-build-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.car-build-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-md);
  background-color: var(--surface);
  border-radius: var(--radius-md);
}

.car-build-stat-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
}

.car-build-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.car-build-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.car-build-link {
  margin-top: var(--space-xl);
}
