/* Base Calculator Styles */
/* Shared styles for all calculator components */

/* Form Layout */
.calc-form {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.calc-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .calc-form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.calc-form-group {
  display: flex;
  flex-direction: column;
}

.calc-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.calc-label-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  font-size: 0.75rem;
  cursor: help;
  font-weight: 600;
  margin-left: 0.25rem;
  position: relative;
  transition: all 0.2s ease;
}

.calc-label-tooltip:hover {
  background: #764ba2;
  transform: scale(1.1);
}

.calc-input {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calc-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.calc-input:invalid {
  border-color: #ef4444;
}

.calc-input-prefix {
  position: relative;
}

.calc-input-prefix input {
  padding-left: 2rem;
}

.calc-input-prefix::before {
  content: '$';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-weight: 600;
  pointer-events: none;
}

.calc-input-suffix {
  position: relative;
}

.calc-input-suffix input {
  padding-right: 2.5rem;
}

.calc-input-suffix::after {
  content: attr(data-suffix);
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-weight: 600;
  pointer-events: none;
}

.calc-select {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calc-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Multi-step Forms */
.calc-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 0;
  list-style: none;
}

.calc-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.calc-step::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: #e5e7eb;
  z-index: -1;
}

.calc-step:last-child::after {
  display: none;
}

.calc-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.calc-step.active .calc-step-number {
  background: #667eea;
  color: white;
}

.calc-step.completed .calc-step-number {
  background: #10b981;
  color: white;
}

.calc-step-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.calc-step.active .calc-step-label {
  color: #667eea;
  font-weight: 600;
}

/* Buttons */
.calc-button {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calc-button-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.calc-button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.calc-button-secondary {
  background: #f3f4f6;
  color: #374151;
}

.calc-button-secondary:hover {
  background: #e5e7eb;
}

.calc-button-group {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* Results Display */
.calc-results {
  display: none;
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: 8px;
  border: 2px solid #10b981;
}

.calc-results-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.calc-results-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #065f46;
  margin: 0 0 0.5rem 0;
}

.calc-results-subtitle {
  font-size: 1rem;
  color: #047857;
  margin: 0;
}

.calc-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .calc-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .calc-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

.calc-metric {
  background: white;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.calc-metric-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.calc-metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #10b981;
  line-height: 1;
}

.calc-metric-value.negative {
  color: #ef4444;
}

.calc-metric-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Error Display */
.calc-errors {
  display: none;
  padding: 1rem;
  background: #fef2f2;
  border: 2px solid #ef4444;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.calc-errors ul {
  margin: 0;
  padding-left: 1.25rem;
  color: #991b1b;
}

.calc-errors li {
  margin-bottom: 0.25rem;
}

/* Loading State */
.calc-loading {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-size: 1.125rem;
}

.calc-loading::after {
  content: '...';
  animation: calcDots 1.5s steps(3, end) infinite;
}

@keyframes calcDots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Chart Container */
.calc-chart-container {
  margin: 2rem 0;
  padding: 1.5rem;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calc-chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 1rem 0;
  text-align: center;
}

/* CTA Section */
.calc-cta {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  text-align: center;
  color: white;
}

.calc-cta-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.calc-cta-text {
  font-size: 1rem;
  margin: 0 0 1.5rem 0;
  opacity: 0.9;
}

.calc-cta-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .calc-cta-form {
    flex-direction: row;
  }
}

.calc-cta-input {
  flex: 1;
  padding: 0.875rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.calc-cta-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.calc-cta-input:focus {
  outline: none;
  border-color: white;
  background: rgba(255, 255, 255, 0.2);
}

.calc-cta-button {
  padding: 0.875rem 2rem;
  background: white;
  color: #667eea;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.calc-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Mobile Optimization */
@media (max-width: 640px) {
  .calc-form {
    gap: 1rem;
  }

  .calc-button-group {
    flex-direction: column;
  }

  .calc-button {
    width: 100%;
  }

  .calc-metric-value {
    font-size: 1.5rem;
  }

  .calc-results {
    padding: 1.5rem;
  }
}
