/**
 * Business ROI Calculator Styles
 * Modern design matching reference patterns
 * 
 * @package Sauna ROI Calculator
 * @author Harmon's Creations
 */

/* Reset and Base Styles */
.roi-calculator * {
  box-sizing: border-box;
}

/* Main Calculator Container */
.roi-calculator {
  max-width: 800px;
  margin: 2rem auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Calculator Header */
.calculator-header {
  background: linear-gradient(135deg, #3c767a 0%, #1A6066 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.calculator-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: white;
}

.calculator-description {
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Form Sections */
.form-sections {
  padding: 2rem;
}

.form-section {
  margin-bottom: 2.5rem;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section h4 {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  padding: 0.75rem;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus,
.form-group select:focus {
  outline: none;
  border-color: #3c767a;
  box-shadow: 0 0 0 3px rgba(60, 118, 122, 0.1);
}

.form-group input[type="number"]:hover,
.form-group input[type="text"]:hover,
.form-group select:hover {
  border-color: #9ca3af;
}

.form-group small {
  margin-top: 0.25rem;
  color: #6c757d;
  font-size: 0.85rem;
}

/* Range Input Styles */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #3c767a;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #3c767a;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease;
}

.form-group input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
}

.range-display {
  text-align: center;
  margin: 0.5rem 0;
  font-weight: 600;
}

.range-value {
  font-size: 1.25rem;
  color: #3c767a;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Info box */
.info-box {
  background: #d1ecf1;
  border-left: 4px solid #3c767a;
  padding: 1rem;
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.info-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.info-box p {
  margin: 0;
  font-size: 0.9rem;
  color: #0c5460;
  line-height: 1.5;
}

/* Form Actions */
.form-actions {
  padding: 0 2rem 2rem 2rem;
  text-align: center;
}

.calculate-button {
  background: linear-gradient(135deg, #3c767a 0%, #1A6066 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calculate-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(60, 118, 122, 0.4);
}

.calculate-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
  margin-left: 0.5rem;
}

.calculate-button.loading .loading-spinner {
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Results Container */
.calculation-results {
  margin-top: 0;
  padding: 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.results-container {
  max-width: 100%;
}

.results-header h3 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: #2c3e50;
  text-align: center;
}

/* Insights */
.insights {
  margin: 1rem 0;
  text-align: center;
}

.insight {
  background: #d4edda;
  color: #155724;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  border-radius: 6px;
  border-left: 4px solid #28a745;
  font-weight: 500;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.result-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-card.highlight {
  border-color: #3c767a;
  background: linear-gradient(135deg, rgba(60, 118, 122, 0.1) 0%, rgba(26, 96, 102, 0.1) 100%);
}

.result-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
}

.result-unit {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.25rem;
  display: block;
}

/* Breakdown Tables */
.results-breakdown {
  margin: 2rem 0;
}

.results-breakdown h4 {
  margin: 0 0 1rem 0;
  text-align: center;
  color: #2c3e50;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.breakdown-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
}
.breakdown-table tr.savings.total td {
    background: #d4edda;
    color: #155724;
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table tr.total td {
  background: #f8f9fa;
  font-weight: 600;
}

/* Error Messages */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #f5c6cb;
  margin: 1rem 0;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .roi-calculator {
    margin: 1rem;
    border-radius: 8px;
  }
  
  .calculator-header {
    padding: 1.5rem;
  }
  
  .form-sections {
    padding: 1.5rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .results-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 480px) {
  .calculator-header h3 {
    font-size: 1.5rem;
  }
  
  .result-value {
    font-size: 1.5rem;
  }
  
  .calculate-button {
    width: 100%;
    min-width: auto;
  }
}

/* Accessibility */
input:focus,
select:focus,
button:focus {
  outline: 2px solid #3c767a;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .roi-calculator {
    border: 2px solid currentColor;
  }
  
  .result-card {
    border-width: 2px;
  }
}

/* Print styles */
@media print {
  .roi-calculator {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .calculator-form,
  .form-actions {
    display: none;
  }
  
  .calculation-results {
    page-break-inside: avoid;
  }
}
