/* EV Tariff Calculator Styles */
.ev-tariff-calculator {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.calculator-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
  background: linear-gradient(135deg, #191838 0%, #2a5298 100%);
  color: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.calculator-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  color: white;
}

.calculator-description {
  font-size: 1.2rem;
  margin: 0;
  opacity: 0.9;
  line-height: 1.6;
}

/* Form Sections */
.calculator-form {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 2rem;
}

.form-section {
  padding: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
}

.form-section h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(135deg, #191838, #2a5298);
  margin-right: 1rem;
  border-radius: 2px;
}

/* Form Layout */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-control {
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: #2a5298;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.form-control:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.form-help {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Button */
.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #191838 0%, #2a5298 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(42, 82, 152, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 82, 152, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-large {
  padding: 1.25rem 3rem;
  font-size: 1.2rem;
  flex: 1;
  max-width: none;
  margin: 0;
}

.btn-secondary {
  background: white;
  color: #191838;
  border: 2px solid #191838;
  box-shadow: 0 2px 8px rgba(25, 24, 56, 0.1);
}

.btn-secondary:hover {
  background: #191838;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25, 24, 56, 0.2);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-share {
  padding: 1.25rem 2rem;
  font-size: 1.1rem;
  flex-shrink: 0;
  min-width: 140px;
}

.form-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  margin: 1rem auto 0;
}

.share-icon {
  font-size: 1.1em;
  margin-right: 0.25rem;
}

/* Results */
.calculator-results {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
}

.calculator-results h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 2rem 0;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.result-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #191838, #2a5298);
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.result-primary {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.result-secondary {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.result-info {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.result-cost {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.cost-details {
  text-align: left;
  width: 100%;
}

.cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.cost-item:last-child {
  border-bottom: none;
}

.cost-savings {
  font-weight: 700;
  background: rgba(34, 197, 94, 0.1);
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.cost-savings .cost-value {
  color: #16a34a;
  font-size: 1.1em;
}

.cost-label {
  font-size: 0.9rem;
  color: #6b7280;
}

.cost-value {
  font-weight: 600;
  color: #191838;
}

.result-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.result-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem 0;
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
  color: #191838;
  margin-bottom: 0.5rem;
}

.result-content p {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

/* Results Details */
.results-details {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.results-details h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #2a5298;
}

.detail-label {
  font-weight: 500;
  color: #374151;
}

.detail-value {
  font-weight: 600;
  color: #191838;
}

.calculation-explanation {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
}

.calculation-explanation h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.75rem 0;
}

.calculation-explanation p {
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #2a5298;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  color: #6b7280;
  font-weight: 500;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ev-tariff-calculator {
    padding: 1rem;
  }
  
  .calculator-title {
    font-size: 2rem;
  }
  
  .calculator-description {
    font-size: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .form-buttons {
    flex-direction: column;
    max-width: none;
  }
  
  .btn-large,
  .btn-share {
    width: 100%;
    max-width: none;
  }
  
  .btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .calculator-header {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
  }
  
  .calculator-title {
    font-size: 1.8rem;
  }
  
  .form-section {
    padding: 1.5rem;
  }
  
  .result-card {
    padding: 1.25rem;
  }
  
  .result-value {
    font-size: 1.75rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .ev-tariff-calculator {
    background: #111827;
    color: #f9fafb;
  }
  
  .calculator-form,
  .calculator-results,
  .seo-intro,
  .seo-content {
    background: #1f2937;
    border: 1px solid #374151;
  }
  
  .form-section {
    border-bottom-color: #374151;
  }
  
  .form-section h2,
  .seo-intro h2,
  .seo-content h2,
  .calculator-results h2,
  .results-details h3,
  .calculation-explanation h4 {
    color: #f9fafb;
  }
  
  .form-group label,
  .detail-label,
  .result-content h3 {
    color: #e5e7eb;
  }
  
  .form-help,
  .result-content p,
  .cost-label {
    color: #9ca3af;
  }
  
  .result-value,
  .detail-value,
  .cost-value {
    color: #f9fafb;
  }
  
  .calculation-explanation p {
    color: #d1d5db;
  }
  
  .result-card .result-content h3,
  .result-card .result-content p,
  .result-card .result-value,
  .result-card .cost-label,
  .result-card .cost-value {
    color: #1f2937;
  }
  
  .seo-content h3 {
    color: #60a5fa;
  }
  
  .seo-intro p,
  .seo-content p {
    color: #d1d5db;
  }
  
  .form-control {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .form-control:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
  }
  
  .form-control:disabled {
    background: #1f2937;
    color: #6b7280;
  }
  
  .results-details {
    background: #374151;
  }
  
  .detail-item {
    background: #1f2937;
    border-left-color: #60a5fa;
  }
  
  .calculation-explanation {
    background: #1f2937;
    border-color: #374151;
  }
}

/* Animation for results appearance */
.calculator-results {
  animation: slideInUp 0.5s ease-out;
}

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

/* Highlight animation for changed values */
.highlight {
  animation: highlight 0.6s ease;
}

@keyframes highlight {
  0% { background-color: rgba(42, 82, 152, 0.1); }
  50% { background-color: rgba(42, 82, 152, 0.2); }
  100% { background-color: transparent; }
}

/* Focus states for accessibility */
.form-control:focus,
.btn:focus {
  outline: 2px solid #2a5298;
  outline-offset: 2px;
}

/* SEO Content */
.seo-intro,
.seo-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.seo-intro h2,
.seo-content h2 {
  color: #191838;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.seo-content h3 {
  color: #2a5298;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem 0;
}

.seo-content h3:first-of-type {
  margin-top: 1.5rem;
}

.seo-intro p,
.seo-content p {
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.seo-intro p:last-child,
.seo-content p:last-child {
  margin-bottom: 0;
}

/* Share success message */
.share-success {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  min-width: 250px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Print styles */
@media print {
  .calculator-form,
  .btn {
    display: none;
  }
  
  .calculator-results {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .result-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .seo-intro,
  .seo-content {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}