/* ===== Module-Based Pricing System ===== */
.premium-pricing-section {
  background: #f8fafc;
  padding: 80px 0;
  margin-top: 100px;
  color: #334155;
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  position: relative;
}

.premium-pricing-section .section-title h2 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  color: #223a58;
  margin-bottom: 20px;
}

.premium-pricing-section .section-title p {
  color: #64748b;
  font-size: 1.1rem;
}

/* ===== Module Cards Grid ===== */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

.module-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.module-card.active {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(19, 106, 213, 0.15);
}

/* Module color themes */
.module-card[data-module="sil"] { border-top: 4px solid #f63b99; }
.module-card[data-module="sil"].active { border-color: #f63b99; background: linear-gradient(180deg, rgba(59,130,246,0.04) 0%, #fff 100%); }

.module-card[data-module="imagerie"] { border-top: 4px solid #8b5cf6; }
.module-card[data-module="imagerie"].active { border-color: #8b5cf6; background: linear-gradient(180deg, rgba(139,92,246,0.04) 0%, #fff 100%); }

.module-card[data-module="echo"] { border-top: 4px solid #10b981; }
.module-card[data-module="echo"].active { border-color: #10b981; background: linear-gradient(180deg, rgba(16,185,129,0.04) 0%, #fff 100%); }

.module-card[data-module="echo-sonde"] { border-top: 4px solid #f59e0b; }
.module-card[data-module="echo-sonde"].active { border-color: #f59e0b; background: linear-gradient(180deg, rgba(245,158,11,0.04) 0%, #fff 100%); }

.module-card[data-module="ecg"] { border-top: 4px solid #ef4444; }
.module-card[data-module="ecg"].active { border-color: #ef4444; background: linear-gradient(180deg, rgba(239,68,68,0.04) 0%, #fff 100%); }

.module-card[data-module="spiro"] { border-top: 4px solid #06b6d4; }
.module-card[data-module="spiro"].active { border-color: #06b6d4; background: linear-gradient(180deg, rgba(6,182,212,0.04) 0%, #fff 100%); }

.module-card[data-module="pack-base"] { border-top: 4px solid #2563eb; }
.module-card[data-module="pack-base"].active { border-color: #2563eb; background: linear-gradient(180deg, rgba(37,99,235,0.06) 0%, #fff 100%); }



/* Module icon */
.module-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.6rem;
  margin-bottom: 14px;
  transition: all 0.3s ease;
}

.module-card[data-module="sil"] .module-icon { background: rgba(59,130,246,0.1); color: #f63b99; }
.module-card[data-module="imagerie"] .module-icon { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.module-card[data-module="echo"] .module-icon { background: rgba(16,185,129,0.1); color: #10b981; }
.module-card[data-module="echo-sonde"] .module-icon { background: rgba(245,158,11,0.1); color: #f59e0b; }
.module-card[data-module="ecg"] .module-icon { background: rgba(239,68,68,0.1); color: #ef4444; }
.module-card[data-module="spiro"] .module-icon { background: rgba(6,182,212,0.1); color: #06b6d4; }
.module-card[data-module="pack-base"] .module-icon { background: rgba(37,99,235,0.1); color: #2563eb; }

.module-card:hover .module-icon,
.module-card.active .module-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Module name */
.module-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  line-height: 1.3;
}

.module-subtitle {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 12px;
  font-weight: 500;
}

/* Module price */
.module-price,
.module-price-usd,
.price-amount,
.price-currency,
.price-usd,
.pricing-comparison-table tfoot tr:first-child {
  display: none !important;
}

/* Module meta info */
.module-meta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.module-meta span {
  font-size: 0.68rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.module-meta span i {
  font-size: 0.75rem;
}

/* Click hint */
.module-click-hint {
  font-size: 0.7rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.3s ease;
}

.module-card:hover .module-click-hint,
.module-card.active .module-click-hint {
  color: #3b82f6;
}

/* CTA button */
.module-cta {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.75rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  transition: all 0.3s ease;
  margin-top: 12px;
}

.module-card[data-module="sil"] .module-cta { background: #f63b99; }
.module-card[data-module="sil"] .module-cta:hover { background: #f63b99; }
.module-card[data-module="imagerie"] .module-cta { background: #8b5cf6; }
.module-card[data-module="imagerie"] .module-cta:hover { background: #7c3aed; }
.module-card[data-module="echo"] .module-cta { background: #10b981; }
.module-card[data-module="echo"] .module-cta:hover { background: #059669; }
.module-card[data-module="echo-sonde"] .module-cta { background: #f59e0b; }
.module-card[data-module="echo-sonde"] .module-cta:hover { background: #d97706; }
.module-card[data-module="ecg"] .module-cta { background: #ef4444; }
.module-card[data-module="ecg"] .module-cta:hover { background: #dc2626; }
.module-card[data-module="spiro"] .module-cta { background: #06b6d4; }
.module-card[data-module="spiro"] .module-cta:hover { background: #0891b2; }

.module-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #fff;
}

/* ===== Feature Detail Panel ===== */
.module-detail-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin 0.4s ease;
  opacity: 0;
  margin-top: 0;
  border-radius: 16px;
  scroll-margin-top: 100px;
}

.module-detail-panel.open {
  max-height: 2000px;
  opacity: 1;
  margin-top: 20px;
}

.module-detail-panel[data-module="pack-base"].open {
  max-height: 4000px;
}

.module-detail-inner {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.module-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
}

.module-detail-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #223a58;
}

.module-detail-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.module-detail-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #64748b;
  transition: all 0.2s ease;
}

.module-detail-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Feature categories grid */
.features-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.feature-category {
  background: #fafbfd;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 18px;
  transition: all 0.3s ease;
}

.feature-category:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.feature-category-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-category-name i {
  color: #10b981;
  font-size: 0.9rem;
}

.feature-category-desc {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.5;
}

/* Color-coded category icons per module */
.module-detail-panel[data-module="sil"] .feature-category-name i { color: #f63b99; }
.module-detail-panel[data-module="imagerie"] .feature-category-name i { color: #8b5cf6; }
.module-detail-panel[data-module="echo"] .feature-category-name i { color: #10b981; }
.module-detail-panel[data-module="echo-sonde"] .feature-category-name i { color: #f59e0b; }
.module-detail-panel[data-module="ecg"] .feature-category-name i { color: #ef4444; }
.module-detail-panel[data-module="spiro"] .feature-category-name i { color: #06b6d4; }

/* Detail panel border-top color */
.module-detail-panel[data-module="sil"] .module-detail-inner { border-top: 3px solid #f63b99; }
.module-detail-panel[data-module="imagerie"] .module-detail-inner { border-top: 3px solid #8b5cf6; }
.module-detail-panel[data-module="echo"] .module-detail-inner { border-top: 3px solid #10b981; }
.module-detail-panel[data-module="echo-sonde"] .module-detail-inner { border-top: 3px solid #f59e0b; }
.module-detail-panel[data-module="ecg"] .module-detail-inner { border-top: 3px solid #ef4444; }
.module-detail-panel[data-module="spiro"] .module-detail-inner { border-top: 3px solid #06b6d4; }

/* ===== Responsive ===== */
@media (max-width: 991px) {
  .modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-categories {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }
  .module-detail-inner {
    padding: 20px 16px;
  }
  .premium-pricing-section {
    padding: 60px 0;
  }
}

/* ===== Comparison Table (inside pack-base panel) ===== */
.pricing-table-wrapper {
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  -webkit-overflow-scrolling: touch;
  padding-top: 15px; /* Give vertical space for floating badge */
  margin-top: -15px; /* Offset the padding visually */
}

.pricing-comparison-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: #fff;
  border-radius: 16px;
  /* overflow: hidden; removed to let badge escape top border */
}

.pricing-comparison-table thead th {
  padding: 12px 10px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  border: none;
  position: relative;
}

.pricing-comparison-table thead th:first-child {
  background: #223a58;
  text-align: left;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  border-radius: 16px 0 0 0;
  min-width: 220px;
}

.pricing-comparison-table thead th.plan-starter { background: #3b82f6; }
.pricing-comparison-table thead th.plan-team { background: #ef4444; }
.pricing-comparison-table thead th.plan-clinic { background: #10b981; }
.pricing-comparison-table thead th.plan-center { background: #8b5cf6; }
.pricing-comparison-table thead th.plan-hospital { background: #f59e0b; }
.pricing-comparison-table thead th.plan-enterprise { background: #6366f1; border-radius: 0 16px 0 0; }

.plan-name {
  display: block;
}

.plan-posts {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
  text-transform: none;
}

.pricing-comparison-table thead th .th-recommended {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #fff;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  white-space: nowrap;
  z-index: 10;
}

.pricing-comparison-table tbody td {
  padding: 10px 12px;
  text-align: center;
  font-size: 0.8rem;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  transition: background 0.2s ease;
}

.pricing-comparison-table tbody tr:hover td { background: #f8fafc; }
.pricing-comparison-table tbody tr:nth-child(even) td { background: #fafbfd; }
.pricing-comparison-table tbody tr:nth-child(even):hover td { background: #f1f5f9; }

.pricing-comparison-table tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: #334155;
  min-width: 220px;
}

.pricing-comparison-table tbody td:first-child .feature-name {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  color: #1e293b;
  margin-bottom: 2px;
}

.pricing-comparison-table tbody td:first-child .feature-desc {
  display: block;
  font-weight: 400;
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.3;
}

.pricing-comparison-table .icon-check { color: #10b981; font-size: 1.1rem; }
.pricing-comparison-table .icon-cross { color: #e2e8f0; font-size: 1.1rem; }

.pricing-comparison-table tfoot td {
  padding: 14px 12px;
  text-align: center;
  border-top: 2px solid #e2e8f0;
  background: #fafbfd;
  vertical-align: middle;
}

.pricing-comparison-table tfoot td:first-child {
  text-align: left;
  font-weight: 800;
  font-size: 0.85rem;
  color: #223a58;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-amount {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #223a58;
  line-height: 1.2;
}

.price-currency {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  vertical-align: super;
}

.price-usd {
  display: block;
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 2px;
}

.pricing-comparison-table .cta-row td {
  padding: 14px 12px;
  border-top: 2px solid #e2e8f0;
  background: #fafbfd;
  border-bottom: none;
}

.pricing-comparison-table .cta-row td:first-child { border-radius: 0 0 0 16px; }
.pricing-comparison-table .cta-row td:last-child { border-radius: 0 0 16px 0; }

.btn-pricing {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-pricing:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-starter { background: #3b82f6; color: #fff; }
.btn-starter:hover { background: #2563eb; color: #fff; }
.btn-team { background: #ef4444; color: #fff; }
.btn-team:hover { background: #dc2626; color: #fff; }
.btn-clinic { background: #10b981; color: #fff; }
.btn-clinic:hover { background: #059669; color: #fff; }
.btn-center { background: #8b5cf6; color: #fff; }
.btn-center:hover { background: #7c3aed; color: #fff; }
.btn-hospital { background: #f59e0b; color: #fff; }
.btn-hospital:hover { background: #d97706; color: #fff; }
.btn-enterprise { background: #6366f1; color: #fff; }
.btn-enterprise:hover { background: #4f46e5; color: #fff; }

.col-recommended {
  position: relative;
  background: rgba(16, 185, 129, 0.03) !important;
}

.pricing-comparison-table tbody tr:nth-child(even) .col-recommended {
  background: rgba(16, 185, 129, 0.06) !important;
}

@media (max-width: 1200px) {
  .pricing-table-wrapper {
    margin: 0 -15px;
    border-radius: 0;
  }
}

@media (max-width: 768px) {
  .pricing-comparison-table thead th {
    font-size: 0.8rem;
    padding: 16px 10px;
  }
  .pricing-comparison-table tbody td {
    font-size: 0.8rem;
    padding: 10px 8px;
  }
  .price-amount {
    font-size: 1.1rem;
  }
  .module-card-wide {
    flex-direction: column;
  }
}