body {
  font-family: "Lato", sans-serif;
  font-size: 18px;
}

.page h1 {
  color: var(--h1-color);
}
.page h2 {
  color: var(--h2-color);
  font-size: 140%;
}
a {
  color: var(--link-text-color);
}

.note {
  border-left: 4px solid var(--note-color);
  color: var(--note-text-color);
}

.num_block {
  border-left: 4px solid #16a085;
}
.num_block[prefix="Teorema"] {
  border-left: 4px solid #2ecc71;
}
.num_block[prefix="Lema"] {
  border-left: 4px solid #f39c12;
}

.image_expand {
  -webkit-box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.5);
  -moz-box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.5);
  box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.5);
}

.interactive {
  text-align: center;
  border: 1px solid var(--interactive-border-color);
  border-radius: 2px;
  background: var(--interactive-color);
}
.image_link {
  border: 2px solid var(--image-border-color);
}

li {
  padding: 0 0 0.4em 0;
}

code,
code_math {
  display: inline;
}
code_math {
  font-family: "UbuntuMono", monospace;
  font-size: 107%;
  color: #27ae60;
}
code {
  color: #27ae60;
  font-weight: bold;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Courier New", monospace;
}

xmp {
  font-family: "UbuntuMono", monospace;
  font-size: 107%;
  color: #e67e22;
  border: 1px solid #e67e22;
}
pre {
  font-family: "UbuntuMono", monospace;
  border: 1px solid #e67e22; /* Borde color naranja */
  color: #e67e22; /* Texto color naranja */
  text-shadow: 2px 2px 5px rgba(255, 165, 0, 0.5); /* Sombra al texto */
  padding: 15px; /* Espaciado interno */
  background-color: black; /* Fondo blanco */
  border-radius: 10px; /* Bordes redondeados */
  white-space: pre-wrap; /* Asegura que el texto se ajuste al ancho del contenedor */
  font-size: 0.9rem; /* Tamaño de fuente */
  line-height: 1.2; /* Altura de línea */
  
}

.katex {
  font-size: 110% !important;
}

.cover_title {
  position: absolute;
  top: 595px;
  left: 57px;
  right: 0px;
  color: #0089cd;
  font-size: 350%;
  text-align: center;
  text-shadow: 1px 2px rgba(0, 0, 0, 0.15);
}
.cover_subtitle {
  position: absolute;
  left: 57px;
  right: 0px;
  bottom: 45px;
  text-align: center;
  color: #0089cd;
  font-size: 220%;
  text-shadow: 1px 2px rgba(0, 0, 0, 0.15);
}

.chap_text {
  position: absolute;
  right: var(--page-right-margin);
  top: 200px;
  color: #0089cd;
  font-size: 500%;
  text-shadow: 1px 2px rgba(0, 0, 0, 0.15);
}
.chap_name {
  position: relative;
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  left: 58px;
  width: 582px;
  top: 395px;
  height: 170px;
  color: #0089cd;
  font-size: 250%;
  text-shadow: 1px 2px rgba(0, 0, 0, 0.15);
}

table {
  border-collapse: collapse;
  border: 1px solid var(--text-color);
}
table td {
  border: 1px solid var(--text-color);
}

body.dark .invertcolor {
  filter: invert(1) hue-rotate(180deg);
}

.boxblue {
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #000099;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  background-color: var(--popup-bib-info-background);
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  width: 90%;
  background: #e7f3ff;
  border-left: 4px solid #007bff;
  padding: 10px 15px;
  margin: 15px 0;
}

.boxblack {
  margin-left: auto;
  margin-right: auto;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  background-color: rgba(0, 0, 0, 0.2);
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
  padding: 8px;
  padding-left: 15px;
  padding-right: 15px;
  border-radius: 12px;
  width: 90%;
}
.boxclear {
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #000099;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  background-color: rgba(39, 102, 7, 0.2);
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
  padding: 20px;
  border-radius: 12px;
  width: 101%;
  height: 103%;
}
/* tooltip personalizado para zhema   color: var(--h1-color); /* Color normal 222 
 "Lato" sans-serif*/

.tooltip {
  position: relative;
  display: inline; /* Cambiado de inline-block a inline para evitar el salto */
  cursor: pointer; /* Cursor normal pero clickeable */
  transition: color 0.3s ease; /* Transición suave del color */
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
  overflow: hidden;
  color: var(--h2-color); /*color de la palaba */
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
}

.tooltip hr {
  border: 0;
  height: 1px;
  background-color: #ccc;
  margin: 10px 0;
}

/* Cambio de color al pasar el cursor */
.tooltip:hover {
  color: var(--h1-color); /* Color azul estilo Wikipedia */
}

/* Estilos base comunes TEXTO*/
.tooltip_top_left,
.tooltip_top_right,
.tooltip_bottom_left,
.tooltip_bottom_right {
  position: absolute;
  visibility: hidden;
  width: 280px;
  background-color: #abc1b2;
  padding: 12px;
  border: 1px solid #a2a9b1;
  border-radius: 5px;
  box-shadow: 1 1px 3px rgba(0, 0, 0, 0.2);
  font-size: 0.7em; /*tamaño de la letra*/
  z-index: 1000;
}

/* Variantes de posición vertical margin seapra la linea*/
.tooltip_top_left,
.tooltip_top_right {
  bottom: 100%;
  margin-bottom: 10px;
}

.tooltip_bottom_left,
.tooltip_bottom_right {
  top: 100%;
  margin-top: 10px;
}

/* Posición horizontal */
.tooltip_top_left,
.tooltip_bottom_left {
  right: 0;
}

.tooltip_top_right,
.tooltip_bottom_right {
  left: 0;
}

/* Flechas base */
.tooltip_top_left::before,
.tooltip_top_right::before,
.tooltip_bottom_left::before,
.tooltip_bottom_right::before {
  content: "";
  position: absolute;
  border: 6px solid transparent;
}

/* Flechas para tooltips superiores */
.tooltip_top_left::before,
.tooltip_top_right::before {
  bottom: -12px;
  border-top-color: #a2a9b1;
}

/* Flechas para tooltips inferiores */
.tooltip_bottom_left::before,
.tooltip_bottom_right::before {
  top: -12px;
  border-bottom-color: #a2a9b1;
}

/* Posición horizontal de las flechas */
.tooltip_top_left::before,
.tooltip_bottom_left::before {
  right: 15px;
}

.tooltip_top_right::before,
.tooltip_bottom_right::before {
  left: 15px;
}

/* Mostrar el tooltip */
.tooltip:hover .tooltip_top,
.tooltip:hover .tooltip_top_left,
.tooltip:hover .tooltip_top_right,
.tooltip:hover .tooltip_bottom_left,
.tooltip:hover .tooltip_bottom_right {
  visibility: visible;
}
/* Estilos base con soporte para imagen */
.tooltip_top_left,
.tooltip_top_right,
.tooltip_bottom_left,
.tooltip_bottom_right {
  position: absolute;
  visibility: hidden;
  width: 280px;
  background-color: #fbfefc;
  border: 2px solid #009933;
  padding: 8px 12px;

  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  font-size: 90%px;
  line-height: 1.4;
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  word-wrap: break-word;
  color: black; /*color del texto */
}

/* Contenedor para la imagen */

/* Estilos para el contenido con imagen */
.tooltip-content {
  overflow: hidden; /* Limpia el float */
}

/* Clearfix para el contenedor */
.tooltip-content::after {
  content: "";
  display: table;
  clear: both;
}

/* FUNCIONA CORRECTAMENTE Tooltip específico para imágenes */
.tooltip_image {
  position: absolute;
  visibility: hidden;
  background-color: #fbfefc;
  border: 2px solid #009933;
  padding: 8px; /* Aumentado un poco el padding para dar espacio */

  border-radius: 3px;
  z-index: 1000;
  font-size: 14px;
  flex-shrink: 0;
  color: black; /*color del texto */
}

/* Estilos de la imagen   */

.tooltip_image img {
  width: 280px;
  object-fit: fill; /* o contain, fill, etc. */
  display: block;
  margin: auto; /* Centra la imagen */
  border-radius: 2px;
}

/* Posicionamiento vertical */
.tooltip_image.top_left,
.tooltip_image.top_right {
  bottom: 100%;
  margin-bottom: 5px;
}

.tooltip_image.bottom_left,
.tooltip_image.bottom_right {
  top: 100%;
  margin-top: 5px;
}

/* Posicionamiento horizontal */
.tooltip_image.top_left,
.tooltip_image.bottom_left {
  right: 0;
}

.tooltip_image.top_right,
.tooltip_image.bottom_right {
  left: 0;
}

/* Flechas */
.tooltip_image::before {
  content: "";
  position: absolute;
  border: 6px solid transparent;
}

/* Posiciones de flechas */
.tooltip_image.top_left::before,
.tooltip_image.top_right::before {
  bottom: -12px;
  border-top-color: #a2a9b1;
}

.tooltip_image.bottom_left::before,
.tooltip_image.bottom_right::before {
  top: -12px;
  border-bottom-color: #a2a9b1;
}

.tooltip_image.top_left::before,
.tooltip_image.bottom_left::before {
  right: 15px;
}

.tooltip_image.top_right::before,
.tooltip_image.bottom_right::before {
  left: 15px;
}

/* Mostrar tooltip */
.tooltip:hover .tooltip_image {
  visibility: visible;
}

.bigtitle {
  font-size: 1.1rem;
  font-weight: bold;
}
/* Botón explicativo - reemplaza los details/summary */
.explain-btn {
  background: #f0f0f0;
  border: 2px solid #ddd;
  border-radius: 5px;
  padding: 8px 15px;
  margin: 5px 0;
  cursor: pointer;
  display: inline-block;
  transition: all 0.3s;
  font-size: 14px;
  }

.explain-btn:hover {
  background: #e0e0e0;
  border-color: #007bff;
}

.explain-btn strong {
  color: #007bff;
}

/* Modal Container */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Modal Content */
.modal-content {
  background: white;
  border-radius: 10px;
  padding: 25px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s;
}

/* Botón cerrar */
.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.modal-title {
  font-size: 20px;
  color: #007bff;
  margin-bottom: 15px;
  padding-right: 30px;
}

.modal-body {
  color: #333;
  line-height: 1.6;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  margin: 10px 0;
}

.modal-body ul {
  margin: 10px 0;
  padding-left: 20px;
}

.modal-body li {
  margin: 8px 0;
}

.modal-body code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  color: #d63384;
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Estilos adicionales para el contenido de ejemplo */

.tooltipKK {
  position: relative;
  cursor: help;
  color: #007bff;
}

.sin_boton {
border: 0px; 
background-color: rgba(1,1,1,0);
}

.sin_boton .btn_expand {
border: 0px solid red;
background-color: rgba(1,1,1, 0);
opacity: 0.1;
}
