/* Fuentes amigables */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
  --primary: #4361ee; /* Azul accesible */
  --secondary: #f72585; /* Rosa accesible */
  --accent: #4cc9f0; /* Cian claro */
  --background: #f1f1f1;
  --text: #333;
  --high-contrast: #000;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background);
  color: var(--text);
  margin: 0;
  padding: 0;
}

header {
  background-color: var(--primary);
  color: white;
  padding: 1rem;
  text-align: center;
  position: relative;
}

main {
  padding:0 1rem;
  max-width: 1280px;
  margin: 1.5rem auto;
}

.input-section {
  background: white;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.input-section label {
  font-weight: bold;
}

textarea {
  width: 100%;
  height: 100px;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  font-size: 1rem;
  border: 2px solid var(--primary);
  border-radius: 8px;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.option {
  flex: 1;
  min-width: 150px;
}

select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 2px solid var(--primary);
  margin-top: 0.5rem;
}

.buttons {
  display: flex;
  flex-direction: row; 
  align-items: center; 
   flex-wrap: wrap;   
  gap: 1rem;
  font-family: 'Poppins', sans-serif;              
}

.buttons button {
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  background-color: var(--secondary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-width: 200px; /* o el valor que prefieras */
  flex: 1; /* distribuye el espacio disponible */
}

/* ✨ Mejoras visuales para los botones */
.buttons button {
    transition: all 0.3s ease; /* Animación suave */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Sombra suave */
  }
  
  .buttons button:hover {
    background-color: var(--accent); /* Cambia a color celeste cuando pasás el mouse */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 0 10px var(--accent);
    /* Sombra más grande al pasar */
    transform: translateY(-2px); /* Se "levanta" un poquito */
  }
  
  .buttons button:active {
    transform: translateY(0); /* Vuelve a su lugar cuando clickean */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15); /* Sombra más apretada al click */
  }
  

#results-section {
  background: white;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

#table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border: 1px solid var(--primary);
  padding: 0.5rem;
  text-align: center;
}

canvas {
  margin-top: 2rem;
  width: 100% !important;
  max-height: 400px;
}

@media (max-width: 600px) {
  .options {
    flex-direction: column;
  }
  .buttons {
    flex-direction: column;
  }
}
/* 🎤 Estilo cuando el botón de voz está escuchando */
.listening {
    background-color: #f72585; /* Cambia a color rosa intenso */
    animation: pulse 1s infinite; /* Parpadeo suave */
  }
  
  /* 🎨 Animación de pulso */
  @keyframes pulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.6;
    }
  }
#voice-btn {
    background-color: var(--accent);
    color: black;
}

/* 📊 Estilo para el bloque de estadísticas */
.statistics {
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--text);
  }
  
  .statistics h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--primary);
  }
  
  .statistics p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
  }
  /* 🎤 Efecto pulsante cuando está escuchando */
.listening {
    animation: pulse 1.5s infinite;
    background-color: var(--secondary);
  }
  
  /* 🔥 Definimos la animación pulse */
  @keyframes pulse {
    0% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(247, 37, 133, 0.7);
    }
    70% {
      transform: scale(1.05);
      box-shadow: 0 0 10px 10px rgba(247, 37, 133, 0);
    }
    100% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(247, 37, 133, 0);
    }
  }

  #read-results-btn {
    flex: 1;
    padding: 0.8rem;
    font-size: 1rem;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  /* Efecto al pasar el mouse */
  #read-results-btn:hover {
    background-color: var(--accent);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 0 10px var(--accent);
    transform: translateY(-2px);
  }
  
  /* Efecto al presionar */
  #read-results-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  }

  .icono-picto {
    width: 32px;
    height: 32px;
    margin-left: 8px;
    vertical-align: middle;
  }

  .instructions-section {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 1.5rem auto;
    max-width: 1280px;
  }
  
  .instructions-section h2 {
    color: var(---high-contrast);
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .instructions-section ul {
    list-style: none;
    padding-left: 0;
  }
  
  .instructions-section li {
    margin-bottom: 1.5rem;
  }
  
  .step-number {
    font-size: 1.5rem;
    margin-right: 0.5rem;
  }
  
  .step-text {
    font-weight: bold;
    margin-top: 0.5rem;
  }
  
  .step-detail {
    font-size: 0.95rem;
    color: #555;
    margin-top: 0.3rem;
    padding-left: 2rem;
  }
  
  /* Responsive para pantallas chicas */
  @media (max-width: 600px) {
    .instructions-section li {
      font-size: 1rem;
    }
  }  
  
  .instructions-section li strong {
    margin-right: 0.5rem;
  }

  .instructions-buttons {
    margin-top: 1rem;
    text-align: center;
  }
  
  #read-instructions-btn {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  #read-instructions-btn:hover {
    background-color: var(--accent);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 0 10px var(--accent);
    transform: translateY(-2px);
  }
  
  #read-instructions-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  }
  
  .step-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
  }
  
  .step-number {
    font-size: 1.4rem;
  }
  
  .step-text {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
  }
  
  .step-detail {
    margin-left: 2.2rem;
    margin-top: 0.3rem;
    font-size: 0.95rem;
    color: #555;
  }
  
  /* Responsive para pantallas chicas */
  @media (max-width: 600px) {
    .step-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.2rem;
    }
  
    .step-number {
      font-size: 1.3rem;
    }
  
    .step-text {
      font-size: 1.1rem;
    }
  
    .step-detail {
      margin-left: 0;
      margin-top: 0.3rem;
    }
  }
 .position-measures {
  margin-top: 20px;
  background-color: #f7f8fa;
  padding: 15px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px; /* espacio entre elementos */
}

.measure-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.measure-selector select,
.measure-selector input {
  padding: 8px;
  font-size: 16px;
  border: 1px solid #3333cc;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
}

.measure-button {
  display: flex;
  justify-content: center;
  width: 100%;
}

.boton-estadistica {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #ff2f92; /* color fucsia */
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.boton-estadistica:hover {
  background-color: #e0267f;
}

.icono-boton {
  height: 24px;
  width: auto;
}

.contenedor-boton {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}


#position-result {
  font-weight: bold;
  color: var(--primary);
}
/* Estilos para las medidas de dispersión */
.statistics h3:nth-of-type(2) {
  margin-top: 1.5rem;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.statistics p strong {
  min-width: 200px;
  display: inline-block;
}

/* 🔥 Nuevo layout de 2 columnas */
.grid-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}


/* Asegurar que el textarea ocupe todo el ancho */
.input-section textarea {
  width: calc(100% - 1rem);
  
}

/* Ajustes responsivos */
@media (max-width: 900px) {
  .grid-container {
    grid-template-columns: 1fr;
  }
  
  .results-section {
    order: -1; /* Opcional: si quieres resultados arriba en móvil */
  }
}

/* Ajustes específicos para la sección de resultados */
.results-section {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#chart-canvas {
  flex-grow: 1;
  min-height: 300px;
}

/* 🎨 Contenedor del gráfico */
.chart-container {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

/* 📊 Ajustes para el canvas del gráfico */
#chart-canvas {
  width: 100% !important;
  height: 400px !important; /* Altura fija para mejor visualización */
}

/* 📋 Contenedor de resultados */
.results-container {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 📱 Responsive: Gráfico más alto en móviles */
@media (max-width: 600px) {
  #chart-canvas {
    height: 300px !important;
  }
}

/* Botón flotante */
#chat-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary);
  color: white;
  font-size: 1.5rem;
  padding: 0.8rem 1rem;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.3s ease;
}
#chat-fab:hover {
  transform: scale(1.1);
}

/* Imagen de la profe flotante */
#profe-marce-avatar {
  position: fixed;
  bottom: 100px;
  right: 80px;
  width: 80px;
  z-index: 9998;
  animation: wave 2s infinite;
}

/* Flecha apuntando al botón */
#chat-arrow {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 60px;
  z-index: 9998;
  animation: bounce 1.5s infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Ventana del chat */
#chat-window {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 300px;
  background-color: white;
  border: 2px solid var(--primary);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chat-window.hidden {
  display: none;
}

.chat-header {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem;
  font-weight: bold;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

#chat-window .chat-box {
  flex: 1;
  padding: 0.5rem;
  overflow-y: auto;
  max-height: 300px;  
  background-color: #f9f9f9;
  font-size: 0.95rem;
}

#chat-window input {
  padding: 0.5rem;
  border: none;
  border-top: 1px solid #ccc;
  width: 100%;
  box-sizing: border-box;
}

#chat-window button {
  padding: 0.5rem;
  background-color: var(--secondary);
  color: white;
  border: none;
  cursor: pointer;
}

.chat-history {
  max-height: 300px; 
  overflow-y: auto;
  padding-right: 8px;
}

.dot-typing {
  display: inline-block;
  position: relative;
  width: 1.5em;
  height: 1em;
}

.dot-typing::before {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  text-align: left;
  animation: typingDots 1.2s steps(3, end) infinite;
}

@keyframes typingDots {
  0%   { content: '';    }
  33%  { content: '.';   }
  66%  { content: '..';  }
  100% { content: '...'; }
}

.close-chat-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  margin-left: auto;
}

input::placeholder {
  font-family: 'Poppins', sans-serif;
}

#send-button,
#chatbox input {
  font-family: 'Poppins', sans-serif;
}

.boton-enviar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: bold;
  background-color: #f72c8c; 
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  gap: 8px; 
}

.boton-enviar img.icono-boton {
  width: 24px;
  height: 24px;
}

.boton-enviar:hover {
  background-color: #e0267f;
}


#chat-input, .boton-enviar {
  font-family: 'Poppins', sans-serif;
}

.btn-ver-pasos {
  background-color: #1976d2;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 12px;
  display: inline-block;
}

.pasos-resolucion {
  background-color: #e3f2fd;
  border-left: 4px solid #1976d2;
  padding: 10px;
  margin-top: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

.mathjax-scroll {
  overflow-x: auto;
  max-width: 100%;
  padding: 0.5rem;
}

.mathjax-scroll > * {
  white-space: nowrap;
}

.ayuda-datos, .ayuda-intervalos {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-top: 4px;
  line-height: 1.4;
}

#pictograma-container {
  font-size: 24px;
  padding: 10px;
  line-height: 1.5;
}
#pictograma-container div {
  margin-bottom: 8px;
}

.logo-titulo {
  display: flex;
  align-items: center;
  gap: 15px; 
}

.logo-profe {
  width: 60px;  
  height: auto;
  border-radius: 50%; 
  box-shadow: 0 2px 6px rgba(0,0,0,0.2); 
}

.titulo-texto {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.titulo-texto h1 {
  margin: 0;
  line-height: 1.3; 
  text-align: left;
  font-size: 1.5rem;
}

.titulo-texto h2 {
  margin: 0;
  line-height: 1.3;
  font-size: 1.1rem; 
  text-align: left;
}

header {
  padding: 0.5rem 1rem; 
}

footer {
  background-color: var(--primary);
  color: white;
  text-align: center;
  padding: 0.8rem;
  font-size: 0.9rem;
  margin-top: 2rem;
  border-top: 2px solid var(--accent);
}
footer a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 0.5rem;
}
footer a:hover {
  text-decoration: underline;
}

#generate-btn {
  background-color: #28a745; 
  color: #fff;
  font-weight: bold;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#generate-btn:hover {
  background-color: #218838; 
}

button:focus {
  outline: 3px solid #000;
}

button {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
  color: white;
  cursor: pointer;
}

#voice-btn {
  background-color: #00bcd4; /* Celeste */
}

#generate-btn {
  background-color: #4caf50; /* Verde */
}

#read-results-btn {
  background-color: #e91e63; /* Rosa */
}


.secondary-btn {

  background-color: #28a745;
  color: white;

  display: none; 
}

.secondary-btn:hover {
  background-color: #28a745;
}


.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

#download-pdf-btn {
  background-color: #e74c3c;
  margin-left: 10px;
}

#download-pdf-btn:hover {
  background-color: #c0392b;
}

@media (max-width: 600px) {
  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  #download-pdf-btn {
    margin-left: 0;
    margin-top: 10px;
  }
}

.instructions-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.instructions-column {
  margin: 0;
  padding: 0;
  list-style: none;
}

.instructions-column li {
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .instructions-columns {
    grid-template-columns: 1fr;
  }
}

.botones-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.boton-teoria, 
#download-pdf-btn {
  min-width: 250px; 
  width: auto; 
  padding: 12px 20px; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  white-space: nowrap; 
}


.boton-teoria {
  background-color: var(--primary);
  color: white;
  border: none;
  text-decoration: none;
}

#download-pdf-btn {
  
  color: white;
  border: none;
}


.boton-teoria:hover, 
#download-pdf-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}


@media (max-width: 600px) {
  .botones-container {
    gap: 10px;
  }}
  
  .boton-teoria, 
  #download-pdf-btn {
    min-width: 220px; 
    padding: 10px 15px; 
}

textarea {
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

.boton-feedback {
  background-color: #4CAF50;
  color: white;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 0 auto;
  display: block; /* Para que funcione el centrado */
  transition: background-color 0.3s ease;
}

.boton-feedback:hover {
  background-color: #45a049;
}
