/* Mortgage or Invest Calculator - 3 Scenario Comparison Styles */

/* Main container */
.calculator-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #181c40 0%, #2a3052 100%);
  color: #d8bd7d;
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  border-radius: 8px;
}

[data-theme="light"] .hero {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
}

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

.hero p {
  font-size: 1.1rem;
  opacity: 0.95;
  margin: 0;
}

/* Card sections */
.card {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

[data-theme="dark"] .card {
  border: 3px solid var(--accent-primary);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.8rem;
}

.card h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1.3rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* Input Section */
.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

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

.input-group label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.input-group input[type="number"] {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.input-group input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(216, 189, 125, 0.1);
}

/* Tax Group */
.tax-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 0.5rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.cgt-input-group {
  margin-top: 0.5rem;
  display: none;
}

.cgt-input-group label {
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.cgt-input-group input[type="number"] {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Three Scenario Grid */
.three-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.scenario-card {
  background: linear-gradient(135deg, #181c40 0%, #2a3052 100%);
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  overflow: hidden;
  color: #ffffff;
  transition: all 0.3s ease;
}

[data-theme="light"] .scenario-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: #3498db;
  color: #2c3e50;
}

.scenario-card.winner-highlight {
  border-width: 4px;
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.scenario-card.baseline-card {
  opacity: 0.85;
}

.scenario-header {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid var(--accent-primary);
}

[data-theme="light"] .scenario-header {
  background: rgba(52, 152, 219, 0.1);
  border-bottom-color: #3498db;
}

.scenario-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--accent-primary);
  text-align: center;
}

[data-theme="light"] .scenario-header h3 {
  color: #2980b9;
}

.scenario-body {
  padding: 1.5rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(216, 189, 125, 0.2);
}

[data-theme="light"] .metric-row {
  border-bottom: 1px solid rgba(52, 152, 219, 0.2);
}

.metric-row:last-of-type {
  border-bottom: none;
}

.metric-row.highlight {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--accent-primary);
}

[data-theme="light"] .metric-row.highlight {
  border-top-color: #3498db;
}

.metric-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
}

[data-theme="light"] .metric-label {
  color: #6c757d;
}

.metric-value {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.2rem;
}

[data-theme="light"] .metric-value {
  color: #2c3e50;
}

.metric-value.gold {
  color: #d8bd7d;
  text-shadow: 0 0 10px rgba(216, 189, 125, 0.3);
  font-size: 1.4rem;
}

[data-theme="light"] .metric-value.gold {
  color: #2980b9;
  text-shadow: none;
}

.metric-value-small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 600;
}

[data-theme="light"] .metric-value-small {
  color: #495057;
}

.net-position {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--accent-primary);
  font-size: 0.95rem;
  text-align: center;
  color: #ffffff;
}

[data-theme="light"] .net-position {
  border-top-color: #3498db;
  color: #2c3e50;
}

.net-position strong {
  color: var(--accent-primary);
}

[data-theme="light"] .net-position strong {
  color: #2980b9;
}

/* Winner Box */
.winner-box {
  background: linear-gradient(135deg, #181c40 0%, #2a3052 100%);
  border: 3px solid #10b981;
  border-radius: 8px;
  padding: 2rem;
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

[data-theme="light"] .winner-box {
  background: linear-gradient(135deg, #e8f4f8 0%, #d4e9f2 100%);
  border-color: #10b981;
}

.winner-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.winner-content h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #10b981;
  font-size: 1.5rem;
}

.winner-content p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
  color: #ffffff;
}

[data-theme="light"] .winner-content p {
  color: #2c3e50;
}

.winner-content p:last-child {
  margin-bottom: 0;
}

.disclaimer-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(216, 189, 125, 0.3);
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.9;
}

[data-theme="light"] .disclaimer-note {
  border-top: 1px solid rgba(52, 152, 219, 0.3);
}

/* Chart Section */
.chart-container {
  position: relative;
  height: 400px;
  margin-top: 1.5rem;
}

.chart-legend {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--accent-primary);
}

.chart-legend p {
  margin: 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.9rem;
}

canvas {
  max-width: 100%;
  height: auto !important;
}

/* Payoff Details Section */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.option-card {
  background: linear-gradient(135deg, #181c40 0%, #2a3052 100%);
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  padding: 1.5rem;
  color: #ffffff;
}

[data-theme="light"] .option-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-color: #3498db;
  color: #2c3e50;
}

.option-card h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--accent-primary);
  font-size: 1.5rem;
  text-align: center;
}

[data-theme="light"] .option-card h3 {
  color: #2980b9;
}

/* Tables Section */
.table-accordion {
  margin-bottom: 1.5rem;
}

.accordion-header {
  width: 100%;
  background: var(--bg-secondary);
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

[data-theme="light"] .accordion-header {
  background: #f8f9fa;
  border-color: #3498db;
}

.accordion-header:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

[data-theme="light"] .accordion-header:hover {
  background: #3498db;
  color: white;
}

.accordion-icon {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.accordion-content {
  display: none;
  margin-top: 1rem;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
}

[data-theme="dark"] .data-table {
  border: 3px solid var(--accent-primary);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

[data-theme="dark"] .data-table th {
  background: #141631;
  color: var(--accent-primary);
  border-bottom: 2px solid var(--accent-primary);
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .data-table td {
  border-bottom: 1px solid rgba(216, 189, 125, 0.2);
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(216, 189, 125, 0.05);
}

/* About Section */
.about-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.about-section li {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.about-section p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .three-scenario-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 992px) {
  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .input-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chart-container {
    height: 350px;
  }
}

@media (max-width: 768px) {
  .calculator-container {
    padding: 1rem 0.5rem;
  }

  .card {
    padding: 1.5rem 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .input-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .winner-box {
    flex-direction: column;
    padding: 1.5rem;
  }

  .winner-icon {
    font-size: 2rem;
  }

  .chart-container {
    height: 300px;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 1rem 0.75rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .scenario-body {
    padding: 1rem;
  }

  .metric-value {
    font-size: 1.1rem;
  }

  .metric-value.gold {
    font-size: 1.3rem;
  }

  .accordion-header {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.4rem;
    font-size: 0.85rem;
  }

  .chart-container {
    height: 250px;
  }
}