/**
 * Courtello Pricing Calculator Styles
 * Styles specific to the pricing calculator component
 */

/* Calculator Container */
.pricing-calculator {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.pricing-calculator-title {
  color: var(--bs-primary);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* Slider Styles */
.calc-slider-container {
  margin-bottom: 1.5rem;
}

.calc-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.calc-slider-label span {
  font-weight: 600;
  color: #333;
}

.calc-slider-value {
  background: var(--bs-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

/* Slider Labels - Positioned to match actual slider values */
.slider-labels {
  position: relative;
  height: 20px;
  width: 100%;
}

.slider-labels span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Custom Range Slider */
.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e9ecef;
  outline: none;
  transition: background 0.2s;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bs-primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.calc-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bs-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Billing Toggle */
.billing-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.billing-toggle-label {
  font-weight: 500;
  color: #666;
  transition: color 0.2s;
}

.billing-toggle-label.active {
  color: var(--bs-primary);
  font-weight: 600;
}

.billing-toggle {
  width: 60px;
  height: 30px;
}

.annual-badge {
  background: var(--bs-success);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  margin-left: 0.25rem;
}

/* Results Panel */
.calc-results {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 2px solid var(--bs-primary);
}

.calc-results-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bs-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e9ecef;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  color: #666;
  font-size: 0.9rem;
}

.result-value {
  font-weight: 600;
  color: #333;
}

.result-total {
  background: var(--bs-primary);
  color: white;
  margin: 1rem -1.5rem -1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 0 0 0.875rem 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-total-label {
  font-weight: 600;
}

.result-total-value {
  font-size: 1.75rem;
  font-weight: 700;
}

/* Pioneer Section */
.pioneer-pricing {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
}

.pioneer-pricing-title {
  color: #856404;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pioneer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

.pioneer-discount {
  background: #28a745;
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.pioneer-price {
  font-weight: 700;
  color: #28a745;
}

/* Annual Savings */
.annual-savings {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
}

.annual-savings-title {
  color: #155724;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.savings-highlight {
  font-size: 1.5rem;
  font-weight: 700;
  color: #28a745;
}

/* Recommended Badge */
.recommended-badge {
  background: var(--bs-warning);
  color: #333;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Enterprise Note */
.enterprise-note {
  background: #e3e6ea;
  border-left: 4px solid var(--bs-dark);
  padding: 1rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin-top: 1rem;
}

.enterprise-note h5 {
  color: #333;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Modules Upgrade Info */
.modules-upgrade-info {
  background: linear-gradient(135deg, #e7f1ff 0%, #cce5ff 100%);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid #b8daff;
}

.modules-upgrade-info h6 {
  color: #004085;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Pack Cards */
.pack-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.pack-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.pack-card.recommended {
  border-color: var(--bs-primary) !important;
  border-width: 2px;
}

.pack-card.recommended .card-header {
  background: var(--bs-primary) !important;
  color: white;
}

.pack-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--bs-primary);
}

.pack-price small {
  font-size: 1rem;
  color: #666;
  font-weight: 400;
}

/* Court Supplement Table */
.court-supplement-table {
  font-size: 0.9rem;
}

.court-supplement-table th {
  background: #f8f9fa;
  font-weight: 600;
}

.court-supplement-table .highlight {
  background: #fff3cd;
}

/* Pioneer Timeline */
.pioneer-timeline {
  position: relative;
  padding-left: 2rem;
}

.pioneer-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #28a745, #17a2b8, #6c757d);
}

.pioneer-timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.pioneer-timeline-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}

.pioneer-timeline-item.phase-1::before {
  background: #28a745;
}

.pioneer-timeline-item.phase-2::before {
  background: #17a2b8;
}

.pioneer-timeline-item.phase-3::before {
  background: #6c757d;
}

/* Features Page - Tab Fixes */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  color: white !important;
}

/* Slider Value Labels - Ensure white text */
.calc-slider-value,
.badge.bg-primary {
  color: white !important;
}

/* Responsive */
@media (max-width: 768px) {
  .pricing-calculator {
    padding: 1.25rem;
  }

  .calc-results {
    padding: 1rem;
  }

  .result-total {
    margin: 1rem -1rem -1rem;
    padding: 1rem;
  }

  .billing-toggle-container {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Animation */
@keyframes pulse-highlight {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
}

.pioneer-highlight {
  animation: pulse-highlight 2s infinite;
}

/* ============================================
   UNIFIED CALCULATOR v2 STYLES
   ============================================ */

/* Pioneer Bonus Section in Pack Cards */
.pioneer-bonus-section {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.1) 100%);
  margin: 1rem -1rem -1rem;
  padding: 1rem;
  border-radius: 0 0 0.375rem 0.375rem;
}

.pioneer-bonus-section ul li {
  font-size: 0.85rem;
}

/* À la carte table */
.alacarte-table {
  border-radius: 0.5rem;
  overflow: hidden;
}

.alacarte-table th {
  background: #f8f9fa;
  font-weight: 600;
  white-space: nowrap;
}

.alacarte-table td {
  vertical-align: middle;
}

.alacarte-table tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Pack cards in calculator - ensure equal height */
#pack-cards-container .pack-card {
  min-height: 100%;
}

#pack-cards-container .card-body {
  display: flex;
  flex-direction: column;
}

#pack-cards-container .card-body ul {
  flex-grow: 1;
}

/* Size detection badge animation */
#detected-size .badge {
  transition: all 0.3s ease;
}

#detected-size .badge:hover {
  transform: scale(1.1);
}

/* Responsive adjustments for unified calculator */
@media (max-width: 992px) {
  #pack-cards-container .col-lg-3 {
    margin-bottom: 1rem;
  }

  .pioneer-bonus-section {
    margin: 0.5rem -0.5rem -0.5rem;
    padding: 0.75rem;
  }
}

@media (max-width: 576px) {
  #pack-cards-container .pack-card .card-body {
    padding: 1rem !important;
  }

  .pack-price {
    font-size: 2rem;
  }

  .alacarte-table {
    font-size: 0.85rem;
  }
}

/* ============================================
   MODULAR PRICING v4.0 STYLES
   ============================================ */

/* Starter Card - Sticky on desktop */
.starter-card {
  position: sticky;
  top: 100px;
}

@media (max-width: 991px) {
  .starter-card {
    position: relative;
    top: 0;
  }
}

/* Module Category Headers */
.module-category .category-header {
  transition: background-color 0.2s;
}

.module-category .category-header.cursor-pointer:hover {
  background-color: #e9ecef !important;
}

.module-category .category-chevron {
  transition: transform 0.3s;
}

/* Module List Items */
.module-category .list-group-item {
  transition: background-color 0.2s, transform 0.1s;
  cursor: pointer;
  border-left: 0 !important;
  border-right: 0 !important;
}

.module-category .list-group-item:hover {
  background-color: rgba(13, 110, 253, 0.05);
  transform: translateX(4px);
}

.module-category .list-group-item.bg-success.bg-opacity-10 {
  border-left: 3px solid #198754 !important;
}

/* Module Checkbox - more visible border when unchecked */
.module-checkbox {
  transition: transform 0.2s;
  border: 2px solid #6c757d !important;
  width: 1.25em;
  height: 1.25em;
}

.module-checkbox:checked {
  transform: scale(1.1);
  border-color: var(--bs-success) !important;
}

/* Pioneer Breakdown */
.pioneer-breakdown {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Mobile Sticky Footer */
#pricing-sticky-footer {
  z-index: 1050;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

#pricing-sticky-footer .sticky-total {
  font-size: 1rem;
}

/* Hide sticky footer on desktop */
@media (min-width: 768px) {
  #pricing-sticky-footer {
    display: none !important;
  }
}

/* Category Accordion Animation */
.category-modules {
  transition: max-height 0.3s ease-out, opacity 0.2s;
}

/* Total Card Border */
.card.border-success {
  border-width: 2px !important;
}

/* Modules Grid - 2 columns layout */
#modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Contenu and Communauté side by side, Finance & Admin centered below */
#modules-grid .module-category:nth-child(1),
#modules-grid .module-category:nth-child(2) {
  grid-column: span 1;
}

#modules-grid .module-category:nth-child(3) {
  grid-column: 1 / -1;
  max-width: 50%;
  justify-self: center;
}

/* Remove bottom margin since grid handles spacing */
#modules-grid .module-category {
  margin-bottom: 0 !important;
}

/* Responsive - single column on mobile */
@media (max-width: 991px) {
  #modules-grid {
    grid-template-columns: 1fr;
  }

  #modules-grid .module-category:nth-child(3) {
    max-width: 100%;
  }
}

/* ============================================
   INTERACTIVE A LA CARTE v3.0 STYLES (legacy)
   ============================================ */

/* Pack card selection states */
.pack-card.selected {
  border-color: var(--bs-success) !important;
  border-width: 3px !important;
  box-shadow: 0 0 20px rgba(40, 167, 69, 0.3) !important;
  transform: scale(1.02);
}

.pack-card.selected .card-header {
  background: var(--bs-success) !important;
  color: white !important;
}

.pack-card.dimmed {
  opacity: 0.5;
  transform: scale(0.98);
  filter: grayscale(30%);
}

.pack-card.dimmed .select-pack-btn {
  pointer-events: all;
  opacity: 1;
}

.pack-card.dimmed:hover {
  opacity: 0.7;
  filter: grayscale(0%);
}

/* Interactive a la carte module list */
#alacarte-modules-list .list-group-item {
  transition: background-color 0.2s, transform 0.1s;
  cursor: pointer;
}

#alacarte-modules-list .list-group-item:hover {
  background-color: rgba(0, 123, 255, 0.05);
  transform: translateX(4px);
}

#alacarte-modules-list .form-check-input:checked + * + * + .badge {
  background-color: var(--bs-success) !important;
}

/* Quote card sticky */
#alacarte-interactive .sticky-top {
  z-index: 100;
}

/* Quote details animation */
#quote-details {
  transition: all 0.3s ease;
}

#quote-total {
  transition: all 0.3s ease;
}

/* Responsive adjustments for interactive section */
@media (max-width: 992px) {
  #alacarte-interactive .sticky-top {
    position: relative !important;
    top: 0 !important;
  }
}

@media (max-width: 576px) {
  #alacarte-interactive h4 {
    font-size: 1.1rem;
  }

  #alacarte-modules-list .list-group-item {
    padding: 0.75rem;
  }

  #alacarte-modules-list .badge {
    font-size: 0.7rem;
  }
}
