/* Mortgage Calculator Styles */

.calculator-container {
  padding: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .calc-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Form Styles */
.calc-form-side h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.form-header h3 {
  margin-bottom: 0;
}

.currency-selector select {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.currency-selector select:focus {
  border-color: var(--accent-primary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-group.half {
  flex: 1;
}

.input-with-prefix, .input-with-suffix {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.input-with-prefix:focus-within, .input-with-suffix:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.input-with-prefix span, .input-with-suffix span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 15px;
}

.input-with-prefix input, .input-with-suffix input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  width: 100%;
}

.input-with-prefix input {
  padding-left: 0;
}

.input-with-suffix input {
  padding-right: 0;
}

/* Esconder flechas de number input */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

.advanced-options-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.2s;
}

.advanced-options-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.advanced-options {
  display: none;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

/* Results Side */
.calc-results-side {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.monthly-payment-card {
  text-align: center;
  margin-bottom: 32px;
}

.monthly-payment-card h4 {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.total-monthly-amount {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.total-monthly-amount .currency-symbol {
  font-size: 24px;
  margin-top: 8px;
  margin-right: 4px;
  color: var(--accent-primary);
}

/* Chart */
.breakdown-chart {
  margin-bottom: 32px;
}

.bar-chart-wrapper {
  display: flex;
  height: 12px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--border-color);
}

.bar-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.bar-blue { background: #3B82F6; }
.bar-green { background: #10B981; }
.bar-orange { background: #F59E0B; }
.bar-purple { background: #8B5CF6; }
.bar-red { background: #EF4444; }

.breakdown-legend {
  list-style: none;
  padding: 0;
  margin: 0;
}

.breakdown-legend li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 12px;
}

.dot-blue { background: #3B82F6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.5); }
.dot-green { background: #10B981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.dot-orange { background: #F59E0B; box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.dot-purple { background: #8B5CF6; box-shadow: 0 0 8px rgba(139, 92, 246, 0.5); }
.dot-red { background: #EF4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }

.legend-label {
  color: var(--text-secondary);
  flex: 1;
}

.legend-value {
  color: var(--text-primary);
}

/* Summary */
.loan-summary {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 20px;
  margin-top: auto;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.summary-item:last-child {
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(255,255,255,0.1);
  font-weight: 600;
}

.text-white { color: var(--text-primary); }
.text-accent { color: var(--accent-primary); font-size: 16px; }

/* Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.amortization-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.amortization-table th, .amortization-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.amortization-table th {
  color: var(--text-secondary);
  font-weight: 600;
  background: rgba(0,0,0,0.2);
}

.amortization-table th:first-child, .amortization-table td:first-child {
  text-align: left;
}

.amortization-table tr:hover {
  background: rgba(255,255,255,0.02);
}

.amortization-table td {
  color: var(--text-primary);
}

/* Estilos Globales para Botones Primarios */
.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
  transform: scale(0.95);
}
