html {
  font-size: 62.5%;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  display: flex;
  flex-direction: column;
  font-family: "Open Sans", serif;
  font-size: 1.6rem;
  margin: 0;
  padding: 0;
  background: #f0f4f8;
  overflow: hidden;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 2rem;
  padding: 5px;
}

.header-button.hidden {
  display: none;
}

/* Contenedor principal del chat */
.chat-container {
  flex: 1; /* Ocupa el espacio restante */
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Estilos para el header y navbar */
.chatbot-full-header {
  background: #00bfff;
  padding: 10px 20px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-logo {
  width: 50px;
  height: 50px;
  padding: 6px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 50%;
}

.logo-text {
  color: #fff;
  font-weight: 600;
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 0.02rem;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.navbar ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
}

.navbar ul li a:hover {
  text-decoration: underline;
}

/* Ajustes para el cuerpo del chat */
.chat-modal-body {
  flex: 1;
  padding: 25px 22px;
  gap: 20px;
  display: flex;
  overflow-y: auto;

  flex-direction: column;
  max-height: calc(100vh - 153px);
  margin-bottom: 100px;
}
.chat-modal-body .message {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  scrollbar-width: thin;
}
.chat-modal-body .user-message-ia {
  flex-direction: column;
  align-items: flex-end;
}

.chat-modal-body .user-message-ia .message-text-ia {
  background: #3daffb;
  color: #fff;
  border-radius: 15px 15px 0 15px;
  padding: 10px 15px;
  font-size: 1.6rem;
  max-width: 70%;
  word-wrap: break-word;
}

.chat-modal-body .bot-modal-message .message-text-ia {
  padding: 14px;
  background: #fff;
  border-radius: 10px;
  /* box-shadow: 2px 4px 10px 4px #808080; */
  transition-duration: 1s ease;
}

.chat-modal-body .message .bot-modal-avatar {
  width: 35px;
  height: 35px;
  padding: 6px;
  fill: #fff;
  flex-shrink: 0;
  margin-bottom: 2px;
  align-self: flex-start;
  border-radius: 50%;
  background: #ffba6a;
}

/* Ajustes para el footer del chat */
.chat-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #ececec;
  padding: 15px 22px 20px;
  flex-shrink: 0;
  border-radius: 0;
  z-index: 10;
}

.chat-footer .chat-form {
  display: flex;
  align-items: center;
  position: relative;
  background: #fff;
  border-radius: 32px;
  outline: 1px solid #cccce5;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.06);
  transition: 0s ease, border-radius 0s;
}

.chat-footer .chat-form:focus-within {
  outline: 2px solid #0099ff;
}

.chat-footer .message-input {
  width: 100%;
  height: 47px;
  outline: none;
  resize: none;
  border: none;
  max-height: 180px;
  scrollbar-width: thin;
  border-radius: inherit;
  font-size: 1.4rem;
  padding: 14px 0 12px 18px;
  scrollbar-color: transparent transparent;
}

.chat-footer .chat-controls {
  gap: 3px;
  height: 47px;
  display: flex;
  padding-right: 6px;
  align-items: center;
  align-self: flex-end;
}

.chat-footer .chat-controls button:hover {
  color: #00abb1;
  background: #f1f1ff;
}

.chat-footer .chat-controls #send-ia-message {
  color: #fff;
  display: none;
  background: #0099ff;
  margin-bottom: 0;
}

.chat-footer .chat-controls #send-ia-message:hover {
  background: #0077cc;
}

.chat-footer .message-input:valid ~ .chat-controls #send-ia-message {
  display: block;
}

.chat-form .chat-controls button {
  height: 35px;
  width: 35px;
  border: none;
  cursor: pointer;
  color: #00abb1;
  border-radius: 50%;
  font-size: 1.15rem;
  background: none;
  transition: 0.2sease;
}

/* Estilos para el prompt de la IA/
  
  /* Estilos para títulos y subtítulos en negritas */
.message-text-ia strong {
  font-weight: bold;
}

/* Estilos para párrafos con dos saltos de línea */
.message-text-ia p {
  margin-bottom: 1.5em; /* Espacio entre párrafos */
}

/* Estilos para listas (ul y ol) en negritas */
.message-text-ia ul,
.message-text-ia ol {
  margin-left: 20px;
}

.message-text-ia ul li,
.message-text-ia ol li {
  font-weight: bold; /* Negritas para elementos de lista */
}

/* Estilos para código de programación */
.message-text-ia code {
  background-color: #dddddd;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
}

.message-text-ia pre {
  background-color: #f4f4f4;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: monospace;
}

/* Estilos para cursivas */
.message-text-ia em {
  font-style: italic;
}

/* Estilos para el contenedor del mensaje del chatbot */
.message.bot-modal-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
}

/* Contenedor del contenido del mensaje */
.message-content {
  position: relative;
  background-color: #f1f1f1;
  padding: 10px;
  border-radius: 10px;
  max-width: 80%;
}

/* Estilos para el botón de copiar */
.copy-button {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1.9rem;
  padding: 5px;
  transition: color 0.3s ease;
}

.copy-button:hover {
  color: #000;
}

/* Modo oscuro */
body.dark-mode {
  background-color: #333;
  color: #ffffff;
}

body.dark-mode .chat-modal-body {
  background-color: #333;
  color: #ffffff;
}

body.dark-mode .message-text-ia {
  color: #fff;
}

body.dark-mode .header-button {
  color: #333;
}

body.dark-mode .chat-modal-body .bot-modal-message .message-text-ia {
  background-color: #333;
}

body.dark-mode .chat-footer {
  background-color: #706f6f;
}

body.dark-mode .message-content {
  background-color: #2d2d2d;
  color: #ffffff;
}

body.dark-mode .copy-button {
  color: #ccc;
}

body.dark-mode .copy-button:hover {
  color: #fff;
}

body.dark-mode .stop-button {
  color: #ccc;
}

body.dark-mode .stop-button:hover {
  color: #fff;
}

body.dark-mode .stop-button::before {
  border-top-color: #ccc; /* Color del loader en modo oscuro */
}

#stop-ia-response {
  display: none; /* Oculto por defecto */
  background: none;
  border: none;
  color: #2a2929;
  cursor: pointer;
  font-size: 2rem;
  padding: 5px;
}

#stop-ia-response.visible {
  display: inline-block; /* Visible cuando la IA está escribiendo */
}

/* Estilos para el botón de detener */
.stop-button {
  position: relative;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  transition: color 0.3s ease;
}

.stop-button:hover {
  color: #000;
}

/* Animación del loader */
.stop-button::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 2px solid transparent;
  border-top-color: #666; /* Color del loader */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0; /* Oculto por defecto */
  transition: opacity 0.3s ease;
}

/* Mostrar el loader cuando el botón está activo */
.stop-button.visible::before {
  opacity: 1;
}

/* Animación de rotación */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loader {
  width: 30px;
  padding: 6px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0077cc;
  --_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;
  -webkit-mask: var(--_m);
  mask: var(--_m);
  -webkit-mask-composite: source-out;
  mask-composite: subtract;
  animation: l3 1s infinite linear;
}
@keyframes l3 {
  to {
    transform: rotate(1turn);
  }
}

/* Estilos para los botones de acciones (copiar y leer) */
.message-actions {
  display: flex;
  gap: 8px; /* Espacio entre los botones */
  margin-top: 8px; /* Espacio entre el texto y los botones */
}

.copy-button,
.read-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #666; /* Color gris para los íconos */
  font-size: 16px;
  transition: color 0.3s ease;
}

.copy-button:hover,
.read-button:hover {
  color: #007bff; /* Color azul al hacer hover */
}

.copy-button:active,
.read-button:active {
  transform: scale(0.95); /* Efecto de clic */
}

/* Estilo específico para el botón de leer */
.read-button {
  color: #ff6b6b; /* Color rojo suave para diferenciarlo */
}

.read-button:hover {
  color: #ff3b3b; /* Color rojo más intenso al hacer hover */
}

/* Estilos para el botón de voz */
#voice-input-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  transition: all 0.3s;
  position: relative;
  margin-right: 8px;
}

#voice-input-button:hover {
  color: #1894db;
  background-color: #d4d4d4;
}

#voice-input-button.recording {
  color: #e74c3c;
}

.fas.fa-microphone {
  font-size: 19px;
}

/* Efecto de ondas del micrófono */
.pulse-ring {
  display: none;
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px solid #e74c3c;
  border-radius: 50%;
  animation: pulse 1.5s ease-out infinite;
  opacity: 0;
}

@keyframes pulse {
  0% {
    transform: scale(0.1, 0.1);
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: scale(1.2, 1.2);
    opacity: 0;
  }
}

#voice-input-button.recording .pulse-ring {
  display: block;
}
