/* Calculadora de Valoración Empresarial - Estilos */

.valuation-calculator {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Títulos de Sección */
.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a365d;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.section-title:first-child {
  margin-top: 0;
}

/* Grupos de Formulario */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
  font-size: 0.95rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: #fff;
}

.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: #999;
}

/* Grid para inputs en dos columnas */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

/* Sección de FCF */
.fcf-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
  border: 2px solid #e0e0e0;
}

.fcf-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

.fcf-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.fcf-btn:hover:not(:disabled) {
  background-color: #5a6268;
  transform: translateY(-2px);
}

.fcf-btn:disabled {
  background-color: #d6d6d6;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Campo centrado para último input */
.form-group.center-field {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Contenedor del Botón */
.button-container {
  text-align: center;
  margin: 2rem 0;
}

#calculateBtn {
  background-color: #1a365d;
  color: white;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(26, 54, 93, 0.2);
}

#calculateBtn:hover {
  background-color: #2d4a7c;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(26, 54, 93, 0.3);
}

#calculateBtn:active {
  transform: translateY(0);
}

/* Sección de Resultados */
.results-section {
  display: none;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 3px solid #1a365d;
  animation: slideIn 0.5s ease;
}

.results-section.active {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tarjeta de Resultado Principal */
.result-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 2rem;
  border: 3px solid #1a365d;
}

.result-card.primary {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.result-label {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a365d;
  margin: 0;
}

/* Desglose */
.breakdown-section {
  margin: 2rem 0;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.breakdown-item {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #1a365d;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.breakdown-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a365d;
}

/* Tablas */
.table-section {
  margin-top: 2rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-section table {
  width: 100%;
  border-collapse: collapse;
}

.table-section thead {
  background-color: #1a365d;
  color: white;
}

.table-section th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
}

.table-section td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

.table-section tbody tr:hover {
  background-color: #f8f9fa;
}

.table-section tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.table-section tbody tr:nth-child(even):hover {
  background-color: #f0f0f0;
}

/* Resaltar filas específicas */
.table-section tbody tr.highlight {
  background-color: #fff3cd;
  font-weight: 600;
}

.table-section tbody tr.final-row {
  font-weight: 700;
  background-color: #d4edda;
  border-top: 2px solid #1a365d;
}

/* Tabla de sensibilidad */
.sensitivity-table {
  overflow-x: auto;
  margin-top: 1rem;
}

.sensitivity-table table {
  width: 100%;
  min-width: 600px;
}

.sensitivity-table th {
  background-color: #1a365d;
  color: white;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.9rem;
}

.sensitivity-table td {
  text-align: center;
  padding: 0.6rem;
  font-size: 0.85rem;
}

.sensitivity-table tbody tr:first-child td {
  font-weight: 600;
}

.sensitivity-table td.base-case {
  background-color: #d4edda !important;
  font-weight: 700;
  border: 2px solid #28a745;
}

/* Info box */
.info-box {
  background: #e7f3ff;
  border-left: 4px solid #1a365d;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.info-box p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: #333;
}

.info-box strong {
  color: #1a365d;
}

/* Animaciones adicionales */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.result-card.primary {
  animation: pulse 2s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
  .valuation-calculator {
    padding: 1.5rem;
    margin: 1rem;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .result-value {
    font-size: 2rem;
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  #calculateBtn {
    width: 100%;
    padding: 1rem 2rem;
  }

  .fcf-controls {
    flex-direction: column;
    gap: 0.5rem;
  }

  .fcf-btn {
    width: 100%;
  }

  .table-section {
    font-size: 0.85rem;
  }

  .table-section th,
  .table-section td {
    padding: 0.5rem;
  }

  .sensitivity-table {
    overflow-x: scroll;
  }
}

@media (max-width: 480px) {
  .valuation-calculator {
    padding: 1rem;
    margin: 0.5rem;
  }

  .section-title {
    font-size: 1rem;
    margin: 1rem 0 0.75rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .form-group input,
  .form-group select {
    padding: 0.6rem;
    font-size: 0.95rem;
  }

  .result-card {
    padding: 1.5rem 1rem;
  }

  .result-label {
    font-size: 1rem;
  }

  .result-value {
    font-size: 1.75rem;
  }

  .breakdown-value {
    font-size: 1.1rem;
  }

  #calculateBtn {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
  }

  .table-section th,
  .table-section td {
    padding: 0.4rem 0.3rem;
    font-size: 0.8rem;
  }

  .table-section th {
    font-size: 0.85rem;
  }

  .sensitivity-table th,
  .sensitivity-table td {
    padding: 0.4rem 0.2rem;
    font-size: 0.75rem;
  }

  .info-box {
    padding: 0.75rem;
  }

  .info-box p {
    font-size: 0.85rem;
  }
}

/* Estilos para impresión */
@media print {
  .valuation-calculator {
    box-shadow: none;
    padding: 1rem;
  }

  .button-container,
  .fcf-controls {
    display: none;
  }

  .result-card.primary {
    animation: none;
  }
}
