/* ===================================================================
   INTERACTIVE SERVICE PACKAGE BUILDER
   Sprint #43 - 2026-02-10 7:27 AM
   
   CONVERSION PSYCHOLOGY:
   - Service configurators increase conversion 35-55% vs static pricing
   - Visual customization creates ownership bias (endowment effect)
   - Step-by-step reduces decision paralysis
   - Real-time pricing builds transparency and trust
   - Used by: Stripe, Webflow, Shopify, Tesla
   
   IMPLEMENTATION:
   - Multi-step wizard interface (4 steps)
   - Real-time price calculation
   - Visual package preview
   - Add-on selector with icons
   - Progress indicator
   - Glassmorphism design
   - GPU-accelerated animations
   - Mobile responsive
   - Full accessibility (ARIA, keyboard nav)
   =================================================================== */

/* ===================================================================
   PACKAGE BUILDER CONTAINER
   =================================================================== */

.package-builder-section {
  position: relative;
  padding: 120px 0;
  background: linear-gradient(135deg, 
    rgba(10, 15, 25, 0.95) 0%, 
    rgba(15, 20, 35, 0.95) 100%);
  overflow: hidden;
}

.package-builder-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.package-builder-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.package-builder-header {
  text-align: center;
  margin-bottom: 60px;
}

.package-builder-header h2 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.package-builder-header p {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===================================================================
   BUILDER CARD - Main Container
   =================================================================== */

.package-builder-card {
  background: rgba(20, 25, 35, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 24px;
  padding: 48px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  position: relative;
  overflow: hidden;
}

.package-builder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(124, 58, 237, 0.5), 
    transparent);
}

/* ===================================================================
   PROGRESS INDICATOR
   =================================================================== */

.builder-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
  position: relative;
  padding: 0 20px;
}

.builder-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: rgba(124, 58, 237, 0.2);
  z-index: 0;
}

.progress-line {
  position: absolute;
  top: 20px;
  left: 20px;
  height: 2px;
  background: linear-gradient(90deg, 
    #7c3aed 0%, 
    #3b82f6 100%);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.progress-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.progress-step:hover:not(.active):not(.completed) {
  transform: scale(1.05);
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 25, 35, 0.8);
  border: 2px solid rgba(124, 58, 237, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.4s ease;
  position: relative;
}

.progress-step.completed .step-circle {
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  border-color: #7c3aed;
  color: #fff;
}

.progress-step.active .step-circle {
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  border-color: #7c3aed;
  color: #fff;
  box-shadow: 
    0 0 0 4px rgba(124, 58, 237, 0.2),
    0 0 20px rgba(124, 58, 237, 0.4);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 
      0 0 0 4px rgba(124, 58, 237, 0.2),
      0 0 20px rgba(124, 58, 237, 0.4);
  }
  50% {
    box-shadow: 
      0 0 0 6px rgba(124, 58, 237, 0.3),
      0 0 30px rgba(124, 58, 237, 0.6);
  }
}

.step-label {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
  text-align: center;
  white-space: nowrap;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
  color: rgba(255, 255, 255, 0.9);
}

/* ===================================================================
   STEP CONTENT CONTAINER
   =================================================================== */

.builder-steps {
  position: relative;
  min-height: 500px;
}

.builder-step {
  display: none;
  animation: fadeSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.builder-step.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.step-description {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ===================================================================
   STEP 1: SERVICE TYPE SELECTOR
   =================================================================== */

.service-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.service-type-card {
  background: rgba(30, 35, 45, 0.6);
  border: 2px solid rgba(124, 58, 237, 0.2);
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.service-type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(124, 58, 237, 0.1) 0%, 
    rgba(59, 130, 246, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-type-card:hover {
  border-color: rgba(124, 58, 237, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

.service-type-card:hover::before {
  opacity: 1;
}

.service-type-card.selected {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.15);
  box-shadow: 
    0 0 0 1px #7c3aed inset,
    0 8px 24px rgba(124, 58, 237, 0.4);
}

.service-type-card.selected::before {
  opacity: 1;
}

.service-icon {
  font-size: 40px;
  margin-bottom: 16px;
  display: block;
}

.service-type-card h3 {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.service-type-card p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 12px;
}

.service-price {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.service-price-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

/* ===================================================================
   STEP 2: ADD-ONS SELECTOR
   =================================================================== */

.addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.addon-item {
  background: rgba(30, 35, 45, 0.6);
  border: 2px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.addon-item:hover {
  border-color: rgba(124, 58, 237, 0.5);
  transform: translateX(4px);
}

.addon-item.selected {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.15);
  box-shadow: 0 0 0 1px #7c3aed inset;
}

.addon-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(124, 58, 237, 0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  background: rgba(20, 25, 35, 0.8);
}

.addon-item.selected .addon-checkbox {
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  border-color: #7c3aed;
}

.addon-checkbox::after {
  content: '✓';
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.addon-item.selected .addon-checkbox::after {
  opacity: 1;
  transform: scale(1);
}

.addon-info {
  flex: 1;
}

.addon-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.addon-info p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-bottom: 8px;
}

.addon-price {
  font-size: 14px;
  font-weight: 600;
  color: #7c3aed;
}

/* ===================================================================
   STEP 3: SCHEDULE SELECTOR
   =================================================================== */

.schedule-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.schedule-option {
  background: rgba(30, 35, 45, 0.6);
  border: 2px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.schedule-option:hover {
  border-color: rgba(124, 58, 237, 0.5);
  transform: scale(1.02);
}

.schedule-option.selected {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.15);
  box-shadow: 0 0 0 1px #7c3aed inset;
}

.schedule-option h4 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.schedule-option p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

/* ===================================================================
   STEP 4: REVIEW & CONFIRM
   =================================================================== */

.package-summary {
  background: rgba(30, 35, 45, 0.8);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
}

.summary-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.summary-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.summary-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
  font-weight: 600;
}

.summary-value {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}

.summary-list li {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
  padding-left: 20px;
  position: relative;
}

.summary-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #7c3aed;
  font-weight: 700;
}

.total-price-section {
  background: linear-gradient(135deg, 
    rgba(124, 58, 237, 0.2) 0%, 
    rgba(59, 130, 246, 0.2) 100%);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-label {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.total-price {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================================================================
   NAVIGATION BUTTONS
   =================================================================== */

.builder-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  gap: 16px;
}

.btn-builder {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-back {
  background: rgba(30, 35, 45, 0.8);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.btn-back:hover:not(:disabled) {
  background: rgba(40, 45, 55, 0.9);
  color: #fff;
  border-color: rgba(124, 58, 237, 0.5);
}

.btn-back:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-next, .btn-complete {
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  color: #fff;
  border: 1px solid #7c3aed;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-next::before, .btn-complete::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent);
  transition: left 0.5s ease;
}

.btn-next:hover::before, .btn-complete:hover::before {
  left: 100%;
}

.btn-next:hover, .btn-complete:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
}

.btn-next:active, .btn-complete:active {
  transform: translateY(0);
}

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

@media (max-width: 768px) {
  .package-builder-section {
    padding: 80px 0;
  }

  .package-builder-card {
    padding: 32px 24px;
  }

  .package-builder-header h2 {
    font-size: 36px;
  }

  .package-builder-header p {
    font-size: 18px;
  }

  .builder-progress {
    padding: 0 10px;
  }

  .builder-progress::before {
    left: 10px;
    right: 10px;
  }

  .progress-line {
    left: 10px;
  }

  .step-circle {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .step-label {
    font-size: 11px;
  }

  .step-title {
    font-size: 26px;
  }

  .step-description {
    font-size: 15px;
  }

  .service-type-grid {
    grid-template-columns: 1fr;
  }

  .addons-grid {
    grid-template-columns: 1fr;
  }

  .schedule-options {
    grid-template-columns: 1fr;
  }

  .total-price-section {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .builder-nav {
    flex-direction: column-reverse;
  }

  .btn-builder {
    width: 100%;
    justify-content: center;
  }
}

/* ===================================================================
   ACCESSIBILITY
   =================================================================== */

.service-type-card:focus-visible,
.addon-item:focus-visible,
.schedule-option:focus-visible,
.btn-builder:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===================================================================
   LOADING STATE
   =================================================================== */

.builder-loading {
  text-align: center;
  padding: 60px 0;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(124, 58, 237, 0.2);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loader-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
}
