/* RESET BÁSICO */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #ffffff;
  color: #444;
  line-height: 1.5;
}

/* CONTENEDOR PRINCIPAL */
.container-principal {
   max-width: 1300px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* BLOQUE SUPERIOR: HISTORIA CLÍNICA */
.hc-superior {
  background: rgb(255, 255, 255);
  padding: 40px 30px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.hc-superior h1 {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  color: #007acc;
  margin-bottom: 25px;
  position: relative;
}

.hc-superior h1::before {
  content: "🔍";
  display: inline-block;
  margin-right: 10px;
  animation: girar 6s linear infinite;
}

@keyframes girar {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hc-superior textarea {
  width: 100%;
  min-height: 240px;
  font-size: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #cce0f5;
  resize: vertical;
  background-color: #fcfdff;
  margin-bottom: 20px;
  line-height: 1.6;
}


/* Separación suave entre secciones */
.bloque-col {
  margin-top: 48px;
  padding: 32px;
  background: linear-gradient(to bottom right, #ffffff, #f9fbff);
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Espacio extra solo si hay más de una sección */
.bloque-col + .bloque-col {
  margin-top: 32px;
}

/* Títulos destacados */
.bloque-col h2 {
  font-size: 20px;
  font-weight: 700;
  color: #007acc;
  border-bottom: 1px solid #e1eaf4;
  padding-bottom: 6px;
  margin-bottom: 18px;
}

/* Sombra sutil al hacer hover (opcional) */
.bloque-col:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

/* BOTÓN PRINCIPAL */
.btn-principal {
  background-color: #007acc;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.2s;
  display: block;
  margin: 0 auto;
}

.btn-principal:hover {
  background-color: #005c99;
  transform: scale(1.04);
}

/* SECCIÓN INFERIOR EN DOS COLUMNAS */
.inferior-doble {
  display: flex;
  gap: 24px;
  padding: 30px;
  flex-wrap: wrap;
}

/* COLUMNAS */
.bloque-col {
  flex: 1 1 48%;
  background: linear-gradient(to bottom right, #ffffff, #f2f8fc);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.bloque-col:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* TÍTULOS DE SECCIÓN */
.bloque-col h2 {
  font-size: 18px;
  color: #005c99;
  margin-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 5px;
}

/* RESULTADO IA */
.resultado-html {
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* COMENTARIOS DEL MÉDICO */
#comentarios-medico {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ccd;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 20px;
  background-color: #fefefe;
}

/* BOTONERA */
.botonera {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-accion {
  padding: 10px;
  background-color: #008c6e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-accion:hover {
  background-color: #006d55;
  transform: scale(1.03);
}

.btn-secundario {
  background-color: #ccc;
  color: #333;
}

.btn-secundario:hover {
  background-color: #bbb;
}

/* BADGES VISUALES */
.badge {
  display: inline-block;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-right: 5px;
  transition: transform 0.2s;
}

.badge:hover {
  transform: scale(1.05);
}

.badge.cumple { background-color: #e6f4ea; color: #2e7d32; }
.badge.parcial { background-color: #fff3e0; color: #ff9800; }
.badge.excluido { background-color: #fdecea; color: #c62828; }

.resumen-contador {
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
}

/* ANIMACIONES DE ENTRADA */
.fade-in { animation: fadeIn 0.6s ease-in-out both; }
.slide-up { animation: slideUp 0.6s ease-out; }
.slide-left { animation: slideLeft 0.6s ease-out; }
.slide-right { animation: slideRight 0.6s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .inferior-doble {
    flex-direction: column;
  }

  .bloque-col {
    flex: 1 1 100%;
  }
}
.estudio-bloque {
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 14px;
  border-radius: 10px;
}

.estudio-bloque.cumple {
  border-left-color: #2e7d32;
  background-color: #f0fbf5;
}

.estudio-bloque.parcial {
  border-left-color: #ff9800;
  background-color: #fff8eb;
}

.estudio-bloque.excluido {
  border-left-color: #c62828;
  background-color: #fcebea;
}

.estudio-header h3 {
  font-size: 13px;
}

.estudio-header h3 {
  font-size: 14px;
  color: #005c99;
  margin: 0;
}

.estado-tag {
  font-size: 14px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 6px;
}

.estudio-bloque.cumple .estado-tag {
  background: #d4edda;
  color: #2e7d32;
}
.estudio-bloque.parcial .estado-tag {
  background: #fff3cd;
  color: #ff9800;
}
.estudio-bloque.excluido .estado-tag {
  background: #f8d7da;
  color: #c62828;
}

.descripcion {
  font-size: 13px;
}

.detalle-ia {
  font-size: 13px;
}

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contenedor-carga {
  text-align: center;
  font-size: 16px;
  color: #007acc;
}

.barra-cargando {
  width: 300px;
  height: 10px;
  background: #e0f0ff;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progreso {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #007acc 25%, #33b5e5 50%, #007acc 75%);
  background-size: 200% 100%;
  animation: desplazamiento 1.5s infinite;
}

@keyframes desplazamiento {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.oculto {
  display: none !important;
}

.ver-mas {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: #007acc;
  text-decoration: underline;
}
.ver-mas:hover {
  color: #005a9e;
}


.deslizar-aparicion {
  animation: slideFadeIn 0.7s ease-in-out both;
}

@keyframes slideFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-box {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-out;
}

.modal-box h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #007acc;
}

.modal-box input {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.modal-acciones {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.modal-acciones .btn-pdf {
  background-color: #28a745;
}
.modal-acciones .btn-clear {
  background-color: #dc3545;
  color: white;
}

.opciones-carga {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  gap: 10px;
  align-items: center;
}

.btn-subir {
  background-color: #f0f8ff;
  color: #007acc;
  font-weight: 600;
  border: 2px dashed #aad4f5;
  transition: background-color 0.3s;
}

.btn-subir:hover {
  background-color: #d2eaff;
}

.texto-subida {
  font-size: 14px;
  color: #555;
}

.btn-mini {
  font-size: 14px;
  padding: 6px 14px;
  margin-top: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: #f3f3f3;
  color: #444;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-mini:hover {
  background-color: #e2e2e2;
}

