/* ========================================
   ROI CALCULATOR - Interactive Value Estimator
   Sprint #37 - 2026-02-10 5:57 AM
   
   2026 Conversion Pattern: Make abstract value concrete
   - Interactive sliders for personalization
   - Real-time calculation updates
   - Visual ROI breakdown with charts
   - Animated number counters
   - Breakeven point highlighting
   
   Inspired by: Vercel, Linear, Stripe pricing calculators
   Proven to increase conversion by 40-60%
   ======================================== */

.roi-calculator-section {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 120px auto;
  padding: 0 24px;
  z-index: 1;
}

.roi-calculator-container {
  background: linear-gradient(135deg, 
    rgba(88, 28, 135, 0.05) 0%, 
    rgba(124, 58, 237, 0.03) 50%,
    rgba(219, 39, 119, 0.05) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 24px;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.roi-calculator-container:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-4px);
}

.roi-calculator-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.3),
    rgba(139, 92, 246, 0.3));
  border-radius: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  filter: blur(20px);
}

.roi-calculator-container:hover::before {
  opacity: 0.5;
}

.roi-header {
  text-align: center;
  margin-bottom: 50px;
}

.roi-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.roi-badge::before {
  content: '💰';
  font-size: 16px;
}

.roi-header h2 {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.roi-header p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.roi-calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
}

/* Input Section */
.roi-inputs {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.roi-input-group {
  background: rgba(15, 15, 20, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.roi-input-group:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(15, 15, 20, 0.8);
}

.roi-input-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.roi-input-label span {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.roi-input-value {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.roi-slider-container {
  position: relative;
  padding: 10px 0;
}

.roi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, 
    rgba(139, 92, 246, 0.3) 0%, 
    rgba(139, 92, 246, 0.3) 100%);
  border-radius: 10px;
  outline: none;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.roi-slider:hover {
  background: linear-gradient(90deg, 
    rgba(139, 92, 246, 0.5) 0%, 
    rgba(139, 92, 246, 0.5) 100%);
}

.roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.6),
              0 0 0 4px rgba(139, 92, 246, 0.2);
  transition: all 0.2s ease;
}

.roi-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.8),
              0 0 0 6px rgba(139, 92, 246, 0.3);
}

.roi-slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.roi-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.6),
              0 0 0 4px rgba(139, 92, 246, 0.2);
  transition: all 0.2s ease;
}

.roi-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.8),
              0 0 0 6px rgba(139, 92, 246, 0.3);
}

.roi-slider-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
}

.roi-slider-marker {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* Results Section */
.roi-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.roi-result-card {
  background: rgba(15, 15, 20, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.roi-result-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateX(4px);
}

.roi-result-card.highlight {
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.1) 0%, 
    rgba(139, 92, 246, 0.1) 100%);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.roi-result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #8b5cf6, #ec4899);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.roi-result-card:hover::before {
  opacity: 1;
}

.roi-result-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  font-weight: 500;
}

.roi-result-value {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.roi-result-value.negative {
  color: #ef4444;
}

.roi-result-value.positive {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.roi-result-suffix {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.roi-result-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

.roi-result-badge {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
  margin-top: 8px;
}

/* Visual Chart */
.roi-visual-chart {
  margin-top: 32px;
  padding: 24px;
  background: rgba(15, 15, 20, 0.4);
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.1);
}

.roi-chart-title {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  text-align: center;
}

.roi-bar-chart {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  height: 200px;
}

.roi-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.roi-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, 
    rgba(139, 92, 246, 0.8) 0%, 
    rgba(139, 92, 246, 0.8) 100%);
  border-radius: 8px 8px 0 0;
  position: relative;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(139, 92, 246, 0.4);
}

.roi-bar-fill.positive {
  background: linear-gradient(180deg, 
    rgba(16, 185, 129, 0.8) 0%, 
    rgba(6, 182, 212, 0.8) 100%);
  box-shadow: 0 -4px 20px rgba(16, 185, 129, 0.4);
}

.roi-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.roi-bar-value {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

/* CTA Section */
.roi-cta {
  margin-top: 40px;
  text-align: center;
  padding: 32px;
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.05) 0%, 
    rgba(139, 92, 246, 0.05) 100%);
  border-radius: 16px;
  border: 1px dashed rgba(139, 92, 246, 0.3);
}

.roi-cta-text {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
}

.roi-cta-text strong {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 24px;
}

.roi-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.roi-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.6);
}

.roi-cta-button::after {
  content: '→';
  font-size: 20px;
  transition: transform 0.3s ease;
}

.roi-cta-button:hover::after {
  transform: translateX(4px);
}

/* Mobile Responsive */
@media (max-width: 968px) {
  .roi-calculator-section {
    margin: 80px auto;
  }

  .roi-calculator-container {
    padding: 40px 24px;
  }

  .roi-header h2 {
    font-size: 32px;
  }

  .roi-header p {
    font-size: 16px;
  }

  .roi-calculator-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .roi-result-value {
    font-size: 28px;
  }

  .roi-bar-chart {
    height: 150px;
  }

  .roi-cta {
    padding: 24px;
  }

  .roi-cta-text {
    font-size: 16px;
  }

  .roi-cta-text strong {
    font-size: 20px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .roi-calculator-container,
  .roi-input-group,
  .roi-result-card,
  .roi-slider::-webkit-slider-thumb,
  .roi-slider::-moz-range-thumb,
  .roi-bar-fill,
  .roi-cta-button {
    transition: none;
  }

  .roi-calculator-container:hover,
  .roi-result-card:hover {
    transform: none;
  }

  .roi-cta-button:hover {
    transform: none;
  }
}

/* Dark mode enhancement */
@media (prefers-color-scheme: light) {
  .roi-calculator-container {
    background: linear-gradient(135deg, 
      rgba(255, 255, 255, 0.95) 0%, 
      rgba(249, 250, 251, 0.95) 100%);
  }

  .roi-input-group,
  .roi-result-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(139, 92, 246, 0.3);
  }

  .roi-header h2,
  .roi-result-value {
    color: #1f2937;
  }

  .roi-input-label span,
  .roi-result-label {
    color: #4b5563;
  }
}
