/* ================================================================================
   PRICING PAGE — COMPARISON SECTION
================================================================================ */

#pricing-comparison {
  position: relative;
  contain: layout;
}

.comparison-title {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .comparison-title {
    font-size: 2.5rem;
    white-space: nowrap;
  }
}

@media (min-width: 1024px) {
  .comparison-title {
    font-size: 3rem;
  }
}

.comparison-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.55;
}

/* ================================================================================
   TABLE WRAPPER (glassmorphism card)
================================================================================ */

.comparison-table-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 20px;
  background: linear-gradient(170deg, rgba(30, 35, 60, 0.5) 0%, rgba(15, 23, 42, 0.65) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* ================================================================================
   TABLE BASE
================================================================================ */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  color: #e5e7eb;
  font-size: 0.95rem;
}

.comparison-table thead th {
  padding: 1.5rem 1rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 700;
  vertical-align: top;
}

.comparison-feature-col {
  text-align: left !important;
  width: 34%;
}

.comparison-plan-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.comparison-plan-price {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 500;
}

.comparison-plan-amount {
  font-weight: 800;
  color: #ffffff;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.comparison-plan-amount::before {
  content: '';
}

.comparison-plan-amount::after {
  content: ' €';
  color: #cbd5e1;
  font-weight: 700;
}

.comparison-plan-price--custom {
  font-size: 0.95rem;
  color: #ffffff;
  font-weight: 700;
}

.comparison-popular-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

/* Highlight the popular column */
.comparison-col-popular {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
  position: relative;
}

.comparison-table thead .comparison-col-popular {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.18) 0%, rgba(99, 102, 241, 0.08) 100%);
  border-left: 1px solid rgba(167, 139, 250, 0.25);
  border-right: 1px solid rgba(167, 139, 250, 0.25);
}

/* Body rows */
.comparison-table tbody th {
  text-align: left;
  font-weight: 500;
  padding: 1rem 1.25rem;
  color: #d1d5db;
  background: transparent;
  line-height: 1.4;
}

.comparison-table tbody td {
  padding: 1rem 1.25rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
  color: #e5e7eb;
}

.comparison-table tbody th {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.comparison-table tbody tr:hover th,
.comparison-table tbody tr:hover td {
  background: rgba(139, 92, 246, 0.05);
}

.comparison-table tbody .comparison-col-popular {
  border-left: 1px solid rgba(167, 139, 250, 0.25);
  border-right: 1px solid rgba(167, 139, 250, 0.25);
}

/* Group rows */
.comparison-group-row th {
  background: rgba(15, 23, 42, 0.85) !important;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #a5b4fc !important;
  font-weight: 700;
  padding: 1rem 1.25rem !important;
  border-top: 1px solid rgba(167, 139, 250, 0.25) !important;
}

/* Icons (check / dash) */
.comparison-check {
  color: #22d3ee;
  font-size: 1rem;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.45));
}

.comparison-dash {
  color: #6b7280;
  font-size: 0.75rem;
  opacity: 0.75;
}

/* ================================================================================
   TEMPORAIRE — Flou sur les colonnes Pro (3e) & Enterprise (4e) en attente de leur sortie
   À retirer lorsque les offres seront disponibles
================================================================================ */

/* Colonnes Pro & Enterprise dans le thead (via classe) */
.comparison-table thead .comparison-col-blurred {
  filter: blur(3px);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

/* Colonnes Pro & Enterprise dans le tbody via nth-child (3e et 4e td) */
.comparison-table tbody tr td:nth-child(3),
.comparison-table tbody tr td:nth-child(4) {
  filter: blur(3px);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

/* ================================================================================
   RESPONSIVE
================================================================================ */

@media (max-width: 768px) {
  .comparison-table-wrapper {
    overflow-x: auto;
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .comparison-table {
    min-width: 720px;
    font-size: 0.88rem;
  }

  .comparison-table thead th,
  .comparison-table tbody th,
  .comparison-table tbody td {
    padding: 0.9rem 0.75rem;
  }

  .comparison-plan-label {
    font-size: 0.95rem;
  }
}

/* ==== TRANSCRIPTION TOOLTIP ==== */
.comparison-tooltip-wrapper {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

.comparison-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.25);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: #a78bfa !important;
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  line-height: 1;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Decorative info glyph — rendered in CSS (not as HTML text) so it stays a
   presentational mark, not localizable copy. The button carries its accessible
   name via data-translate-attr=aria-label. Shared by ComparisonSection and
   PlansSection (both reuse .comparison-tooltip-icon). */
.comparison-tooltip-icon::before {
  content: 'i';
}

/* Hover réservé aux devices avec vraie souris (pas touch) */
@media (hover: hover) {
  .comparison-tooltip-icon:hover {
    background: rgba(139, 92, 246, 0.45);
    transform: scale(1.15);
  }
}

.comparison-tooltip-icon:focus-visible {
  background: rgba(139, 92, 246, 0.45);
  outline: 2px solid rgba(139, 92, 246, 0.6);
  outline-offset: 2px;
}

.comparison-tooltip-content {
  position: absolute;
  /* Sits flush against the icon — the ::before bridge covers the gap */
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  z-index: 200;
  pointer-events: none;
  white-space: nowrap;
  padding: 10px 14px;
  background: #1e1b2e;
  color: #e5e7eb !important;
  font-size: 13px;
  font-weight: 400;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Transparent bridge between icon and pill — prevents hover gap */
.comparison-tooltip-content::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
}

/* Arrow pointing down */
.comparison-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(139, 92, 246, 0.3);
}

.comparison-tooltip-before {
  margin-right: 0.25em;
}

.comparison-tooltip-link {
  color: #a78bfa !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.comparison-tooltip-link:hover {
  color: #c4b5fd !important;
}

/* Desktop (souris uniquement) : show on hover du wrapper entier */
@media (hover: hover) and (min-width: 769px) {
  .comparison-tooltip-wrapper:hover .comparison-tooltip-content {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
  }
}

/* Mobile: popover fixe attaché au body (échappe overflow de la table) */
.comparison-tooltip--mobile-fixed {
  position: fixed !important;
  transform: none !important;
  bottom: auto !important;
  border-radius: 12px;
  white-space: normal !important;
  text-align: left;
  line-height: 1.45;
  padding: 14px 16px !important;
  font-size: 14px !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55) !important;
  animation: comparisonTooltipIn 0.18s ease-out;
}

@keyframes comparisonTooltipIn {
  from {
    opacity: 0;
    transform: translateY(-4px) !important;
  }
  to {
    opacity: 1;
    transform: translateY(0) !important;
  }
}

/* Flèche désactivée et bridge masqué en mode fixed */
.comparison-tooltip--mobile-fixed::after,
.comparison-tooltip--mobile-fixed::before {
  display: none;
}

/* Backdrop semi-opaque pour focus + fermeture au tap extérieur */
.comparison-tooltip-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(9, 5, 24, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: comparisonBackdropIn 0.18s ease-out;
}

@keyframes comparisonBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
