/* --- LionMind -----
// Agosto/2025
// Front. Estilos del sitio.
// Desarrollado por: LionIA (c).
//------------------- */

/* ====== Base general ====== */
body.dark {
  margin: 0;
  font-family: 'Segoe UI', Roboto, sans-serif;
  background: #121212;
  color: #eaeaea;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ====== Header (toolbar / topbar) ====== */
.toolbar, .topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1f1f1f;
  padding: 10px 16px;
  border-bottom: 1px solid #333;
}

.toolbar-title, .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}

.logo-toolbar {
  height: 45px;
}

.actions {
  display: flex;
  gap: 10px;
}

.primary, .secondary, .tab {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}


.primary {
  background: #6c63ff;
  color: #fff;
  padding: 8px 16px;
}

.primary:hover {
  background: #5a54d6;
}

.secondary {
  background: #2c2c2c;
  color: #ddd;
  padding: 6px 14px;
}

.secondary:hover {
  background: #3a3a3a;
}

/* ====== Contenedor login / register ====== */
.container.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: #1f1f1f;
  padding: 20px;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.card .title {
  margin: 0 0 20px;
  font-size: 22px;
  text-align: center;
  color: #fff;
}

/* ====== Tabs (login/register/confirm) ====== */
.tabs {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
}

.tab {
  flex: 1;
  padding: 8px;
  background: #2c2c2c;
  color: #aaa;
}

.tab.active {
  background: #6c63ff;
  color: #fff;
}

/* ====== Formularios ====== */
.view label {
  display: block;
  margin: 10px 0 4px;
  font-size: 14px;
  color: #bbb;
}


.view input:focus {
  border-color: #6c63ff;
  outline: none;
}

.view button {
  margin-top: 15px;
  width: 100%;
}

/* ====== Chat layout ====== */
.chat-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.chat-box {
  height: 400px; /* ajusta según tu diseño */
  max-height: 60vh; /* opcional, si querés que sea dinámico */
  overflow-x: hidden;
  overflow-y: auto; /* habilita el scroll vertical */
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.bubble {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 80%;
  text-indent: 0;
  text-align: left;
   /* 👇 Evita cortes feos de palabras/signos */
  white-space: normal;       /* NO usar pre-wrap aquí */
  word-break: normal;        /* no cortar palabras “porque sí” */
  overflow-wrap: anywhere;   /* solo rompe si es necesario */
  hyphens: auto;             /* si puede, guiona en vez de cortar raro */
}

.bubble.user {
  align-self: flex-end;
  background: #6c63ff;
  color: #fff;
}

.bubble.bot {
  align-self: flex-start;
  background: #2c2c2c;
  color: #eaeaea;
}

.bubble.info {
  align-self: center;
  background: #444;
  color: #ccc;
  font-style: italic;
}

/* ====== Chat input ====== */
.chat-input {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #1f1f1f;
  border-top: 1px solid #333;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #2c2c2c;
  color: #fff;
}

.chat-input input:focus {
  border-color: #6c63ff;
  outline: none;
}

/* ====== Popover idioma ====== */
.popover {
  position: absolute;
  top: 60px;
  right: 16px;
  background: #1f1f1f;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  z-index: 1000;
}

.popover.hidden {
  display: none;
}

.popover-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.popover-content li button {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: none;
  color: #eaeaea;
  text-align: left;
}

.popover-content li button:hover {
  background: #2c2c2c;
}

/* ====== Modal instrucciones ====== */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #6c63ff;
  color: #fff;
  padding: 12px;
  border-radius: 8px 8px 0 0;
}

.modal-body {
  background: #1f1f1f;
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  border-radius: 0 0 8px 8px;
  color: #eaeaea;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  background: #2c2c2c;
  padding: 12px;
  border-top: 1px solid #444;
  border-radius: 0 0 8px 8px;
}

.modal-footer button {
  margin-left: 10px;
}

.close-btn {
  background: #fff;
  color: #6c63ff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}

/* ====== Alertas ====== */
.alert {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.alert.hidden {
  display: none;
}

.alert-box {
  background: #1f1f1f;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.alert-header {
  font-size: 20px;
  font-weight: bold;
  color: #6c63ff;
}

.alert-message {
  margin: 15px 0;
  color: #ddd;
}

.alert-buttons {
  display: flex;
  flex-direction: column; /* Botones uno debajo del otro */
  gap: 12px; /* Espaciado vertical entre botones */
  margin-top: 20px; /* Separación con el texto */
}

.alert-buttons button {
  background: #6c63ff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
  width: 100%; /* Botones ocupan todo el ancho */
}

.alert-buttons button:hover {
  background: #5a54d6;
}


/* ====== Footer ====== */
.fixed-footer {
  background: #1f1f1f;
  color: #999;
  padding: 10px;
  text-align: center;
  border-top: 1px solid #333;
}

.footer-content p {
  margin: 4px 0;
  font-size: 13px;
}

/* ====== Utilidades ====== */
.hidden { display: none !important; }

/* ====== Responsivo ====== 
@media (max-width: 600px) {
  .toolbar-title span { font-size: 14px; }
  .card { padding: 15px; }
  .chat-input button { padding: 6px 12px; }
  .bubble { max-width: 95%; }
} */

/* ====== visor pass ====== */
.password-container {
  position: relative;
  width: 100%;
  display: block; /* que no actúe como flex horizontal */
}

.view input,
.password-container input {
  width: 100%;
  padding-right: 40px; /* espacio para el botón ojo */
  border-radius: 6px;
  border: 1px solid #333;
  background: #2c2c2c;
  color: #fff;
  height: 40px;
  font-size: 16px;
  box-sizing: border-box;
}

.password-container .toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-98%); /* mueve un poquito más arriba */
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #444;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
}

.password-container .toggle-password:hover {
  background: #555;
  color: #fff;
}

/* ====== Ocultar ícono nativo de Edge ====== */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

/* ====== Botones circulares del toolbar ====== */

.toolbar-buttons {
  display: flex;
  flex-direction: row; /* horizontal */
  align-items: center;
  gap: 10px; /* separación entre botones */
}

.toolbar-buttons .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #555;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}

.toolbar-buttons .icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.toolbar-buttons .icon-btn:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.95);
}

/* Estilo unificado para el selector */
#model-select {
  background: #2c2c2c;
  color: #ddd;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#model-select:hover {
  background: #3a3a3a;
}

#model-select:focus {
  outline: none;
  border-color: #6c63ff;
}

.divider {
  border: none;
  height: 1px;
  background: #444;
  margin: 20px 0;
}

/* Header fijo */
.toolbar, .topbar {
  position: sticky; /* o 'fixed' si querés que siempre esté visible */
  top: 0;
  z-index: 1000; /* para que quede por encima de otros elementos */
}

/* Ajustar el chat para que no quede debajo del header */
.chat-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 60px; /* altura aproximada del header, ajustá si cambia */
}

/* Contenedor general del mensaje */
.message-container {
  display: flex;
  flex-direction: column;
  max-width: 80%; /* Más espacio para que no se corte */
  margin-bottom: 12px;
}


/* Mensajes del usuario a la derecha */
.user-container {
  align-self: flex-end;
  text-align: right;
}

/* Mensajes del bot a la izquierda */
.bot-container {
  align-self: flex-start;
  text-align: left;
}

/* Estilo del timestamp */
.timestamp {
  font-size: 0.7em;
  color: #999;
  margin-top: 2px;
}

/* Botón alineado a la derecha dentro de la burbuja */
.btn-corregir-bubble-right {
  padding: 4px 10px;
  font-size: 13px;
  background: #2c2c2c;
  color: #ddd;
  border: 1px solid #444;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;

  /* Posición dentro de la burbuja */
  display: inline-block;
  float: right;       /* Alinea a la derecha */
  margin-top: 8px;
}

.btn-corregir-bubble-right:hover {
  background: #3a3a3a;
  color: #fff;
}

/* Para que la burbuja contenga correctamente el botón flotante */
.bubble.bot::after {
  content: "";
  display: block;
  clear: both;
}

.textarea-estilo {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #1e1e1e; /* Fondo oscuro */
  color: #f1f1f1; /* Texto claro */
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border 0.2s ease-in-out;
}

.textarea-estilo:focus {
  border-color: #00bfff; /* Azul cuando está enfocado */
}

/*Barra de carga*/
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #ccc;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.thinking {
  display: flex;
  align-items: center;
  color: #666;
  font-style: italic;
}

.footer-message {
  background: #333;         /* Fondo integrado con el chat */
  color: #ffa500;           /* Texto naranja */
  text-align: center;
  padding: 6px 10px;
  font-size: 13px;
  border-top: 1px solid #444;
}

.footer-message.hidden {
  display: none;
}

/* ============================= */
/* 🎨 Estilos personalizados del scroll para el chat */
/* ============================= */

/* Firefox: Scroll fino y colores básicos */
#chat-box {
  scrollbar-width: thin;              /* Scroll fino */
  scrollbar-color: #ff9800 #1e1e1e;   /* Barra naranja, fondo oscuro */
}

/* Chrome, Edge, Opera y navegadores WebKit */
#chat-box::-webkit-scrollbar {
  width: 8px;                         /* Ancho del scroll */
}

#chat-box::-webkit-scrollbar-track {
  background: #1e1e1e;                /* Fondo oscuro */
  border-radius: 10px;
}

#chat-box::-webkit-scrollbar-thumb {
  background: #ff9800;                 /* Scroll naranja */
  border-radius: 10px;
  border: 2px solid #1e1e1e;           /* Espaciado interno, efecto de profundidad */
  transition: background 0.3s ease;    /* Animación suave */
}

#chat-box::-webkit-scrollbar-thumb:hover {
  background: #ffa733;                 /* Más claro en hover */
}

/* ============================= */
/* 💨 Efecto minimalista opcional: scroll visible solo al pasar el mouse */
/* ============================= */
#chat-box::-webkit-scrollbar {
  width: 0px;
}

#chat-box:hover::-webkit-scrollbar {
  width: 8px; /* Aparece solo cuando el usuario interactúa */
}

/* ============================= */
/* 🔹 Ajuste extra para que no tape el footer del sitio */
/* ============================= */
#chat-box {
  padding-bottom: 12px; /* deja espacio inferior para el último mensaje */
  scroll-behavior: smooth; /* scroll suave */
}

/* Loader pequeño dentro del botón */
.btn-loader {
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px; /* separación entre texto y loader */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Estado deshabilitado del botón */
button.primary:disabled {
  background-color: #999999;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Contenedor del checkbox */
.check-container {
  display: flex;
  align-items: center;
  margin-left: 10px;
  cursor: pointer;
  user-select: none;
}

/* Ocultar checkbox por defecto */
.check-container input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid #ccc;
  border-radius: 3px;
  margin-right: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  background: #fff;
}

/* Cuando está marcado */
.check-container input[type="checkbox"]:checked {
  background-color: #4CAF50;
  border-color: #4CAF50;
}

/* Check dentro de la caja */
.check-container input[type="checkbox"]:checked::after {
  content: '✔';
  position: absolute;
  top: -3px;
  left: 1px;
  font-size: 11px;
  color: white;
}

/* Texto al lado */
.check-label {
  font-size: 13px;
  color: orange;
   font-weight: bold; /* 🔹 Aplica negrita al texto */
}

.predictions-list {
  margin-top: 8px;
  font-size: 13px;
  color: #fff;
}

.predictions-list ul {
  margin: 4px 0 0 0;
  padding-left: 16px;
}

.predictions-list li {
  margin-bottom: 4px;
}

.prediction-plot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.prediction-plot {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  margin-bottom: 8px;
}

.download-plot-btn {
  background-color: #007bff;
  color: white;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.download-plot-btn:hover {
  background-color: #0056b3;
}

/* Estilo del label */
.attach-file-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;          /* menos padding */
  border: 1px solid #ccc;
  border-radius: 4px;    /* bordes más pequeños */
  background-color: #f0f0f0;
  transition: background-color 0.2s;
  font-size: 0.8rem;     /* tamaño de fuente general */
}

/* Efecto hover */
.attach-file-label:hover {
  background-color: orange;   /* color al pasar el mouse */
  border-color: orange;       /* cambia también el borde */
}

/* Icono más pequeño */
.attach-icon {
  font-size: 1.2rem;     /* tamaño reducido */
  margin: 0;             /* quitar margen extra */
}

/* Input oculto */
.attach-file-label input[type="file"] {
  display: none;
}

/* ============================= */
/* 📱 Mejoras de diseño responsive para móviles */
/* ============================= */
@media (max-width: 768px) {
  body.dark {
    flex-direction: column;
    overflow-x: hidden;
  }

  .topbar, .toolbar {
    flex-wrap: wrap;
    text-align: center;
    padding: 8px;
  }

  .actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
  }

  .chat-input {
    flex-wrap: wrap;
    gap: 6px;
  }

  .chat-input input {
    width: 100%;
    font-size: 16px;
  }

  .chat-input button,
  #model-select,
  #attach-label,
  .check-container {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .bubble {
    max-width: 95%;
    font-size: 15px;
    padding: 8px 12px;
  }

  .footer-message {
    font-size: 12px;
    padding: 8px;
  }

  .modal-body {
    width: 90%;
    font-size: 14px;
  }

  .logo-toolbar {
    height: 35px;
  }
  
   .check-container {
    width: auto !important;     /* restaura tamaño natural */
    justify-content: flex-start; /* alinea a la izquierda */
    margin: 0 auto;              /* lo centra si está solo */
  }

  .check-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }

  .check-label {
    font-size: 14px;
  }
}

/* Estilizar respuesta del bot */

.bubble.bot h1, 
.bubble.bot h2, 
.bubble.bot h3 {
  margin: 6px 0;
  font-weight: 600;
  color: #fff;
}

.bubble.bot ul {
  margin: 6px 0 6px 18px;
  padding-left: 10px;
  list-style-type: disc;
}

.bubble.bot a {
  color: #ffa500;
  text-decoration: underline;
}

.bubble.bot a:hover {
  color: #ffcc66;
}
