/* Modern mortgage calculator styles */

:root {
  --bg: #f3f4f6;
  --text: #111827;
  --card-bg: #fff;
  --border: #e5e7eb;
  --row-alt: #f9fafb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --text: #f3f4f6;
    --card-bg: #1f2937;
    --border: #374151;
    --row-alt: #1e293b;
  }
}

body {
  background: var(--bg);
  color: var(--text);
}

.mortgage-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.mortgage-left {
  flex: 1;
}

.mortgage-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.calculator {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0;
}

.calculator label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#mortgageResult {
  font-weight: 600;
}

#mortgageSummary {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

.schedule-container {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-top: 20px;
  overflow-x: auto;
}

.mortgage-right canvas {
  max-width: 100%;
  max-height: 250px;
}

.chart-row {
  display: flex;
  gap: 20px;
  width: 100%;
  justify-content: center;
}

.chart-row canvas {
  flex: 1;
}

.calculator input,
.calculator select {
  width: 100%;
  max-width: 300px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
}

.actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.actions button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}

.actions button:hover {
  background: var(--row-alt);
}

.info-section {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin: 20px auto;
  max-width: 700px;
  line-height: 1.6;
}

#amortSchedule {
  width: 100%;
  border-collapse: collapse;
}

#amortSchedule th,
#amortSchedule td {
  padding: 8px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

#amortSchedule th:first-child,
#amortSchedule td:first-child {
  text-align: left;
}

#amortSchedule tbody tr:nth-child(even) {
  background: var(--row-alt);
}

@media (max-width: 600px) {
  .mortgage-layout {
    flex-direction: column;
  }

  .calculator,
  .schedule-container,
  .info-section {
    margin: 10px;
    padding: 15px;
  }

  .actions {
    flex-direction: column;
  }
}
