/* ==============================
   Comparison Table - Wrapper & Table
   ============================== */
#comparison-table-wrapper {
  background: #111;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  padding: 0;
}

#comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #111;
  color: #aaa;
}

.comparison-summary {
  margin: 0 0 1rem;
  padding: 1rem;
  background: #101827;
  border: 1px solid rgba(153, 216, 255, 0.28);
  border-radius: 8px;
  color: #e5e7eb;
}

.comparison-summary-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 1.5rem;
  color: #e5e7eb;
  font-size: 0.875rem;
}

.comparison-summary-spinner {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid #99d8ff;
  border-top-color: #152fa3;
  border-radius: 50%;
  animation: comparison-summary-spin 0.8s linear infinite;
}

@keyframes comparison-summary-spin {
  to {
    transform: rotate(360deg);
  }
}

.comparison-summary-title {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.comparison-summary-intro {
  margin: 0.25rem 0 0.85rem;
  color: #b9c3d4;
  font-size: 0.875rem;
}

.comparison-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.comparison-summary-item {
  min-width: 0;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.comparison-summary-item h3 {
  margin: 0 0 0.35rem;
  color: #99d8ff;
  font-size: 0.875rem;
  font-weight: 700;
}

.comparison-summary-item p {
  margin: 0;
  color: #d5d9e2;
  font-size: 0.875rem;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .comparison-summary {
    padding: 0.85rem;
  }

  .comparison-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   Table Headings & Cells
   ============================== */
#comparison-table th,
#comparison-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #222;
  color: #aaa;
  background: #111;
  /* === Force top alignment for all cells === */
  vertical-align: top;
}

#comparison-table th {
  background: #1b1b1b;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  border-bottom: 2px solid #333;
  position: relative;
}

#comparison-table tr:first-child th {
  background: #232323;
}

#comparison-table tr td:first-child {
  background: #191919;
  font-weight: 600;
  color: #aaa;
  text-align: left;
  min-width: 170px;
  border-right: 1px solid #222;
}


#comparison-table tr:hover td {
  background: #181a1b;
  color: #fff;
}

#comparison-table tr td {
  text-align: center;
  color: #aaa;
  background: #111;
}

/* ==============================
   Thumbnail, Floating X (Remove)
   ============================== */
.thumbnail-header {
  text-align: center;
  position: relative;
  padding-top: 10px;
  padding-bottom: 10px;
  display: block;
}

/* --- Thumbnail image & close button wrapper --- */
.thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin-bottom: 0.4em;
}

/* --- Car Thumbnail Image --- */
.compare-thumb-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  background: #222;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  object-fit: contain;
}

/* --- Floating X Remove Button --- */
.remove-col-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  color: #ef4444;
  border: 2px solid #ef4444;
  font-size: 1.35rem;
  font-family: Arial, sans-serif;
  font-weight: 700;
  width: 1.8em;
  height: 1.8em;
  line-height: 1.6em;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  opacity: 0.96;
  box-shadow: 1px 1px 6px rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s, color 0.16s, opacity 0.18s;
}

.remove-col-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  opacity: 1;
}

.remove-col-btn span {
  display: block;
  font-size: 1.05em;
  pointer-events: none;
}

/* ==============================
   Car Title (Brand, Model, Variant)
   ============================== */
#comparison-table .car-title {
  font-size: 1rem;
  font-weight: 600;
  color: #eee;
  white-space: normal !important;
  word-break: break-word;
  margin-bottom: 0.25em;
  line-height: 1.25;
  text-align: center;
  max-width: 180px;
  margin-left: auto;
  margin-right: auto;
}

/* ==============================
   Responsive: Mobile adjustments
   ============================== */
@media (max-width: 700px) {
  #comparison-table th,
  #comparison-table td {
    padding: 7px 3px;
    font-size: 0.95em;
  }
  .thumb-wrap, .compare-thumb-img {
    max-width: 64px !important;
    width: 64px !important;
    height: auto !important;
  }
  .remove-col-btn {
    font-size: 1rem;
    width: 1.4em;
    height: 1.4em;
    top: 5px;
    right: 5px;
    line-height: 1.2em;
  }
  #comparison-table .car-title {
    font-size: 0.95em;
    max-width: 95px;
  }
}

.comparison-table td .group {
  position: relative;
  display: inline-block;
}
.comparison-table .fa-circle-info {
  cursor: pointer;
}
.comparison-table .group .tooltip {
  display: none;
  position: absolute;
  left: 105%; /* Show to the right of the icon */
  top: 50%;
  transform: translateY(-50%);
  min-width: 200px;
  max-width: 280px;
  z-index: 30;
  background: #232c36;
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
  white-space: normal;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}
.comparison-table .group:hover .tooltip,
.comparison-table .group:focus-within .tooltip {
  display: block;
}
@media (max-width: 800px) {
  .comparison-table .group .tooltip {
    left: 0;
    top: 120%;
    transform: none;
    min-width: 170px;
    max-width: 95vw;
  }
}

