/* Calculadora de Interés Compuesto - Estilos */

.compound-interest-calculator {
  max-width: 800px;
  margin: 30px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a365d;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: #2d3748;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #ffffff;
  color: #2d3748;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1a365d;
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.form-group input::placeholder {
  color: #a0aec0;
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 15px;
}

/* Botón centrado */
.button-container {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.button-container button {
  background-color: #1a365d;
  color: #ffffff;
  padding: 14px 50px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(26, 54, 93, 0.2);
}

.button-container button:hover {
  background-color: #2d4a7c;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(26, 54, 93, 0.3);
}

.button-container button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(26, 54, 93, 0.2);
}

/* Sección de resultados */
.results-section {
  margin-top: 30px;
  padding: 25px;
  background: #f7fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: none;
}

.results-section.show {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tarjeta de resultado principal */
.result-card {
  background: linear-gradient(135deg, #1a365d 0%, #2d4a7c 100%);
  color: #ffffff;
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 25px;
  box-shadow: 0 4px 12px rgba(26, 54, 93, 0.25);
}

.result-label {
  font-size: 1rem;
  opacity: 0.95;
  margin-bottom: 10px;
  font-weight: 500;
}

.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Desglose de resultados */
.breakdown-section {
  margin-top: 25px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.breakdown-item {
  background: #ffffff;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-label {
  font-size: 0.9rem;
  color: #718096;
  font-weight: 500;
}

.breakdown-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a365d;
}

/* Tabla de crecimiento */
.table-section {
  margin-top: 30px;
}

.toggle-btn {
  width: 100%;
  background-color: #edf2f7;
  color: #1a365d;
  padding: 12px 20px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-btn:hover {
  background-color: #e2e8f0;
  border-color: #1a365d;
}

.schedule-table {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.schedule-table.show {
  max-height: 800px;
  overflow-y: auto;
  margin-top: 15px;
}

.schedule-table table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.schedule-table thead {
  background-color: #1a365d;
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.schedule-table th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.schedule-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
  font-size: 0.9rem;
}

.schedule-table tbody tr:hover {
  background-color: #f7fafc;
}

.schedule-table tbody tr:last-child td {
  border-bottom: none;
}

/* Última fila de input centrada cuando hay 5 campos */
.center-field {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.center-field .form-group {
  max-width: 400px;
  width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  .compound-interest-calculator {
    padding: 20px 15px;
    margin: 20px 10px;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .result-value {
    font-size: 2rem;
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .breakdown-value {
    font-size: 1.2rem;
  }

  .button-container button {
    width: 100%;
    padding: 14px 30px;
  }

  .schedule-table {
    overflow-x: auto;
  }

  .schedule-table table {
    min-width: 600px;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 10px 8px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .compound-interest-calculator {
    padding: 15px 10px;
  }

  .result-card {
    padding: 20px 15px;
  }

  .result-value {
    font-size: 1.8rem;
  }

  .form-group input,
  .form-group select {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .breakdown-item {
    padding: 15px;
  }
}
