/* ============================================================================
   Main Application Styles - EV Charging Comparison
   ============================================================================ */

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  opacity: 0.95;
}

.hero .description {
  font-size: 1rem;
  opacity: 0.85;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  .hero .subtitle {
    font-size: 1rem;
  }
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Comparison Tool */
.comparison-tool {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Input Form */
.input-form {
  max-width: 600px;
  margin: 0 auto;
}

.input-form h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: #1f2937;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.required {
  color: #ef4444;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

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

.efficiency-input {
  display: flex;
  gap: 0.5rem;
}

.efficiency-input select {
  flex: 0 0 140px;
}

.efficiency-input input {
  flex: 1;
}

/* Advanced Options */
.advanced-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.toggle-advanced {
  background: none;
  border: none;
  color: #667eea;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-advanced:hover {
  color: #764ba2;
}

.advanced-options {
  margin-top: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
}

/* Submit Button */
.submit-button {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 2rem;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error Message */
.error-message {
  margin-top: 1rem;
  padding: 1rem;
  background: #fee2e2;
  border: 2px solid #ef4444;
  border-radius: 8px;
  color: #991b1b;
  font-weight: 500;
}

/* Results Section */
.results-comparison {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 3px solid #e5e7eb;
}

.results-comparison h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: #1f2937;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.card {
  background: white;
  border: 3px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card.winner {
  border-color: #10b981;
  background: linear-gradient(to bottom, #ffffff, #f0fdf4);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #374151;
}

.card .total-cost {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
}

.cost-breakdown {
  border-top: 2px solid #e5e7eb;
  padding-top: 1rem;
  margin-bottom: 1rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.breakdown-item span:first-child {
  color: #6b7280;
}

.breakdown-item span:last-child {
  font-weight: 600;
  color: #374151;
}

.cost-per-km {
  text-align: center;
  padding: 0.75rem;
  background: #f3f4f6;
  border-radius: 8px;
  font-weight: 600;
  color: #667eea;
}

/* Comparison Summary */
.comparison-summary {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .comparison-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.comparison-section {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: 12px;
  border: 3px solid #10b981;
}

.comparison-section.ongoing {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #3b82f6;
}

.comparison-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}

.winner-badge {
  font-size: 1.5rem;
  font-weight: 700;
  color: #047857;
  margin-bottom: 1rem;
}

.comparison-section.ongoing .winner-badge {
  color: #1d4ed8;
}

.savings-text {
  font-size: 1rem;
  color: #065f46;
  margin-bottom: 1rem;
}

.comparison-section.ongoing .savings-text {
  color: #1e40af;
}

.savings-text strong {
  color: #047857;
  font-size: 1.125rem;
}

.comparison-section.ongoing .savings-text strong {
  color: #1d4ed8;
}

.cost-comparison-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.cost-comparison-line .vs {
  color: #6b7280;
  font-weight: 700;
  font-size: 0.75rem;
}

/* Additional Info */
.additional-info {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 2px solid #e5e7eb;
}

.additional-info h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #374151;
}

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

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
}

.info-label {
  color: #6b7280;
  font-weight: 500;
}

.info-value {
  font-weight: 700;
  color: #1f2937;
}

/* Charts Section */
.charts-section {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.chart-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #e5e7eb;
}

.chart-container h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #374151;
}

@media (min-width: 1024px) {
  .charts-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Disclaimer */
.disclaimer {
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 3rem;
}

.disclaimer h3 {
  font-size: 1.25rem;
  color: #92400e;
  margin-bottom: 1rem;
}

.disclaimer p {
  color: #78350f;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.disclaimer ul {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.disclaimer li {
  color: #78350f;
  margin-bottom: 0.25rem;
}

/* Loading States */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.submit-button:disabled::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Loading States */
.loading {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-size: 1.125rem;
}

/* Yearly Comparison Lines */
.yearly-comparison {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 12px;
}

.yearly-lines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.year-line {
  transition: transform 0.2s, box-shadow 0.2s;
}

.year-line:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
  .year-line {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .year-line > div {
    width: 100%;
  }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
  .comparison-tool {
    padding: 1rem;
  }

  .card .total-cost {
    font-size: 2rem;
  }

  .efficiency-input {
    flex-direction: column;
  }

  .efficiency-input select {
    flex: 1;
  }
  
  .comparison-section {
    padding: 1.5rem;
  }
  
  .comparison-section h3 {
    font-size: 1rem;
  }
  
  .winner-badge {
    font-size: 1.25rem;
  }
  
  .savings-text {
    font-size: 0.875rem;
  }
  
  .cost-comparison-line {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.75rem;
  }
  
  .cost-comparison-line .vs {
    transform: rotate(90deg);
  }
}

