/* accessibility.css */

/* Importar fuente para dislexia */
@import url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/open-dyslexic-regular.css');

/* Variables CSS para personalización */
:root {
  --accessibility-primary: #1dc8ea;
  --accessibility-secondary: #fdc001;
  --accessibility-hover: #fdc001;
  --accessibility-text: #333;
  --accessibility-bg: #fff;
  --accessibility-panel-bg: #f8f9fa;
  --accessibility-border: #ddd;
}

/* Botón flotante */
/*.accessibility-float-btn {
  position: fixed;
  bottom: 30px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: white;
  border: 2px solid var(--accessibility-primary);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  display: none;
}*/
.accessibility-float-btn{
    width: 50px;
    height: 50px;
    position: fixed;
    bottom: 10px;
    right: 20px;
    display: inline;
    font-size: 25px;
    border-radius: 0;
    letter-spacing: 1px;
    text-align: center;
    line-height: 50px;
    color: #ffffff;
    font-weight: 900;
    border-radius: 20px;
    cursor: pointer;
    z-index: 12;
    background-color: #1dc8ea;
    display: none;
}

/*.accessibility-float-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.accessibility-float-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}*/

/* Panel de accesibilidad */
.accessibility-panel {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background-color: var(--accessibility-panel-bg);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  overflow-y: auto;
  transition: right 0.3s ease-in-out;
}

.accessibility-panel.active {
  right: 0;
}

.accessibility-header {
  padding: 15px;
  background-color: var(--accessibility-primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accessibility-header h2 {
  margin: 0;
  font-size: 18px;
  color:white
}

#accessibility-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.accessibility-content {
  padding: 15px;
}

.accessibility-section {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--accessibility-border);
  padding-bottom: 15px;
}

.accessibility-section:last-child {
  border-bottom: none;
}

.accessibility-section h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--accessibility-text);
}

.accessibility-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.accessibility-btn {
  background-color: #f0f0f0;
  border: 1px solid var(--accessibility-border);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--accessibility-text);
  transition: background-color 0.2s, box-shadow 0.2s;
}

.accessibility-btn:hover {
  background-color: #e9e9e9;
}

.accessibility-btn.active {
  background-color: var(--accessibility-primary);
  color: white;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.theme-controls {
  display: flex;
  justify-content: space-between;
}

.reset-all {
  width: 100%;
  background-color: var(--accessibility-secondary);
  color: white;
  font-weight: bold;
}

.reset-all:hover {
  background-color: var(--accessibility-primary);
}

/* Clases para aplicar a todo el sitio web */

/* Alto contraste */
body.high-contrast  {
  filter: contrast(150%);
}

/* Tema oscuro */
body.dark-theme {
  --accessibility-text: #f0f0f0;
  --accessibility-bg: #121212;
  --accessibility-border: #333;
  background-color: #121212 !important;
  color: #f0f0f0 !important;
}

body.dark-theme * {
  background-color: #121212 !important;
  color: #f0f0f0 !important;
  border-color: #444 !important;
}

body.dark-theme a {
  color: #4da3ff !important;
}

/* Tamaño de texto */
body.text-larger {
  font-size: 120% !important;
}

body.text-largest {
  font-size: 150% !important;
}

body.text-smaller {
  font-size: 90% !important;
}

/* Espaciado */
body.spacing-larger {
  letter-spacing: 1px !important;
  word-spacing: 3px !important;
  line-height: 1.8 !important;
}

body.spacing-largest {
  letter-spacing: 2px !important;
  word-spacing: 4px !important;
  line-height: 2.2 !important;
}

/* Fuente para dislexia */
body.dyslexic-font,
body.dyslexic-font *:not(.fa) {
  font-family: 'OpenDyslexic', sans-serif !important;
}

/* Resaltar enlaces */
body.highlight-links a {
  text-decoration: underline !important;
  color: #0000EE !important;
  font-weight: bold !important;
}

body.dark-theme.highlight-links a {
  color: #4da3ff !important;
}

/* Resaltar encabezados */
body.highlight-headings h1,
body.highlight-headings h2,
body.highlight-headings h3,
body.highlight-headings h4,
body.highlight-headings h5,
body.highlight-headings h6 {
  background-color: #f0f0f0 !important;
  border-left: 5px solid var(--accessibility-primary) !important;
  padding: 5px 10px !important;
  margin-top: 20px !important;
}

body.dark-theme.highlight-headings h1,
body.dark-theme.highlight-headings h2,
body.dark-theme.highlight-headings h3,
body.dark-theme.highlight-headings h4,
body.dark-theme.highlight-headings h5,
body.dark-theme.highlight-headings h6 {
  background-color: #333 !important;
  border-left: 5px solid #4da3ff !important;
}

/* Cursor grande */
body.big-cursor {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 16 16"><path fill="black" d="M4.5 2.498C4.5 4.23 5.844 4.498 6 4.498C6.156 4.498 7.5 4.23 7.5 2.498C7.5 0.767 6.156 0.5 6 0.5C5.844 0.5 4.5 0.767 4.5 2.498Z" /><path fill="black" d="M13.518 9C13.518 9 11.564 16 9.1 16C6.636 16 3.5 12.991 3.5 9C3.5 5.009 6.636 2 9.1 2C11.564 2 13.518 9 13.518 9Z" /></svg>'), auto;
}

body.big-cursor a,
body.big-cursor button,
body.big-cursor [role="button"],
body.big-cursor input,
body.big-cursor select,
body.big-cursor textarea {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 16 16"><path fill="black" stroke="white" d="M6 0.5L4.5 5L0 6L4.5 7L6 11.5L7.5 7L12 6L7.5 5L6 0.5Z" /></svg>'), auto;
}

/* Detener animaciones */
body.stop-animations *,
body.stop-animations *::before,
body.stop-animations *::after {
  animation: none !important;
  transition: none !important;
}

/* Guía de lectura */
.reading-guide-bar {
  position: fixed;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: rgba(255, 255, 0, 0.2);
  z-index: 9998;
  pointer-events: none;
  display: none;
}

body.reading-guide .reading-guide-bar {
  display: block;
}
/* ==========================================================
   ESTILOS PARA LECTOR DE PÁGINA Y AVATAR
   ========================================================== */

/* Contenedor del Avatar (esquina inferior izquierda) */
#lector-avatar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9998;
  display: none !important; /* Oculto por defecto */
  transition: opacity 0.3s ease;
}

#lector-avatar img {
  width: 120px; 
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accessibility-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  background-color: #fff; /* Fondo por si la imagen es transparente */
}

/* Estilos de los botones del lector */
.accessibility-btn#btn-read-page,
.accessibility-btn#btn-stop-reader {
  display: inline-flex;
  align-items: center;
  gap: 5px; /* Espacio entre icono y texto */
  width: 48%;
  box-sizing: border-box;
  justify-content: center;
}

/* Botón Leer/Pausar (Verde) */
.accessibility-btn#btn-read-page.reading {
  background-color: var(--accessibility-primary);
  color: white;
  border-color: var(--accessibility-secondary);
}

/* Botón Reanudar (Amarillo) */
.accessibility-btn#btn-read-page.paused {
  background-color: var(--accessibility-secondary);
  color: #333;
  border-color: var(--accessibility-primary);
}

/* Botón Detener (Rojo) */
.accessibility-btn#btn-stop-reader {
  background-color: var(--accessibility-secondary);
  color: white;
  border-color: var(--accessibility-primary);
}

.accessibility-btn#btn-stop-reader:hover {
  background-color: var(--accessibility-primary);
}
/* ==========================================================
   ESTILOS PARA LECTOR de PÁGINA Y AVATAR
   ========================================================== */

#lector-avatar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9998;
  display: none; /* Oculto por defecto */
  
  opacity: 0; /* Empieza invisible para el fade-in */
  transition: opacity 0.3s ease-in-out; /* Transición para difuminar */
}

/* Aplicar estilos a img Y video */
#lector-avatar img,
#lector-avatar video {
  width: 160px; 
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accessibility-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  background-color: #fff; /* Fondo por si la imagen es transparente */
}