/* ===== PREVENCIÓN DE PARPADEO MODO OSCURO ===== */
.dark-mode-loading {
  transition: none !important;
}

.dark-mode-loading * {
  transition: none !important;
}

/* ===== SISTEMA DE COLORES MODERNO ===== */
:root {
  /* Colores principales mejorados */
  --primary-blue: #2563eb;
  --primary-blue-light: #3b82f6;
  --primary-blue-dark: #1d4ed8;
  --primary-blue-subtle: rgba(37, 99, 235, 0.1);
  
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-dark: #d97706;
  --accent-gold-subtle: rgba(245, 158, 11, 0.1);
  
  /* Sistema de espaciado unificado */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-xxl: 64px;
  --spacing-xxxl: 80px;
  
  /* Sistema de grises sofisticado */
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  
  /* Colores semánticos */
  --success: #10b981;
  --success-light: #34d399;
  --success-subtle: rgba(16, 185, 129, 0.1);
  
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --warning-subtle: rgba(245, 158, 11, 0.1);
  
  --error: #ef4444;
  --error-light: #f87171;
  --error-subtle: rgba(239, 68, 68, 0.1);
  
  --info: #3b82f6;
  --info-light: #60a5fa;
  --info-subtle: rgba(59, 130, 246, 0.1);
  
  /* Colores de fondo */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  /* Colores de texto */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  
  /* Bordes */
  --border-primary: #e5e7eb;
  --border-secondary: #d1d5db;
  --border-focus: var(--primary-blue);
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Transiciones */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-bounce: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo oscuro */
body.active {
  --primary-blue: #60a5fa;
  --primary-blue-light: #93c5fd;
  --primary-blue-dark: #3b82f6;
  --primary-blue-subtle: rgba(96, 165, 250, 0.15);
  
  --accent-gold: #fbbf24;
  --accent-gold-light: #fcd34d;
  --accent-gold-dark: #f59e0b;
  --accent-gold-subtle: rgba(251, 191, 36, 0.15);
  
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --border-primary: #334155;
  --border-secondary: #475569;
  --border-focus: var(--accent-gold);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Global mobile text rendering improvements for gradient backgrounds */
@media (max-width: 768px) {
  h1, h2, h3, h4, h5, h6, p, span, div {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
  }
  
  /* Specific fixes for text over gradient backgrounds */
  .books-title, .books-subtitle, .content-section h2, .content-section p,
  .final-cta-section *, .guide-cta-section *, .cta-title, .cta-description {
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
    will-change: transform !important;
  }
  
  /* Fix for main background issues on mobile */
  body {
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .main {
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
    flex: 1 !important;
  }
  
  /* Ensure footer is visible on mobile */
  footer.footer,
  .footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
  }
}

/* Additional fixes for smaller mobile screens */
@media (max-width: 480px) {
  body {
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .main {
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
    flex: 1 !important;
  }
  
  .books-selection-container {
    background: transparent !important;
    position: relative !important;
    z-index: 2 !important;
  }
  
  /* Ensure footer is visible on small mobile screens */
  footer.footer,
  .footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
  }
}

/* Animación de desvanecimiento */
#animacion {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

/* Animación  de imagén*/
@keyframes beat {

  0%,
  50%,
  100% {
    transform: scale(1, 1);
  }

  30%,
  80% {
    transform: scale(0.92, 0.95);
  }
}

.img-animacion {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 100%;
  animation: 1.5s ease 0s infinite beat;
}

#contenido {
  display: none;
}

#contenido.mostrar {
  display: block;
}

.oculto {
  opacity: 0;
  transition: opacity 1s ease-in;
}

.mostrar {
  opacity: 1;
}

/*Fin de animación */

* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent
}

body {
  min-height: 100vh;
  box-sizing: border-box;
  background: var(--bg-primary);
  transition: background var(--transition-normal);
  /* Global mobile text rendering improvements */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Ensure footer is always visible */
  padding-bottom: 0;
  margin-bottom: 0;
  /* Flexbox layout to ensure footer stays at bottom */
  display: flex;
  flex-direction: column;
}

body.active {
  background: var(--bg-secondary);
}

/* ENLACES */
a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--primary-blue-light);
}

body.active a {
  color: var(--primary-blue-light);
}

body.active a:hover {
  color: var(--accent-gold);
}

a:focus-visible, .button:focus-visible {
  outline: 2px dashed var(--accent-gold);
  outline-offset: 3px;
}

/* TEXTO */
body {
  color: var(--text-primary);
}

body.active {
  color: var(--text-primary);
}

h1,
h3 {
  font-family: 'Alegreya Sans', sans-serif;
  font-weight: bold;
  color: var(--primary-blue);
  letter-spacing: 1.5px;
  text-align: center;
  margin: 20px 0;
  transition: color var(--transition-normal);
}

body.active h1,
body.active h2,
body.active h3 {
  color: var(--accent-gold);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}


/*************************
 🎛️ NAVEGACIÓN Y HEADER
**************************/
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-primary);
  padding: 0px 10%;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-primary);
  transition: all var(--transition-normal);
}

body.active .header {
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
  box-shadow: var(--shadow-xl);
  border-bottom: 1px solid var(--accent-gold-subtle);
}

body.active .header .nav {
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(253, 194, 28, 0.2);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

body.active .header .nav .nav-opcions {
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
}

.header .nav .nav-opcions a:hover {
  border-bottom: var(--accent-gold) 1px solid;
}

/* Indicador de página activa */
.nav-opcions li a.active {
  color: var(--accent-gold) !important;
  border-bottom: 2px solid var(--accent-gold);
  font-weight: 600;
}

body label .img-menu {
  height: 25px;
  width: 25px;
  margin-right: -19px;
  filter: invert(98%) sepia(3%) saturate(3632%) hue-rotate(300deg) brightness(111%) contrast(90%);
}

body.active label .img-menu {
  filter: none;
}

.icon-logo {
  width: 30px;
  height: 30px;
}

.texto-logo {
  font-family: "Alegreya Sans", sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 25px;
  color: var(--primary-blue);
  transition: color var(--transition-normal);
}

.texto-logo a {
  transition: all var(--transition-normal);
}

.texto-logo a:hover {
  transform: scale(1.05);
}

.texto-logo a:hover .icon-logo {
  transform: rotate(5deg) scale(1.1);
  transition: all var(--transition-normal);
}

body.active .texto-logo a:hover {
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

@media(max-width:480px) {
  .texto-logo {
    font-size: 23px;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: auto;
  }
}

body.active .texto-logo {
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.nav ul {
  list-style: none;
}

body.active .header .nav ul {
  background-color: #313131;
}

.header .nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header .nav ul li {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header .nav ul div {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Auth state specific styling */
#auth-state {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 200px;
  height: 100%;
  margin-left: auto;
}

#login-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  font-size: 23px;
  color: black;
  letter-spacing: 0.8px;
  text-decoration: none;
  transition: all .2s ease;
  white-space: nowrap;
  height: 100%;
  box-sizing: border-box;
  min-width: 200px;
  justify-content: center;
}

/* Removed - now handled by user-menu.css */

/* Navigation options styling */
.header .nav .nav-opcions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header .nav .nav-opcions > li {
  flex-shrink: 0;
}

/* Auth state specific styling */
#auth-state {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 200px;
  height: 100%;
}

#login-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  font-size: 23px;
  font-weight: 500;
  color: black;
  letter-spacing: 0.8px;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

#login-link:hover {
  color: #fdc21c;
  background-color: rgba(253, 194, 28, 0.1);
  transform: translateX(5px);
}

/* Estilos para el menú de usuario */
.user-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  white-space: nowrap;
  height: 100%;
}


.header .nav .nav-opcions li a {
  font-size: 23px;
  color: black;
  letter-spacing: 0.8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 20px;
  transition: all .2s ease;
  white-space: nowrap;
}

body.active .header .nav ul a {
  color: #f1f5f9;
}

body.active .header .nav ul li a {
  color: #f1f5f9;
  border-bottom: 1px solid rgba(253, 194, 28, 0.1);
}

body.active .header .nav ul li a:hover {
  color: #fdc21c;
  background-color: rgba(253, 194, 28, 0.1);
  transform: translateX(5px);
  text-shadow: 0 0 5px rgba(253, 194, 28, 0.3);
}

/* Removed old float-based hover behavior - now handled by .dropdown:hover */

#toggle,
.header label {
  display: none;
  cursor: pointer;
}

/*************************
 🌗 MODO OSCURO
**************************/
.ModoDark {
  width: 60px;
  height: 30px;
  padding: 5px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  border-radius: 100px;
  border: black solid 1.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: rgba(253, 194, 28, 0.2);
  -webkit-touch-callout: none;
  /* DESACTIVADO PARA DESARROLLO */
  /* -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none; */
  touch-action: manipulation;
}

.ModoDark i {
  font-size: 1rem;
  color: var(--accent-gold);
}

.ModoDark::before {
  content: "";
  position: absolute;
  height: 25px;
  width: 25px;
  border-radius: 50%;
  background-color: #fff;
  border: solid thin #000;
  left: 0;
  right: unset;
}

.ModoDark.active::before {
  right: 0;
  left: unset;
  border: solid thin #fff;
}

.ModoDark.active i:first-child {
  color: #fff;
}

.ModoDark.active {
  background-color: var(--accent-gold-dark);
  border: solid 2px var(--bg-primary);
}

/* Enhanced touch feedback for dark mode toggle */
.ModoDark:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ModoDark:active {
  transform: scale(0.95);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile-specific touch feedback */
@media (max-width: 768px) {
  .ModoDark:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  }
  
  .ModoDark:active {
    transform: scale(0.92);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.15);
  }
}


@media (max-width: 990px) {
  ul.nav-opcions {
    display: flex;
    flex-direction: row;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  ul.nav-opcions li {
    margin: 0 10px;
  }
  #auth-state {
    order: 2;
  }
  .MDark {
    order: 1;
    padding: 12px 16px; /* Better touch target for tablet */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Enhanced dark mode toggle for tablet */
  .ModoDark {
    width: 65px;
    height: 32px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .ModoDark:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
}

@media(max-width:1120px) {
  .header label {
    display: initial;
  }

  .header {
    padding: 20px 10%;
  }

  .header .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    width: 100%;
  }

  .header .nav ul li {
    width: 100%;
  }

  .header .nav ul .MDark {
    width: 100%;
  }

  .header .nav ul li a {
    padding: 12px 30px 12px 10%;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .header .nav ul li a:hover {
    background-color: rgba(253, 194, 28, 0.1);
    color: #0e7ae7;
    transform: translateX(5px);
  }

  .header .nav ul .MDark {
    padding: 16px 20px; /* Increased padding for better touch target */
    min-height: 48px; /* Minimum touch target size */
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .ModoDark {
    max-width: 70px; /* Slightly larger for mobile */
    min-width: 60px;
    height: 35px; /* Increased height for better touch target */
    padding: 6px; /* Increased padding */
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  /* Enhanced mobile touch feedback for dark mode toggle */
  .ModoDark:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  
  .ModoDark:active {
    transform: scale(0.95);
  }

  #toggle:checked ~ .nav {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }
  
  /* Asegurar que el menú sea visible cuando está activo */
  .header .nav ul {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  
  /* Estilos específicos para modo oscuro en móvil */
  body.active .header .nav {
    background-color: rgba(15, 23, 42, 0.98) !important;
    border-bottom: 1px solid rgba(253, 194, 28, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
  }
  
  /* Additional mobile-specific improvements for very small screens */
  @media (max-width: 480px) {
    .header .nav ul .MDark {
      padding: 18px 24px; /* Even larger padding for small screens */
      min-height: 52px; /* Larger touch target for small screens */
    }
    
    .ModoDark {
      width: 75px; /* Larger for small screens */
      height: 38px; /* Increased height */
      padding: 8px; /* More padding */
    }
    
    .ModoDark::before {
      height: 28px; /* Larger toggle circle */
      width: 28px;
    }
    
    .ModoDark i {
      font-size: 1.1rem; /* Slightly larger icons */
    }
  }
  }
  
  body.active .header .nav ul {
    background-color: transparent !important;
  }

  /*  END OF Drop-down menu  */
}

.main {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: transparent;
  /* Ensure main takes up available space */
  flex: 1;
}

@media(max-width:1120px) {
  .main {
    margin-top: 110px;
    min-height: calc(100vh - 110px);
  }
}

@media(max-width:480px) {
  .main {
    margin-top: 85px;
    min-height: calc(100vh - 85px);
  }
}

/* Estilos específicos para iPhone SE y dispositivos muy pequeños */
@media(max-width: 414px) {
  .header {
    padding: 15px 5%;
  }
  
  .main {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
  }
  
  .texto-logo {
    font-size: 20px;
  }
}

@media(max-width: 375px) {
  .header {
    padding: 12px 5%;
  }
  
  .main {
    margin-top: 75px;
    min-height: calc(100vh - 75px);
  }
  
  .texto-logo {
    font-size: 18px;
  }
}

@media(max-width: 320px) {
  .header {
    padding: 10px 5%;
  }
  
  .main {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
  }
  
  .texto-logo {
    font-size: 16px;
  }
}

/*************************
 📖 SECCIÓN DE CAPÍTULOS Y CONTENIDO
**************************/
.chapters-and-content {
  display: flex;
  flex: 1;
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  margin-top: 100px; /* Espacio para el header fijo - Pride and Prejudice */
}

.chapter {
  flex: 0 0 220px;
  background-color: var(--bg-primary);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  height: fit-content;
  position: sticky;
  top: 120px;
  border: 1px solid var(--border-primary);
  transition: all var(--transition-normal);
}

body.active .chapter {
  background-color: var(--bg-secondary);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--accent-gold-subtle);
}



.chapterTittle {
  font-family: 'Alegreya Sans', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  text-align: center;
  color: var(--primary-blue);
  line-height: 1.3;
}

body.active .chapterTittle {
  color: var(--accent-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@media(max-width:990px) {
  .chapterTittle {
    font-size: 1.3rem;
  }
}



/*************************
 🔘 BOTONES DE CAPÍTULOS
**************************/
.button {
  border: 2px solid var(--accent-gold);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: bold;
  font-family: ArialMT, Helvetica Neue, Arial, Liberation Sans, FreeSans, sans-serif;
  background-color: var(--bg-primary);
  color: var(--primary-blue);
  cursor: pointer;
  transition: all var(--transition-bounce);
  width: 100%;
  margin-bottom: 6px;
  text-align: center;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.button:hover {
  background-color: var(--accent-gold);
  color: var(--gray-900);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-gold-light);
}

.button:focus {
  outline: 2px dashed var(--accent-gold);
  outline-offset: 3px;
}

body.active .button {
  background-color: var(--bg-secondary);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  backdrop-filter: blur(5px);
}

body.active .button:hover {
  background-color: var(--accent-gold);
  color: var(--gray-900);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

body.active .button:focus {
  background-color: var(--accent-gold);
  color: var(--gray-900);
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

/* Estado seleccionado para botones de capítulos */
.button.selected-chapter {
  background-color: var(--accent-gold);
  color: var(--gray-900);
  border-color: var(--accent-gold);
  font-weight: bold;
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
  transform: translateY(-2px);
}

body.active .button.selected-chapter {
  background-color: var(--accent-gold);
  color: var(--gray-900);
  border-color: var(--accent-gold);
  font-weight: bold;
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

.hidden {
  display: none;
}

.chaptersList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

body.active .background .main .chapter .chaptersList li a {
  color: #cfcfcf;
}

/*  📖 CONTENIDO DEL LIBRO */
.content {
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.box-content {
  background-color: var(--bg-primary);
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--shadow-md);
  height: fit-content;
  border: 1px solid var(--border-primary);
  transition: all var(--transition-normal);
  overflow: visible;
  position: relative;
  margin-top: 0; /* Sin margin-top - se maneja desde chapters-and-content */
}

/* box-content ya no tiene margin-top por defecto */

@media(max-width:650px) {
  .box-content {
    padding: 20px;
  }
}

@media(max-width:480px) {
  .box-content {
    padding: 15px;
  }
}

body.active .content .box-content {
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--accent-gold-subtle);
}

body.active .content .box-content h1 {
  color: var(--text-primary);
}

.tittleLittlePrince {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  padding-top: 14px;
  margin-bottom: 12px;
  color: var(--primary-blue);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.1;
  font-family: 'Alegreya Sans', sans-serif;
  transition: all var(--transition-normal);
}

@media(max-width:480px) {
  .tittleLittlePrince {
    font-size: 2.2rem;
  }
}

@media(max-width:320px) {
  .tittleLittlePrince {
    font-size: 2rem;
  }
}

.autor {
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  text-align: center;
  padding-top: 0;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-weight: 400;
  font-style: italic;
  opacity: 0.8;
  transition: color var(--transition-normal);
}

body.active .tittleLittlePrince {
  color: var(--accent-gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.active .autor {
  color: var(--text-secondary);
  text-shadow: 0 0 3px rgba(203, 213, 225, 0.2);
}

/*************************
 🔘 BOTONES DE NAVEGACIÓN (PREVIOUS/NEXT)
**************************/
#pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
  transition: border-color var(--transition-normal);
}

body.active #pages {
  border-top-color: var(--accent-gold-subtle);
  border-bottom-color: var(--accent-gold-subtle);
}

.page-button {
  font-size: 16px;
  font-weight: bold;
  padding: 12px 24px;
  border-radius: 8px;
  color: var(--primary-blue);
  cursor: pointer;
  background-color: var(--bg-primary);
  border: 2px solid var(--primary-blue);
  transition: all var(--transition-bounce);
  min-width: 100px;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.page-button:hover {
  background-color: var(--primary-blue);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.page-button:focus {
  outline: 2px dashed var(--accent-gold);
  outline-offset: 3px;
}

body.active .page-button {
  background-color: var(--bg-secondary);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  backdrop-filter: blur(5px);
}

body.active .page-button:hover {
  background-color: var(--accent-gold);
  color: var(--gray-900);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

#current-page-total-pages {
  color: var(--primary-blue);
  font-weight: bold;
  font-size: 16px;
  min-width: 80px;
  text-align: center;
  transition: color var(--transition-normal);
}

body.active #current-page-total-pages {
  color: var(--accent-gold);
  text-shadow: 0 0 5px var(--accent-gold-subtle);
}

.chapterNumber {
  font-size: 1.1rem;
  font-weight: 500;
  font-family: 'Alegreya Sans', sans-serif;
  text-align: center;
  padding-top: 10px;
  color: var(--text-muted);
  transition: color var(--transition-normal);
  letter-spacing: 0.5px;
  display: block;
  visibility: visible;
  opacity: 1;
  margin: 0;
  position: relative;
  z-index: 1;
}

body.active .chapterNumber {
  color: var(--accent-gold);
  text-shadow: 0 0 5px var(--accent-gold-subtle);
}

/* Force visibility of chapter numbers */
.chapterNumber,
h2.chapterNumber {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 10 !important;
}

/*************************
 📱 RESPONSIVE DESIGN
**************************/
@media(max-width: 1200px) {
  .chapters-and-content {
    padding: 15px;
    gap: 15px;
    margin-top: 25px; /* Espacio mínimo para tablets/iPads */
  }
}

@media(max-width: 1120px) {
  .chapters-and-content {
    margin-top: 20px; /* Espacio mínimo para iPads cuando el header cambia */
  }
  
  .chapter {
    flex: 0 0 200px;
    padding: 15px;
  }
  
  .button {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 36px;
  }
}

@media(max-width: 990px) {
  .chapters-and-content {
    flex-direction: column;
    gap: 20px;
    margin-top: 70px; /* Espacio para móviles */
  }
  
  .chapter {
    flex: none;
    position: static;
    order: 2;
  }
  
  .content {
    order: 1;
  }
  
  .chaptersList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
  }
  
  .button {
    margin-bottom: 0;
    min-height: 40px;
    font-size: 14px;
    padding: 8px 12px;
  }
}

@media(max-width: 650px) {
  .chapters-and-content {
    padding: 10px;
    gap: 15px;
    margin-top: 60px; /* Espacio para móviles pequeños */
  }
  
  .chapter {
    padding: 15px;
  }
  
  .box-content {
    padding: 20px;
  }
  
  .chaptersList {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 6px;
  }
  
  .button {
    min-height: 36px;
    font-size: 13px;
    padding: 6px 10px;
  }
  
  .page-button {
    padding: 10px 20px;
    font-size: 14px;
    min-width: 80px;
    min-height: 40px;
  }
  
  #pages {
    gap: 15px;
    margin: 20px 0;
    padding: 15px 0;
  }
}

@media(max-width: 480px) {
  .chapters-and-content {
    padding: 8px;
    gap: 12px;
    margin-top: 50px; /* Espacio mínimo para móviles muy pequeños */
  }
  
  .chapter {
    padding: 12px;
  }
  
  .box-content {
    padding: 15px;
  }
  
  .chaptersList {
    grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
    gap: 5px;
  }
  
  .button {
    min-height: 32px;
    font-size: 12px;
    padding: 5px 8px;
  }
  
  .page-button {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 70px;
    min-height: 36px;
  }
  
  #pages {
    gap: 12px;
    margin: 15px 0;
    padding: 12px 0;
  }
  
  #current-page-total-pages {
    font-size: 14px;
    min-width: 60px;
  }
}

@media(max-width: 380px) {
  .chaptersList {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 4px;
  }
  
  .button {
    min-height: 28px;
    font-size: 11px;
    padding: 4px 6px;
  }
  
  .page-button {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 60px;
    min-height: 32px;
  }
}

.container {
  margin-top: 0; /* Sin margen superior */
  padding: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

@media(max-width: 1200px) {
  .container {
    margin-top: 0; /* Sin margen superior */
    padding: 15px;
  }
}

@media(max-width: 1120px) {
  .container {
    margin-top: 0; /* Sin margen superior */
  }
}

@media(max-width: 990px) {
  .container {
    margin-top: 0; /* Sin margen superior */
  }
}

@media(max-width:650px) {
  .container {
    margin-top: 0; /* Sin margen superior */
    padding: 15px;
  }
}

@media(max-width:480px) {
  .container {
    margin-top: 0; /* Sin margen superior */
    padding: 10px;
  }
}

.container-textorelato {
  margin-top: 10px;
  margin-bottom: 10px;
  font-family: ArialMT, Helvetica Neue, Arial, Liberation Sans, FreeSans, sans-serif;
}

.first-letter {
  font-size: 4rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 0.8;
  float: left;
  margin-right: 12px;
  margin-top: 8px;
  margin-bottom: 0;
  font-family: 'Alegreya Sans', sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

.first-letter::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--text-primary);
  border-radius: 4px;
  z-index: -1;
  opacity: 0.05;
}

.texto-relato {
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  text-align: left;
  align-items: center;
  padding-top: 15px;
  padding-left: 15px;
  padding-right: 15px;
  margin: 10px;
  color: var(--text-primary);
  transition: color var(--transition-normal);
  line-height: 1.7;
  font-weight: 400;
}

body.active .texto-relato {
  color: var(--text-primary);
  text-shadow: 0 0 2px rgba(248, 250, 252, 0.1);
}

.textoentre-relato {
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  text-align: left;
  align-items: center;
  padding-top: 18px;
  padding-left: 15px;
  padding-right: 15px;
  margin: 15px;
  color: var(--text-primary);
  transition: color var(--transition-normal);
  line-height: 1.7;
  font-weight: 400;
}

body.active .textoentre-relato {
  color: var(--text-primary);
  text-shadow: 0 0 2px rgba(248, 250, 252, 0.1);
}

body.active .first-letter {
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.active .first-letter::before {
  background: var(--text-primary);
  opacity: 0.08;
}

@media(max-width:480px) {
  .texto-relato {
    font-size: 1rem;
  }

  .textoentre-relato {
    font-size: 1rem;
  }

  .first-letter {
    font-size: 3.5rem;
    margin-right: 10px;
    margin-top: 6px;
  }
}

@media(max-width:320px) {
  .texto-relato {
    font-size: 0.95rem;
  }

  .textoentre-relato {
    font-size: 0.95rem;
  }

  .first-letter {
    font-size: 3rem;
    margin-right: 8px;
    margin-top: 4px;
  }
}

.drawing {
  max-width: 420px;
  width: 100%;
  height: auto;
  display: block;
  margin: 25px auto;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.9) 0%, 
    rgba(248, 250, 252, 0.8) 100%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.drawing img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  transition: transform 0.4s ease;
  display: block;
}

.drawing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.03) 0%, 
    rgba(147, 51, 234, 0.03) 50%,
    rgba(236, 72, 153, 0.03) 100%);
  border-radius: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawing:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

.drawing:hover img {
  transform: scale(1.05);
}

.drawing:hover::before {
  opacity: 1;
}

.drawing:active {
  transform: translateY(-4px) scale(1.01);
  transition: all 0.1s ease;
}

body.active .drawing {
  background: linear-gradient(135deg, 
    rgba(22, 33, 62, 0.95) 0%, 
    rgba(30, 41, 59, 0.9) 100%);
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

body.active .drawing::before {
  background: linear-gradient(135deg, 
    rgba(255, 215, 0, 0.05) 0%, 
    rgba(255, 165, 0, 0.05) 50%,
    rgba(255, 69, 0, 0.05) 100%);
}

body.active .drawing:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 24px 48px rgba(0, 0, 0, 0.5),
    0 8px 16px rgba(0, 0, 0, 0.3),
    0 0 0 2px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.4);
}

body.active .drawing:hover img {
  transform: scale(1.05);
}

/* Responsive design for all screen sizes */
@media(max-width: 1200px) {
  .drawing {
    max-width: 380px;
    padding: 18px;
    border-radius: 18px;
  }
}

@media(max-width: 990px) {
  .drawing {
    max-width: 340px;
    padding: 16px;
    border-radius: 16px;
  }
}

@media(max-width: 768px) {
  .drawing {
    max-width: 320px;
    padding: 15px;
    border-radius: 15px;
    margin: 20px auto;
  }
}

@media(max-width: 650px) {
  .drawing {
    max-width: 280px;
    padding: 14px;
    border-radius: 14px;
    margin: 18px auto;
  }
}

@media(max-width: 480px) {
  .drawing {
    max-width: 240px;
    margin: 15px auto;
    padding: 12px;
    border-radius: 12px;
  }
  
  .drawing:hover {
    transform: translateY(-6px) scale(1.02);
  }
}

@media(max-width: 380px) {
  .drawing {
    max-width: 200px;
    margin: 12px auto;
    padding: 10px;
    border-radius: 10px;
  }
  
  .drawing:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

/*************************
 🌟 END PAGE STYLING
**************************/
.end-page {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin: 20px auto;
  max-width: 800px;
  backdrop-filter: blur(10px);
}

body.active .end-page {
  background: linear-gradient(135deg, rgba(22, 33, 62, 0.95) 0%, rgba(15, 52, 96, 0.95) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(253, 194, 28, 0.2);
}

.end-content {
  animation: fadeInUp 1.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.end-title {
  font-size: 36px;
  font-weight: bold;
  color: #0e7ae7;
  margin-bottom: 30px;
  text-shadow: 0 2px 4px rgba(14, 122, 231, 0.2);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px rgba(14, 122, 231, 0.3);
  }
  to {
    text-shadow: 0 0 20px rgba(14, 122, 231, 0.6);
  }
}

body.active .end-title {
  color: #fdc21c;
  text-shadow: 0 0 10px rgba(253, 194, 28, 0.4);
}

body.active .end-title {
  animation: glowDark 2s ease-in-out infinite alternate;
}

@keyframes glowDark {
  from {
    text-shadow: 0 0 5px rgba(253, 194, 28, 0.4);
  }
  to {
    text-shadow: 0 0 20px rgba(253, 194, 28, 0.8);
  }
}

.end-image {
  margin: 30px auto;
  max-width: 300px !important;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.end-message {
  margin: 40px 0;
  padding: 0 20px;
}

.end-quote {
  font-size: 24px;
  font-style: italic;
  color: #374151;
  margin-bottom: 30px;
  line-height: 1.6;
  font-family: 'Alegreya Sans', serif;
  position: relative;
  padding: 20px;
  background: rgba(253, 194, 28, 0.05);
  border-radius: 12px;
  border-left: 4px solid #fdc21c;
}

body.active .end-quote {
  color: #f1f5f9;
  background: rgba(253, 194, 28, 0.1);
  border-left-color: #fdc21c;
}

.end-reflection {
  font-size: 18px;
  color: #4b5563;
  margin-bottom: 25px;
  line-height: 1.7;
  text-align: justify;
}

body.active .end-reflection {
  color: #e2e8f0;
}

.end-lesson {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.6;
  text-align: justify;
  padding: 20px;
  background: rgba(14, 122, 231, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(14, 122, 231, 0.1);
}

body.active .end-lesson {
  color: #cbd5e1;
  background: rgba(253, 194, 28, 0.1);
  border-color: rgba(253, 194, 28, 0.2);
}

.end-footer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid rgba(253, 194, 28, 0.3);
}

.end-thanks {
  font-size: 20px;
  font-weight: bold;
  color: #0e7ae7;
  margin-bottom: 10px;
}

body.active .end-thanks {
  color: #fdc21c;
}

.end-author {
  font-size: 16px;
  color: #6b7280;
  font-style: italic;
}

body.active .end-author {
  color: #94a3b8;
}

/* Responsive design for end page */
@media(max-width: 768px) {
  .end-page {
    padding: 30px 15px;
    margin: 15px auto;
  }
  
  .end-title {
    font-size: 28px;
    margin-bottom: 25px;
  }
  
  .end-quote {
    font-size: 20px;
    padding: 15px;
  }
  
  .end-reflection {
    font-size: 16px;
  }
  
  .end-lesson {
    font-size: 14px;
    padding: 15px;
  }
  
  .end-thanks {
    font-size: 18px;
  }
}

@media(max-width: 480px) {
  .end-page {
    padding: 20px 10px;
    margin: 10px auto;
  }
  
  .end-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  .end-quote {
    font-size: 18px;
    padding: 12px;
  }
  
  .end-reflection {
    font-size: 15px;
  }
  
  .end-lesson {
    font-size: 13px;
    padding: 12px;
  }
  
  .end-thanks {
    font-size: 16px;
  }
  
  .end-author {
    font-size: 14px;
  }
}

.translated-word {
  border-bottom: 2px dashed var(--border-secondary);
  cursor: pointer;
  position: relative;
  line-height: 38px;
  transition: all var(--transition-fast);
  padding: 2px 4px;
  border-radius: 4px;
  background: transparent;
  /* DESACTIVADO PARA DESARROLLO */
  /* user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none; */
  pointer-events: auto;
}

.translated-word:hover {
  border-bottom: 2px solid var(--primary-blue);
  background: rgba(37, 99, 235, 0.15);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  border-radius: 4px;
}

body.active .translated-word {
  border-bottom: 2px dashed var(--accent-gold-subtle);
}

body.active .translated-word:hover {
  border-bottom: 2px solid var(--accent-gold);
  background: rgba(253, 194, 28, 0.25);
  box-shadow: 0 0 12px rgba(253, 194, 28, 0.6);
  transform: translateY(-2px);
}

@media(max-width:480px) {
  .translated-word {
    line-height: 32px;
  }
}

@media(max-width:320px) {
  .translated-word {
    line-height: 27px;
  }
}

/*************************
 💬 MODALES Y TRADUCCIONES
**************************/
.modal {
  display: none;
  position: fixed;
  width: min(85vw, 320px);
  max-width: 320px;
  max-height: min(70vh, 400px);
  overflow-y: auto;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  /* Remover transform centrado - se posicionará dinámicamente */
}

/* Animación de entrada del modal */
@keyframes modalSlideIn {
  from { 
    opacity: 0; 
    transform: scale(0.9) translateY(-10px); 
  }
  to { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
  }
}

/* Animación de salida del modal */
@keyframes modalSlideOut {
  from { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
  }
  to { 
    opacity: 0; 
    transform: scale(0.95) translateY(10px); 
  }
}

/* Estados de animación */
.modal.opening {
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal.closing {
  animation: modalSlideOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Prevenir cambios de tamaño una vez posicionado */
.modal.positioned {
  /* Bloquear cambios de tamaño que puedan causar reposicionamiento */
  min-height: auto !important;
  max-height: min(85vh, 600px) !important;
  overflow-y: auto;
}

/* Asegurar que el contenido del modal no cause cambios de tamaño */
.modal-content {
  /* Prevenir que el contenido cause cambios de tamaño */
  min-height: 60px;
  max-height: calc(100% - 40px); /* Ajustar para padding del modal */
  overflow-y: auto;
}

/* Breakpoints responsive mejorados con unidades viewport */
@media(max-width:990px) {
  .modal {
    width: min(80vw, 300px);
    max-height: min(65vh, 350px);
  }
}

@media(max-width:768px) {
  .modal {
    width: min(85vw, 280px);
    max-height: min(60vh, 320px);
    border-radius: 10px;
  }
}

@media(max-width:480px) {
  .modal {
    width: min(90vw, 260px);
    max-height: min(55vh, 280px);
    border-radius: 8px;
  }
}

@media(max-width:360px) {
  .modal {
    width: 92vw;
    max-height: min(50vh, 250px);
    border-radius: 6px;
  }
}

/* Optimización para móviles en landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .modal {
    max-height: 90vh;
    width: min(80vw, 400px);
    top: 10px;
    transform: translateX(-50%);
  }
}

/* 🔧 OPTIMIZACIONES PARA DISPOSITIVOS DE GAMA BAJA */
/* Reducir animaciones para dispositivos con preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .modal.opening,
  .modal.closing {
    animation: none;
    transition: opacity 0.2s ease;
  }
  
  .modal-content {
    transition: none;
  }
  
  .close {
    transition: none;
  }
  
  .voice-selector {
    transition: none;
  }
  
  .modal-content .meaning:hover {
    transform: none;
  }
}

/* Optimizar para dispositivos con poca memoria */
@media (max-width: 480px) and (max-height: 800px) {
  .modal {
    /* Reducir efectos costosos en dispositivos pequeños */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  }
  
  .modal-content {
    /* Simplificar efectos visuales */
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.1);
  }
}

/* Optimizar para dispositivos con CPU limitada */
@media (prefers-reduced-motion: no-preference) and (max-width: 768px) {
  .modal.opening {
    animation: modalSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .modal.closing {
    animation: modalSlideOut 0.15s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
}

/* Desactivar efectos costosos en dispositivos muy pequeños */
@media (max-width: 320px) {
  .modal {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }
  
  .modal-content {
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(0, 0, 0, 0.15);
  }
}

/* Mejoras para pantallas muy pequeñas */
@media(max-width:320px) {
  .modal {
    width: 98vw;
    max-height: min(60vh, 350px);
    border-radius: 8px;
  }
}

/* Modal Content/Box */
.modal-content {
  background: rgba(255, 255, 255, 0.98);
  padding: 16px;
  margin: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  min-height: 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 🔧 MEJORAS DE ACCESIBILIDAD */
.modal:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 8px;
}

.modal-content:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

/* Mejorar contraste para lectores de pantalla */
.modal-content[aria-hidden="false"] {
  visibility: visible;
}

.modal-content[aria-hidden="true"] {
  visibility: hidden;
}

/* Indicadores de estado para screen readers */
.modal[aria-expanded="true"] {
  /* Modal abierto */
}

.modal[aria-expanded="false"] {
  /* Modal cerrado */
}

/* Mejorar contraste en modo oscuro */
body.active .modal-content {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(71, 85, 105, 0.4);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Asegurar contraste mínimo para texto */
.modal-content .meaning {
  color: inherit;
  font-weight: 500;
}

.modal-content .definition {
  color: inherit;
  opacity: 0.8;
}

.modal-content .example {
  color: inherit;
  opacity: 0.7;
}

/* Mejoras de feedback táctil para móviles */
@media (hover: none) and (pointer: coarse) {
  .modal-content {
    /* Mejor área de toque en móviles */
    padding: 28px 24px;
  }
  
  .modal-content:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

@media(max-width:768px) {
  .modal-content {
    padding: 14px;
  }
}

@media(max-width:480px) {
  .modal-content {
    padding: 12px;
  }
}

@media(max-width:360px) {
  .modal-content {
    padding: 10px;
  }
}

body.active .modal-content {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(71, 85, 105, 0.2);
  backdrop-filter: blur(12px);
}

/* Selector de voces optimizado para móviles */
.voice-selector {
  margin: 12px 0;
  padding: 12px;
  background: rgba(59, 130, 246, 0.03);
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.15);
  transition: all 0.2s ease;
  /* Fijar altura para evitar movimientos */
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 🔧 MICRO-INTERACCIONES MEJORADAS */
/* Micro-interacción para el selector de voces */
.voice-selector:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.25);
}

.voice-selector:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.08);
}

/* Micro-interacción para el select de voces */
.voice-selector select {
  transition: all 0.2s ease;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(255, 255, 255, 0.9);
}

.voice-selector select:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
  background: rgba(255, 255, 255, 1);
}

.voice-selector select:focus {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  outline: none;
  background: rgba(255, 255, 255, 1);
}

/* Micro-interacción para los meanings */
.modal-content .meaning {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.modal-content .meaning:hover {
  background-color: rgba(59, 130, 246, 0.04);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
  border-radius: 6px;
}

.modal-content .meaning:active {
  transform: translateX(1px);
  background-color: rgba(59, 130, 246, 0.06);
}

/* Micro-interacción para el botón de cerrar */
.close {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(59, 130, 246, 0.08);
  color: rgba(59, 130, 246, 0.7);
}

.close:hover {
  transform: scale(1.1) rotate(90deg);
  background: rgba(59, 130, 246, 0.15);
  color: rgba(59, 130, 246, 0.9);
}

.close:active {
  transform: scale(0.95) rotate(90deg);
  background: rgba(59, 130, 246, 0.2);
  color: rgba(59, 130, 246, 1);
}

/* Micro-interacción para el botón de pronunciación */
.little-icon {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: rgba(59, 130, 246, 0.1);
  color: rgba(59, 130, 246, 0.8);
}

.little-icon:hover {
  transform: scale(1.1);
  background-color: rgba(59, 130, 246, 0.2);
  border-radius: 100%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  color: rgba(59, 130, 246, 1);
}

.little-icon:active {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  background-color: rgba(59, 130, 246, 0.25);
}

/* Micro-interacción para el enlace del sitio web */
.modal-content .view-ingles-website {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: rgba(59, 130, 246, 0.8);
}

.modal-content .view-ingles-website::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s ease;
}

.modal-content .view-ingles-website:hover::before {
  left: 100%;
}

.modal-content .view-ingles-website:hover {
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
  color: rgba(59, 130, 246, 1);
  text-decoration: underline;
  border-color: rgba(59, 130, 246, 0.25);
}

/* Micro-interacción para el contenido del modal */
.modal-content {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content:hover {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.1);
}

/* Micro-interacción para las definiciones */
.modal-content .definition {
  transition: all 0.2s ease;
}

.modal-content .definition:hover {
  color: rgba(59, 130, 246, 0.9);
  font-weight: 500;
}

/* Micro-interacción para los ejemplos */
.modal-content .example {
  transition: all 0.2s ease;
}

.modal-content .example:hover {
  background: rgba(59, 130, 246, 0.03);
  border-left-color: rgba(59, 130, 246, 0.4);
  padding-left: 14px;
}

.voice-selector label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  cursor: pointer;
}

.voice-selector select {
  width: 100%;
  padding: 10px 32px 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.2s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  /* Altura fija para evitar cambios de tamaño */
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  display: flex;
  align-items: center;
  /* Forzar posicionamiento relativo para móvil */
  position: relative;
  z-index: 1;
}

.voice-selector select:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.voice-selector select:focus {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
  outline: none;
}

.voice-selector select option {
  padding: 12px;
  color: var(--text-primary);
  background: white;
}

/* Modo oscuro para selector de voces */
body.active .voice-selector {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body.active .voice-selector label {
  color: rgba(255, 255, 255, 0.8);
}

body.active .voice-selector select {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
}

body.active .voice-selector select:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 1px 3px rgba(255, 255, 255, 0.08);
}

body.active .voice-selector select:focus {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

body.active .voice-selector select option {
  background: rgba(15, 23, 42, 0.95);
  color: rgba(255, 255, 255, 0.9);
}

/* Optimización específica para móviles */
@media (max-width: 768px) {
  .voice-selector {
    margin: 10px 0;
    padding: 10px;
    /* Mantener altura consistente */
    min-height: 50px;
  }
  
  .voice-selector label {
    font-size: 11px;
    margin-bottom: 6px;
  }
  
  .voice-selector select {
    font-size: 12px; /* Previene zoom en iOS */
    padding: 8px 28px 8px 10px;
    /* Altura fija consistente */
    height: 32px;
    min-height: 32px;
    max-height: 32px;
  }
}

@media (max-width: 480px) {
  .voice-selector {
    margin: 8px 0;
    padding: 8px;
    /* Mantener altura consistente */
    min-height: 48px;
  }
  
  .voice-selector select {
    font-size: 12px;
    padding: 6px 24px 6px 8px;
    /* Altura fija consistente */
    height: 28px;
    min-height: 28px;
    max-height: 28px;
  }
}

/* Feedback táctil para móviles */
@media (hover: none) and (pointer: coarse) {
  .voice-selector select:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

/* Dropdown personalizado para móvil */
.custom-voice-selector {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  padding: 14px 40px 14px 16px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: white;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-select-trigger:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.custom-voice-selector.open .dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--primary-blue);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 5px;
}

.custom-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-option:last-child {
  border-bottom: none;
}

.custom-option:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.custom-option:active {
  background-color: rgba(59, 130, 246, 0.2);
}

.custom-option-group {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.group-label {
  padding: 8px 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  background-color: rgba(59, 130, 246, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Modo oscuro para dropdown personalizado */
body.active .custom-select-trigger {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: rgba(253, 194, 28, 0.3);
}

body.active .custom-select-trigger:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(253, 194, 28, 0.1);
}

body.active .custom-dropdown-options {
  background: var(--bg-secondary);
  border-color: var(--accent-gold);
}

body.active .custom-option:hover {
  background-color: rgba(253, 194, 28, 0.1);
}

body.active .custom-option:active {
  background-color: rgba(253, 194, 28, 0.2);
}

body.active .group-label {
  background-color: rgba(253, 194, 28, 0.05);
  color: var(--accent-gold);
}

/* Estados de loading y error mejorados */
.pronunciation-icon.loading {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  animation: pulse 1s ease-in-out infinite;
  cursor: wait;
}

.pronunciation-icon.loading i {
  animation: spin 1s linear infinite;
}

.pronunciation-icon.speaking {
  background: linear-gradient(135deg, #10b981, #059669);
  animation: wave 1.5s ease-in-out infinite;
  cursor: default;
}

.pronunciation-icon.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: shake 0.5s ease-in-out;
  cursor: not-allowed;
}

/* Animaciones para estados */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes wave {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1) rotate(2deg);
  }
  75% {
    transform: scale(1.05) rotate(-1deg);
  }
}

@keyframes shake {
  0%, 100% { 
    transform: translateX(0); 
  }
  25% { 
    transform: translateX(-3px); 
  }
  75% { 
    transform: translateX(3px); 
  }
}

@keyframes spin {
  from { 
    transform: rotate(0deg); 
  }
  to { 
    transform: rotate(360deg); 
  }
}

/* Estados de loading para el modal completo */
.modal-content.loading {
  position: relative;
  pointer-events: none;
}

.modal-content.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--primary-blue);
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1001;
}

/* Modo oscuro para estados */
body.active .modal-content.loading::after {
  background: rgba(15, 23, 42, 0.9);
}

body.active .modal-content.loading::before {
  border-color: var(--accent-gold);
  border-top-color: transparent;
}

/* Indicadores de estado en texto */
.modal-status {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
}

.modal-status.loading {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.modal-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.modal-status.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Modo oscuro para estados */
body.active .modal-status.loading {
  background: rgba(96, 165, 250, 0.15);
  color: var(--primary-blue-light);
  border-color: rgba(96, 165, 250, 0.3);
}

body.active .modal-status.error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error-light);
  border-color: rgba(248, 113, 113, 0.3);
}

body.active .modal-status.success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success-light);
  border-color: rgba(52, 211, 153, 0.3);
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold), var(--info));
  border-radius: 12px 12px 0 0;
}

.close {
  position: absolute;
  top: 8px;
  right: 8px;
  color: rgba(0, 0, 0, 0.8);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
  background: transparent;
  z-index: 10001;
  pointer-events: auto;
  /* DESACTIVADO PARA DESARROLLO */
  /* user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none; */
  /* Mejor área de toque */
  min-width: 44px;
  min-height: 44px;
}

/* Feedback táctil mejorado para móviles */
@media (hover: none) and (pointer: coarse) {
  .close {
    width: 44px;
    height: 44px;
    top: 12px;
    right: 12px;
  }
  
  .close:active {
    transform: scale(0.9);
    background: var(--gray-200);
    transition: all 0.1s ease;
  }
}

@media(max-width:768px) {
  .close {
    top: 6px;
    right: 6px;
    font-size: 16px;
    width: 24px;
    height: 24px;
  }
}

@media(max-width:480px) {
  .close {
    top: 4px;
    right: 4px;
    font-size: 15px;
    width: 22px;
    height: 22px;
  }
}

.close:hover,
.close:focus {
  color: rgba(0, 0, 0, 0.9);
  background: transparent;
  transform: scale(1.05);
}

body.active .close {
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
}

body.active .close:hover,
body.active .close:focus {
  color: rgba(255, 255, 255, 1);
  background: transparent;
}

.modal-content .meaning {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: default;
  position: relative;
}

.modal-content .meaning:hover {
  background-color: rgba(0, 0, 0, 0.02);
  transform: translateX(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

body.active .modal-content .meaning:hover {
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 1px 4px rgba(255, 255, 255, 0.08);
}

/* Feedback táctil mejorado para móviles */
@media (hover: none) and (pointer: coarse) {
  .modal-content .meaning {
    padding: 16px;
    margin-bottom: 20px;
    /* Mejor área de toque */
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  .modal-content .meaning:active {
    background-color: rgba(59, 130, 246, 0.1);
    transform: scale(0.98);
    transition: all 0.1s ease;
  }
  
  body.active .modal-content .meaning:active {
    background-color: rgba(253, 194, 28, 0.15);
  }
}

.modal-content .definition {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
}

body.active .modal-content .definition {
  color: var(--text-primary);
}

.modal-content .example {
  color: rgba(0, 0, 0, 0.6);
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 3px;
  border-left: 2px solid rgba(0, 0, 0, 0.1);
  margin-top: 4px;
}

/* Estilos específicos para .meaning.example - Más visible */
.modal-content .meaning.example {
  color: rgba(0, 0, 0, 0.8);
  font-weight: 500;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.modal-content .meaning.example:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: rgba(0, 0, 0, 0.9);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

@media(max-width:768px) {
  .modal-content .meaning {
    font-size: 15px;
  }
  
  .modal-content .definition {
    font-size: 14px;
  }
  
  .modal-content .example {
    font-size: 12px;
    padding: 5px 8px;
  }
}

@media(max-width:480px) {
  .modal-content .meaning {
    font-size: 14px;
  }
  
  .modal-content .definition {
    font-size: 13px;
  }
  
  .modal-content .example {
    font-size: 11px;
    padding: 4px 6px;
  }
}

/* Breakpoints adicionales para pantallas muy pequeñas */
@media(max-width:360px) {
  .modal-content .meaning {
    font-size: 13px;
  }
  
  .modal-content .definition {
    font-size: 12px;
  }
  
  .modal-content .example {
    font-size: 10px;
    padding: 3px 5px;
  }
}

@media(max-width:320px) {
  .modal-content .meaning {
    font-size: 12px;
  }
  
  .modal-content .definition {
    font-size: 11px;
  }
  
  .modal-content .example {
    font-size: 9px;
    padding: 2px 4px;
  }
}

body.active .modal-content .example {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.03);
  border-left-color: rgba(255, 255, 255, 0.15);
}

/* Modo oscuro para .meaning.example */
body.active .modal-content .meaning.example {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

body.active .modal-content .meaning.example:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.modal-content .view-ingles-website {
  margin-top: 16px;
  padding: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  text-align: center;
  transition: all 0.2s ease;
  display: block;
  text-decoration: none;
  color: #3b82f6;
  font-weight: 500;
  font-size: 13px;
}

@media(max-width:768px) {
  .modal-content .view-ingles-website {
    padding: 8px;
    margin-top: 12px;
  }
}

@media(max-width:480px) {
  .modal-content .view-ingles-website {
    padding: 6px;
    margin-top: 10px;
  }
}

.modal-content .view-ingles-website:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: #2563eb;
  text-decoration: underline;
}

body.active .modal-content .view-ingles-website {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: rgba(147, 197, 253, 0.9);
}

body.active .modal-content .view-ingles-website:hover {
  background: rgba(59, 130, 246, 0.15);
  color: rgba(147, 197, 253, 1);
  border-color: rgba(59, 130, 246, 0.4);
}

@media(max-width:768px) {
  .modal-content .view-ingles-website {
    font-size: 12px;
  }
}

@media(max-width:480px) {
  .modal-content .view-ingles-website {
    font-size: 11px;
  }
}

body.active .modal-content .view-ingles-website {
  color: #60a5fa;
}

body.active .modal-content .view-ingles-website:hover {
  color: #93c5fd;
}

@media(max-width:480px) {
  .modal-content {
    padding: 12px;
  }
  
  .modal-content .definition {
    font-size: 12px;
  }

  .modal-content .example {
    font-size: 10px;
  }
  
  .close {
    top: 4px;
    right: 4px;
    font-size: 14px;
  }
}

.little-icon {
  width: 35px;
  height: 35px;
}

.little-icon:hover {
  background-color: #fdc21c;
  border-radius: 100%;
  cursor: pointer;
}

@media(max-width:990px) {
  .little-icon {
    margin-left: 10px;
    width: 40px;
    height: 40px;
  }
}

body.active .little-icon:hover {
  background-color: rgb(165, 158, 194);
}

body.active .little-icon {
  filter: invert(98%) sepia(3%) saturate(3632%) hue-rotate(300deg) brightness(111%) contrast(90%);
}
/*<!-- Auth modal -->*/
#auth-modal {
  display: none;
  position: absolute;
  max-width: 250px;
  height: auto;
  overflow: auto;
  text-align: center;
  margin: auto;
}

@media(max-width:990px) {
  #auth-modal {
    margin-top: -78px;
  }
}

.current-session-saludo-carafeliz {
  font-size: 30px;
}

.current-session-saludo {
  text-align: center;
  letter-spacing: 1.5px;
  font-weight: bold;
  font-size: 20px;
}
body.active .current-session-saludo {
  color: black;
}
.current-session-user {
  color: rgba(14, 122, 231, 0.973);
  padding-bottom: 8px;
}

.current-session-salir {
  border-top: #787474 1px solid;
  padding-top: 5px;
  padding-bottom: 5px;
}

#logout-button {
  border: 1px black solid;
  border-radius: 4px;
  width: 65%;
  height: 30px;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 4px;
  padding-bottom: 4px;
  color: white;
  background-color: black;
  font-weight: bold;
  cursor: pointer;
}

/*************************
 🧠 SECCIÓN DE TIPS
**************************/
.tips h1 {
  font-size: 32px;
  letter-spacing: 2px;
  text-align: center;
  justify-content: center;
  align-content: center;
  color: #0e7ae7;
  margin-bottom: 30px;
  text-shadow: 0 2px 4px rgba(14, 122, 231, 0.1);
}

body.active .tips h1 {
  color: #fdc21c;
  text-shadow: 0 0 10px rgba(253, 194, 28, 0.3);
}

@media(max-width:480px) {
  .tips h1 {
    font-size: 24px;
    letter-spacing: 1.5px;
  }
}

.big-icon {
  display: flex;
  width: 150px;
  height: 150px;
  text-align: center;
  justify-content: center;
  align-content: center;
  margin: auto;
  margin-top: 10px;
  margin-bottom: 30px;
}

@media(max-width:480px) {
  .big-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 25px;
  }
}
.tips-content {
  margin-top: var(--spacing-xxxl);
  margin-bottom: var(--spacing-xxxl);
  width: 100%;
  padding: var(--spacing-xxxl) var(--spacing-md);
  height: max-content;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.08) 0%, 
    rgba(245, 158, 11, 0.08) 50%, 
    rgba(59, 130, 246, 0.08) 100%);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  animation: slideInUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tips-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.03"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.03"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.03"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.03"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.03"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}
.tip-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-left: 6px solid var(--primary-blue);
  border-radius: 16px;
  padding: var(--spacing-lg);
  margin: var(--spacing-md) 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid rgba(37, 99, 235, 0.1);
  animation: fadeInScale 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  position: relative;
  z-index: 1;
}

.tip-card:nth-child(1) {
  animation-delay: 0.1s;
}

.tip-card:nth-child(2) {
  animation-delay: 0.2s;
}

.tip-card:nth-child(3) {
  animation-delay: 0.3s;
}

.tip-card:nth-child(4) {
  animation-delay: 0.4s;
}

.tip-card:nth-child(5) {
  animation-delay: 0.5s;
}

.tip-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.2);
  border-left-color: var(--accent-gold);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(248, 250, 252, 0.95) 100%);
}

body.active .tip-card {
  background: linear-gradient(135deg, rgba(22, 33, 62, 0.9) 0%, rgba(15, 52, 96, 0.9) 100%);
  border-left: 6px solid var(--accent-gold);
  color: #f1f5f9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(253, 194, 28, 0.2);
  backdrop-filter: blur(10px);
}

body.active .tip-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 35px rgba(253, 194, 28, 0.3);
  border-left-color: var(--accent-gold-light);
  background: linear-gradient(135deg, 
    rgba(22, 33, 62, 0.95) 0%, 
    rgba(15, 52, 96, 0.95) 100%);
}

/* Dark mode styles for tips page */
body.active .tips-content {
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.15) 0%, 
    rgba(245, 158, 11, 0.15) 50%, 
    rgba(59, 130, 246, 0.15) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

@media(max-width: 480px) {
  .tip-card {
    padding: var(--spacing-sm);
    margin-left: var(--spacing-xs);
    margin-right: var(--spacing-xs);
  }
}

.texto-tips {
  font-size: 18px;
  letter-spacing: 1.3px;
  font-family: ArialMT, Helvetica Neue, Arial, Liberation Sans, FreeSans, sans-serif;
  text-align: justify;
  align-items: center;
  padding: 20px;
  margin: 10px;
  line-height: 1.6;
  color: #374151;
  transition: all 0.3s ease;
}

.texto-tips:hover,
.sobre-mi-text:hover {
  background-color: rgba(253, 194, 28, 0.05);
  border-radius: 8px;
  transform: translateX(5px);
}

body.active .texto-tips {
  color: #f1f5f9;
}

body.active .texto-tips:hover {
  background-color: rgba(253, 194, 28, 0.1);
  box-shadow: 0 0 10px rgba(253, 194, 28, 0.2);
}

.texto-tips-title {
  font-size: 22px;
  letter-spacing: 1.5px;
  text-align: justify;
  align-items: center;
  font-weight: bold;
}

@media(max-width:480px) {
  .texto-tips {
    font-size: 17px;
  }

  .tittleTips {
    text-align: left;
  }
}

.last-texto-tips {
  display: flex;
  font-size: 20px;
  color: rgb(64, 60, 62);
  letter-spacing: 1.2px;
  text-align: center;
  align-items: center;
  justify-content: center;
  margin: 20px;
}

body.active .last-texto-tips {
  color: rgb(229, 226, 226);
}

.commingsoon {
  font-size: 25px;
  color: rgb(64, 60, 62);
  letter-spacing: 1.2px;
  text-align: center;
  align-items: center;
  justify-content: center;
  margin: 20px;
}

@media(max-width:480px) {
  .commingsoon {
    font-size: 20px;
  }
}

@media(max-width:320px) {
  .commingsoon {
    font-size: 15px;
  }
}

body.active .commingsoon {
  color: rgb(229, 226, 226);
}

body.active .last-texto-tips {
  color: #fff;
}

@media(max-width:380px) {
  .last-texto-tips {
    font-size: 17px;
  }
}
/*************************
 SECCIÓN SOBRE MÍ
**************************/
.sobre-content {
  margin-top: 100px;
  margin-bottom: 100px;
  width: 100%;
  padding: 20px;
  height: max-content;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.sobre {
  font-size: 18px;
  letter-spacing: 1.3px;
  font-family: ArialMT, Helvetica Neue, Arial, Liberation Sans, FreeSans, sans-serif;
  width: 100%;
  height: max-content;
  margin-top: 15px;
  margin-bottom: 30px;
  padding: 30px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 18px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(14, 122, 231, 0.1);
  transition: all 0.3s ease;
}

.sobre:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

body.active .sobre-content .sobre {
  background: linear-gradient(135deg, rgba(22, 33, 62, 0.9) 0%, rgba(15, 52, 96, 0.9) 100%);
  color: #f1f5f9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(253, 194, 28, 0.2);
  backdrop-filter: blur(10px);
}

body.active .sobre:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(253, 194, 28, 0.3);
}

.sobre-mi {
  padding-top: 10px;
  margin-left: 30px;
  margin-right: 30px;
}

@media(max-width:480px) {
  .sobre-mi {
    margin-left: 20px;
    margin-right: 20px;
    ;
  }
}

.sobre-mi h1 {
  color: #0e7ae7;
  font-size: 36px;
  letter-spacing: 2px;
  text-align: center;
  margin: auto;
  padding-top: 30px;
  padding-bottom: 30px;
  text-shadow: 0 2px 4px rgba(14, 122, 231, 0.1);
}

body.active .sobre-mi h1 {
  color: #fdc21c;
  text-shadow: 0 0 10px rgba(253, 194, 28, 0.3);
}

@media(max-width:480px) {
  .sobre-mi h1 {
    font-size: 28px;
  }
}

.sobre-mi-foto {
  display: flex;
  width: 300px;
  height: 300px;
  border-radius: 100%;
  text-align: center;
  justify-content: center;
  align-content: center;
  margin: auto;
  margin-top: 10px;
  margin-bottom: 40px;
  border: 3px solid #0e7ae7;
  box-shadow: 0 8px 25px rgba(14, 122, 231, 0.2);
  transition: all 0.3s ease;
}

.sobre-mi-foto:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(14, 122, 231, 0.3);
}

body.active .sobre-mi-foto {
  border: 3px solid #fdc21c;
  box-shadow: 0 8px 25px rgba(253, 194, 28, 0.3);
}

body.active .sobre-mi-foto:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(253, 194, 28, 0.4);
}

@media(max-width:480px) {
  .sobre-mi-foto {
    width: 220px;
    height: 220px;
  }
}

.sobre-foto-y-descripcion {
  text-align: center;
  justify-content: center;
  align-content: center;
  margin: auto;
  padding-bottom: 30px;
}

.fotostrabajo-descripcion {
  padding-top: 5px;
  color: #787676;
  font-size: 17px;
  font-style: italic;
}

.sobre-mi-fotostrabajo {
  display: flex;
  width: 400px;
  height: 400px;
  padding-top: 20px;
  text-align: center;
  justify-content: center;
  align-content: center;
  margin: auto;
}

@media(max-width:480px) {
  .sobre-mi-fotostrabajo {
    width: 250px;
    height: 250px;
  }
}

.sobre-mi-text {
  font-size: 22px;
  padding-bottom: 20px;
  text-align: justify;
  padding-left: 150px;
  padding-right: 150px;
  line-height: 1.6;
  color: #374151;
  transition: all 0.3s ease;
}

.sobre-mi-text:hover {
  background-color: rgba(253, 194, 28, 0.05);
  border-radius: 8px;
  transform: translateX(5px);
}

body.active .sobre-mi-text {
  color: #f1f5f9;
}

body.active .sobre-mi-text a {
  color: #fdc21c;
  text-shadow: 0 0 5px rgba(253, 194, 28, 0.3);
}

body.active .sobre-mi-text a:hover {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(253, 194, 28, 0.5);
}

body.active .sobre-mi-text:hover {
  background-color: rgba(253, 194, 28, 0.1);
  box-shadow: 0 0 10px rgba(253, 194, 28, 0.2);
}

@media(max-width:990px) {
  .sobre-mi-text {
    padding-left: 50px;
    padding-right: 50px;
  }
}

@media(max-width:480px) {
  .sobre-mi-text {
    font-size: 19px;
    padding-left: 10px;
    padding-right: 10px;
  }
}

/*************************
AUDIO PLAYER
**************************/
.audio-player {
  max-width: 400px;
  margin: 2rem auto;
  font-family: Arial, sans-serif;
}
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.progress-bar {
  width: 100%;
  margin-bottom: 5px;
}
.time-info {
  text-align: right;
  font-size: 0.9em;
  color: #333;
}
/*************************
 📍 FOOTER
**************************/
.footer {
  width: 100%;
  min-height: 120px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--gray-100) 100%);
  text-align: center;
  padding: 20px 0;
  text-decoration: none;
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

body.active .footer {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--accent-gold-subtle);
  box-shadow: var(--shadow-xl);
}

footer p {
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1.5px;
  margin: 0 43px;
  padding: 15px 0 10px 0;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-secondary);
  text-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

footer p.copyright {
  font-size: 12px;
  font-weight: normal;
  letter-spacing: 0.5px;
  margin: 0 43px;
  padding: 8px 0 5px 0;
  border-bottom: none;
  color: var(--text-muted);
  text-shadow: none;
}

body.active footer p {
  color: var(--accent-gold);
  border-bottom: 1px solid var(--accent-gold-subtle);
  text-shadow: 0 0 8px var(--accent-gold-subtle);
}

body.active footer p.copyright {
  color: var(--text-light);
  border-bottom: none;
  text-shadow: none;
}

footer .social-media {
  padding-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

footer .social-media svg {
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

footer a {
  text-decoration: none;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
  display: inline-block;
}

footer a:hover {
  transform: translateY(-2px);
  filter: drop-shadow(var(--shadow-md));
}

body.active footer a {
  color: var(--accent-gold);
  filter: drop-shadow(0 0 5px var(--accent-gold-subtle));
}

body.active footer a:hover {
  color: var(--accent-gold-light);
  transform: translateY(-2px) scale(1.05);
  filter: drop-shadow(0 0 10px var(--accent-gold-subtle));
}

body.active footer .social-media svg {
  filter: drop-shadow(0 0 5px var(--accent-gold-subtle));
}

/* Footer responsive design */
@media(max-width: 768px) {
  .footer {
    padding: 15px 0;
  }
  
  footer p {
    font-size: 13px;
    margin: 0 20px;
    padding: 12px 0 8px 0;
  }
  
  footer p.copyright {
    font-size: 11px;
    margin: 0 20px;
    padding: 6px 0 4px 0;
  }
  
  footer .social-media {
    gap: 12px;
    padding-top: 12px;
  }
}

@media(max-width: 480px) {
  .footer {
    padding: 12px 0;
  }
  
  footer p {
    font-size: 12px;
    margin: 0 15px;
    padding: 10px 0 6px 0;
    letter-spacing: 1px;
  }
  
  footer p.copyright {
    font-size: 10px;
    margin: 0 15px;
    padding: 5px 0 3px 0;
  }
  
  footer .social-media {
    gap: 10px;
    padding-top: 10px;
  }
  
  footer .social-media svg {
    width: 28px;
    height: 28px;
  }
}

@media(max-width: 380px) {
  footer p {
    font-size: 11px;
    margin: 0 10px;
    padding: 8px 0 5px 0;
  }
  
  footer p.copyright {
    font-size: 9px;
    margin: 0 10px;
    padding: 4px 0 2px 0;
  }
  
  footer .social-media {
    gap: 8px;
    padding-top: 8px;
  }
  
  footer .social-media svg {
    width: 24px;
    height: 24px;
  }
}

/*  📄 ESTILOS PARA BOTONES DE PÁGINAS EN EL CONTENIDO
******************************************************/

/* Estilos para botones de páginas en el contenido de las páginas */
#pages .page-button {
  margin: 2px;
  min-width: 40px;
  font-size: 11px;
  padding: 6px 8px;
}

/* Estilos para flechas de navegación */
.nav-arrow {
  padding: 12px 16px;
  margin: 0 8px;
  border-radius: 12px;
  border: 2px solid var(--primary-blue);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--primary-blue);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-arrow::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.nav-arrow:hover:not(.disabled)::before {
  left: 100%;
}

.nav-arrow:hover:not(.disabled) {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #2563eb 100%);
  color: var(--bg-primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
  border-color: #2563eb;
}

.nav-arrow:active:not(.disabled) {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.nav-arrow:focus {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
}

.nav-arrow.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--gray-400);
  color: var(--gray-400);
  background: var(--bg-primary);
  transform: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-arrow.disabled:hover {
  background: var(--bg-primary);
  color: var(--gray-400);
  transform: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-arrow.disabled::before {
  display: none;
}

/* Estilos para los iconos de flecha */
.arrow-icon {
  width: 20px;
  height: 20px;
  position: relative;
  transition: transform 0.3s ease;
}

.arrow-left::before,
.arrow-left::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  top: 50%;
  left: 50%;
  transform-origin: center;
}

.arrow-left::before {
  transform: translate(-50%, -50%) rotate(-45deg) translateY(-4px);
}

.arrow-left::after {
  transform: translate(-50%, -50%) rotate(45deg) translateY(4px);
}

.arrow-right::before,
.arrow-right::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  top: 50%;
  left: 50%;
  transform-origin: center;
}

.arrow-right::before {
  transform: translate(-50%, -50%) rotate(45deg) translateY(-4px);
}

.arrow-right::after {
  transform: translate(-50%, -50%) rotate(-45deg) translateY(4px);
}

.nav-arrow:hover:not(.disabled) .arrow-icon {
  transform: scale(1.1);
}

.nav-arrow:hover:not(.disabled) .arrow-left {
  transform: translateX(-2px);
}

.nav-arrow:hover:not(.disabled) .arrow-right {
  transform: translateX(2px);
}

/* Estilos para flechas en modo activo */
body.active .nav-arrow {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(255, 215, 0, 0.1) 100%);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

body.active .nav-arrow:hover:not(.disabled) {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #ffd700 100%);
  color: var(--gray-900);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
  border-color: #ffd700;
}

body.active .nav-arrow.disabled {
  border-color: var(--gray-500);
  color: var(--gray-500);
  background: var(--bg-secondary);
}

#pages .page-button.current-page {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--gray-900);
  font-weight: bold;
  box-shadow: 0 0 0 2px var(--accent-gold-subtle);
}

#pages .page-button.visited-page {
  background-color: var(--success-subtle);
  border-color: var(--success);
  color: var(--success);
}

body.active #pages .page-button.current-page {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--gray-900);
  font-weight: bold;
  box-shadow: 0 0 0 2px var(--accent-gold-subtle);
}

body.active #pages .page-button.visited-page {
  background-color: var(--success-subtle);
  border-color: var(--success);
  color: var(--success-light);
}

/* Responsive design para botones de páginas en el contenido */
@media(max-width: 768px) {
  #pages .page-button {
    min-width: 35px;
    font-size: 10px;
    padding: 5px 7px;
  }
  
  .nav-arrow {
    padding: 10px 14px;
    min-width: 42px;
    min-height: 42px;
  }
  
  .arrow-icon {
    width: 18px;
    height: 18px;
  }
  
  .arrow-left::before,
  .arrow-left::after,
  .arrow-right::before,
  .arrow-right::after {
    width: 10px;
    height: 2px;
  }
}

@media(max-width: 480px) {
  #pages .page-button {
    min-width: 30px;
    font-size: 9px;
    padding: 4px 6px;
  }
  
  .nav-arrow {
    padding: 8px 12px;
    min-width: 38px;
    min-height: 38px;
  }
  
  .arrow-icon {
    width: 16px;
    height: 16px;
  }
  
  .arrow-left::before,
  .arrow-left::after,
  .arrow-right::before,
  .arrow-right::after {
    width: 9px;
    height: 2px;
  }
}

@media(max-width: 380px) {
  #pages .page-button {
    min-width: 28px;
    font-size: 8px;
    padding: 3px 5px;
  }
  
  .nav-arrow {
    padding: 6px 10px;
    min-width: 34px;
    min-height: 34px;
  }
  
  .arrow-icon {
    width: 14px;
    height: 14px;
  }
  
  .arrow-left::before,
  .arrow-left::after,
  .arrow-right::before,
  .arrow-right::after {
    width: 8px;
    height: 1px;
  }
}

/*  📚 ESTILOS PARA PÁGINA DE SELECCIÓN DE LIBROS
******************************************************/

.books-selection-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-xxxl) var(--spacing-md);
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.10) 0%, 
    rgba(245, 158, 11, 0.10) 50%, 
    rgba(59, 130, 246, 0.10) 100%);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: all var(--transition-slow);
}

.books-selection-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.05"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.05"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.books-header {
  text-align: center;
  margin-bottom: var(--spacing-xxxl);
  position: relative;
  z-index: 1;
  animation: slideInUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.books-title {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 20px;
  font-family: 'Alegreya Sans', sans-serif;
  transition: color var(--transition-normal);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
  line-height: 1.1;
  /* Fix for mobile text rendering over gradients */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  backface-visibility: hidden;
  transform: translateZ(0);
  position: relative;
  z-index: 1;
}

.books-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  transition: color var(--transition-normal);
  /* Fix for mobile text rendering over gradients */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  backface-visibility: hidden;
  transform: translateZ(0);
  position: relative;
  z-index: 1;
}

body.active .books-title {
  color: var(--accent-gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  filter: brightness(1.1);
}

body.active .books-subtitle {
  color: var(--text-secondary);
  filter: brightness(1.2);
}

/* Dark mode styles for books selection container */
body.active .books-selection-container {
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.20) 0%, 
    rgba(245, 158, 11, 0.20) 50%, 
    rgba(59, 130, 246, 0.20) 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xxxl);
  position: relative;
  z-index: 1;
  animation: slideInUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
}

.book-card {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  border: 2px solid var(--border-primary);
  animation: fadeInScale 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  /* Ensure consistent height for both cards */
  height: 620px !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden; /* Keep card size consistent */
}

/* Ensure book cards inside links have same height */
.book-card-link .book-card {
  height: 620px !important;
}

.book-card:nth-child(1) {
  animation-delay: 0.1s;
}

.book-card:nth-child(2) {
  animation-delay: 0.2s;
}

.book-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, 
    var(--bg-primary) 0%, 
    rgba(255, 255, 255, 0.8) 100%);
}

.book-card:hover .book-title {
  transform: translateY(-2px);
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  color: var(--primary-blue);
}

.book-card:hover .book-image {
  transform: scale(1.05);
  filter: brightness(1.1);
}

body.active .book-card {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

body.active .book-card:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 20px 40px rgba(253, 194, 28, 0.3);
  background: linear-gradient(135deg, 
    var(--bg-secondary) 0%, 
    rgba(253, 194, 28, 0.1) 100%);
}

body.active .book-card:hover .book-title {
  color: var(--accent-gold);
  text-shadow: 0 4px 8px rgba(253, 194, 28, 0.4);
}

.book-cover {
  text-align: center;
  margin-bottom: 25px;
}

.book-image {
  width: 120px;
  height: auto;
  max-height: 180px;
  border-radius: 15px;
  object-fit: contain;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.book-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  min-height: 0; /* Allow flex items to shrink */
}

.book-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 12px;
  font-family: 'Alegreya Sans', sans-serif;
  transition: all var(--transition-normal);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.book-author {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-style: italic;
  font-weight: 400;
  opacity: 0.8;
  transition: color var(--transition-normal);
  min-height: 1.5em; /* Ensure consistent height across all book cards */
  line-height: 1.5; /* Ensure consistent line height */
  display: flex;
  justify-content: center;
  text-align: center;
  align-items: center; /* Center the text vertically */
}

.book-description {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 20px;
  font-weight: 400;
  opacity: 0.9;
  transition: color var(--transition-normal);
  /* Control height to ensure consistent card sizes */
  max-height: 100px;
  overflow-y: auto;
  flex-grow: 1;
  flex-shrink: 1; /* Allow description to shrink if needed */
  display: block !important;
  visibility: visible !important;
  min-height: 60px !important;
}

/* Forzar visibilidad en escritorio */
@media (min-width: 769px) {
  .book-description {
    display: block !important;
    visibility: visible !important;
    opacity: 0.9 !important;
    max-height: 120px !important;
    min-height: 80px !important;
    color: #6b7280 !important;
  }
  
  /* Forzar visibilidad de book-stats en desktop */
  .book-stats {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999 !important;
  }
  
  .chapters-count,
  .difficulty {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999 !important;
  }
  
  /* Forzar con máxima especificidad para desktop */
  .books-grid .book-card .book-info .book-stats {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999 !important;
  }
  
  .books-grid .book-card .book-info .book-stats .chapters-count,
  .books-grid .book-card .book-info .book-stats .difficulty {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999 !important;
  }
}

body.active .book-title {
  color: var(--accent-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.active .book-author {
  color: var(--text-secondary);
}

body.active .book-description {
  color: var(--text-secondary);
}

/* Coming soon card specific styles */
.coming-soon-card {
  height: 620px !important; /* Keep same height as regular cards */
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow: hidden !important; /* Keep card size consistent */
}

/* Ensure coming-soon card book-info has proper flex structure */
.coming-soon-card .book-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  flex-grow: 1 !important;
  min-height: 0 !important;
  padding-bottom: 10px !important; /* Add some padding at bottom */
}

.book-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.theme-tag {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.theme-tag.adventure {
  background: var(--success-subtle);
  color: var(--success);
}

.theme-tag.classic {
  background: var(--warning-subtle);
  color: var(--warning);
}

.theme-tag.philosophy {
  background: var(--info-subtle);
  color: var(--info);
}

.theme-tag.romance {
  background: var(--danger-subtle);
  color: var(--danger);
}

.theme-tag.society {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
}

.book-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: auto; /* Push to bottom of flex container */
  padding-top: 10px;
  flex-shrink: 0; /* Prevent stats from shrinking */
}

.chapters-count,
.difficulty {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.difficulty {
  background: var(--success-subtle);
  color: var(--success);
}

/* Niveles de inglés específicos */
.difficulty:contains("A1"),
.difficulty:contains("A2") {
  background: var(--success-subtle);
  color: var(--success);
}

.difficulty:contains("B1"),
.difficulty:contains("B2") {
  background: var(--warning-subtle);
  color: var(--warning);
}

.difficulty:contains("C1"),
.difficulty:contains("C2") {
  background: var(--danger-subtle);
  color: var(--danger);
}

body.active .chapters-count {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue-light);
}

body.active .difficulty {
  background: var(--success-subtle);
  color: var(--success-light);
}

.books-features {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-primary);
  transition: all var(--transition-normal);
}

.books-features h3 {
  font-size: 1.8rem;
  color: var(--primary-blue);
  text-align: center;
  margin-bottom: 30px;
  font-family: 'Alegreya Sans', sans-serif;
  transition: color var(--transition-normal);
}

body.active .books-features {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

body.active .books-features h3 {
  color: var(--accent-gold);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature {
  text-align: center;
  padding: 20px;
}

.feature i {
  font-size: 2.5rem;
  color: var(--accent-gold);
  margin-bottom: 15px;
  display: block;
  transition: color var(--transition-normal);
}

.feature h4 {
  font-size: 1.2rem;
  color: var(--primary-blue);
  margin-bottom: 10px;
  font-weight: 600;
  transition: color var(--transition-normal);
}

.feature p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  transition: color var(--transition-normal);
}

body.active .feature h4 {
  color: var(--accent-gold);
}

body.active .feature p {
  color: var(--text-secondary);
}

/* Responsive design para la página de libros */
@media(max-width: 768px) {
  .books-selection-container {
    padding: 40px 15px;
    position: relative;
    z-index: 10;
    margin: 20px;
    border-radius: 20px;
    overflow: hidden;
    box-sizing: border-box;
    width: calc(100% - 40px);
    max-width: none;
  }
  
  .main {
    position: relative;
    z-index: 5;
    background: transparent;
  }
  
  .books-title {
    font-size: 2.4rem;
    /* Enhanced mobile text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
  }
  
  .books-subtitle {
    font-size: 1.1rem;
    /* Enhanced mobile text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    backface-visibility: hidden;
    transform: translateZ(0);
  }
  
  .books-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    margin-bottom: 2rem !important;
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    overflow: visible !important;
  }
  
  .book-card {
    padding: 25px !important;
    /* Ensure consistent height on mobile */
    height: 560px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure coming-soon card has same height on mobile */
  .coming-soon-card {
    height: 560px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* Ensure book cards inside links have same height on mobile */
  .book-card-link {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
  }
  
  .book-card-link .book-card {
    height: 560px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
  
  .book-image {
    width: 120px;
    height: auto;
    max-height: 160px;
    object-fit: cover;
    object-position: center top;
  }
  
  .book-title {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  
  .book-author {
    min-height: 1.8em; /* Slightly larger on mobile for better alignment */
    margin-bottom: 15px; /* Reduced margin on mobile */
  }
  
  .books-features {
    padding: 30px 20px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
}

@media(max-width: 480px) {
  .books-selection-container {
    padding: 30px 10px;
    position: relative;
    z-index: 15;
    margin: 15px;
    border-radius: 16px;
    overflow: hidden;
    box-sizing: border-box;
    width: calc(100% - 30px);
    max-width: none;
  }
  
  .main {
    position: relative;
    z-index: 10;
    background: transparent;
  }
  
  .books-title {
    font-size: 2rem;
  }
  
  .books-subtitle {
    font-size: 1rem;
  }
  
  .book-card {
    padding: 20px !important;
    /* Ensure consistent height on smaller mobile devices */
    height: 520px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure coming-soon card has same height on smaller mobile */
  .coming-soon-card {
    height: 520px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* Ensure book cards inside links have same height on smaller mobile */
  .book-card-link {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
  }
  
  .book-card-link .book-card {
    height: 520px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
  
  .book-image {
    width: 100px;
    height: auto;
    max-height: 140px;
    object-fit: cover;
    object-position: center top;
  }
  
  .book-title {
    font-size: 1.6rem;
    line-height: 1.2;
  }
  
  .book-author {
    font-size: 1rem;
    min-height: 1.8em; /* Consistent height on small mobile */
    margin-bottom: 12px; /* Adjusted margin for small screens */
  }
  
  .book-description {
    font-size: 0.9rem;
  }
  
  .books-features {
    padding: 25px 15px;
  }
  
  .books-features h3 {
    font-size: 1.5rem;
  }
  
  .feature i {
    font-size: 2rem;
  }
  
  .feature h4 {
    font-size: 1.1rem;
  }
  
  .feature p {
    font-size: 0.9rem;
  }
}

/*  📚 ESTILOS PARA MENÚ DESPLEGABLE DE LIBROS
******************************************************/

.dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 23px;
  font-weight: 500;
  color: black;
  letter-spacing: 0.8px;
  text-decoration: none;
  padding: 20px;
  white-space: nowrap;
}

.dropdown-toggle:hover {
  color: var(--accent-gold);
}

.dropdown-toggle i {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
  transform: rotate(180deg);
}

/* Navigation dropdown menu - exclude user menu */
.dropdown:not(.user-menu) .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  padding: 8px 0;
  margin: 5px 0 0 0;
  min-width: 320px;
  width: max-content;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
  z-index: 1000;
  border: 1px solid var(--border-primary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropdown:not(.user-menu):hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* En móvil, deshabilitar el hover */
@media(max-width: 768px) {
  .dropdown:not(.user-menu):hover .dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
  }
  
  /* Asegurar que el menú se muestre cuando está activo */
  .dropdown:not(.user-menu).active .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: flex !important;
  }
}

.dropdown:not(.user-menu) .dropdown-menu li {
  list-style: none;
  margin: 0;
  width: 100%;
  display: flex;
}

.dropdown:not(.user-menu) .dropdown-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-normal);
  border-radius: 0;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Alegreya Sans', sans-serif;
  letter-spacing: 0.5px;
  width: 100%;
  background: transparent;
  white-space: nowrap;
  box-sizing: border-box;
  overflow: hidden;
}

.dropdown:not(.user-menu) .dropdown-menu a:hover {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  padding-left: 25px;
  transform: translateX(5px);
}

/* Estilos para modo oscuro */
body.active .dropdown:not(.user-menu) .dropdown-menu {
  background: var(--bg-secondary);
  border-color: var(--accent-gold-subtle);
  backdrop-filter: blur(15px);
  box-shadow: var(--shadow-xl);
}

body.active .dropdown:not(.user-menu) .dropdown-menu a {
  color: var(--text-primary);
}

body.active .dropdown:not(.user-menu) .dropdown-menu a:hover {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  transform: translateX(5px);
  box-shadow: 0 0 10px var(--accent-gold-subtle);
}

/* Responsive design para el menú desplegable */
@media(max-width: 768px) {
  .dropdown-toggle {
    font-size: 0.9rem;
  }
  
  .dropdown:not(.user-menu) .dropdown-menu {
    min-width: 120px;
    max-width: 90vw;
    left: -20px;
    /* En móvil, el menú solo se muestra con click, no con hover */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    position: absolute;
    z-index: 1000;
    padding: 4px 0;
  }
  
  .dropdown:not(.user-menu) .dropdown-menu a {
    padding: 6px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Clase para mostrar el menú en móvil cuando se hace click */
  .dropdown:not(.user-menu).active .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: flex !important;
  }
}

@media(max-width: 480px) {
  .dropdown-toggle {
    font-size: 0.85rem;
  }
  
  .dropdown:not(.user-menu) .dropdown-menu {
    min-width: 100px;
    max-width: 85vw;
    left: -10px;
    /* En móvil, el menú solo se muestra con click, no con hover */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    position: absolute;
    z-index: 1000;
    padding: 3px 0;
  }
  
  .dropdown:not(.user-menu) .dropdown-menu a {
    padding: 5px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Clase para mostrar el menú en móvil cuando se hace click */
  .dropdown:not(.user-menu).active .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: flex !important;
  }
}

/* Media query adicional para dispositivos muy pequeños */
@media(max-width: 360px) {
  .dropdown-toggle {
    font-size: 0.8rem;
  }
  
  .dropdown:not(.user-menu) .dropdown-menu {
    min-width: 90px;
    max-width: 80vw;
    left: -5px;
    padding: 2px 0;
  }
  
  .dropdown:not(.user-menu) .dropdown-menu a {
    padding: 4px 6px;
    font-size: 0.7rem;
  }
}

/* ===== HERO SECTION ===== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--spacing-xxl) var(--spacing-sm);
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.12) 0%, 
    rgba(245, 158, 11, 0.12) 50%, 
    rgba(59, 130, 246, 0.12) 100%);
  position: relative;
  overflow: hidden;
  padding-top: 120px; /* Add padding to account for fixed header */
  transition: background var(--transition-slow);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xxxl);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text {
  animation: slideInLeft 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  transition: color var(--transition-normal);
}

.hero-highlight {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.hero-description {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 500px;
  transition: color var(--transition-normal);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.cta-primary, .cta-secondary {
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.cta-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
  color: white;
  box-shadow: 0 8px 25px var(--primary-blue-subtle);
}

.cta-primary:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue));
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.4);
}

.cta-secondary {
  background: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.cta-secondary:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.3);
  border-color: var(--primary-blue-dark);
}

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-blue);
  line-height: 1;
  transition: color var(--transition-normal);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--transition-normal);
}

.hero-visual {
  animation: slideInRight 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
  display: flex;
  justify-content: center;
  align-items: center;
}

.demo-preview {
  position: relative;
  max-width: 400px;
  width: 100%;
}

.book-mockup {
  background: var(--bg-primary);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-primary);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.book-mockup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
}

.demo-text {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
  transition: color var(--transition-normal);
}

.translated-word {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
}

.translated-word:hover {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
}

.demo-arrow {
  text-align: center;
  margin: 1rem 0;
  animation: bounce 2s infinite;
}

.demo-arrow i {
  font-size: 2rem;
  color: var(--primary-blue);
}

.demo-instruction {
  background: var(--primary-blue-subtle);
  border-radius: 10px;
  padding: 1rem;
  border-left: 4px solid var(--primary-blue);
  margin-top: 1rem;
}

.demo-instruction p {
  margin: 0;
  color: var(--primary-blue);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.translation-popup {
  background: var(--bg-primary);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-primary);
  animation: popupSlide 0.3s ease-out;
}

.popup-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.popup-word {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.popup-translation {
  color: var(--primary-blue);
  font-weight: 500;
  font-size: 1rem;
}

.popup-audio {
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-left: auto;
}

.popup-audio:hover {
  background: var(--primary-blue-light);
  transform: scale(1.1);
}

/* ===== DEMO SECTION ===== */
.demo-section {
  padding: 4rem 1rem;
  background: var(--bg-secondary);
  position: relative;
  transition: background var(--transition-normal);
}

.demo-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.demo-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  transition: color var(--transition-normal);
}

.demo-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  transition: color var(--transition-normal);
}

.interactive-demo {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: var(--shadow-xl);
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--border-primary);
  transition: all var(--transition-normal);
}

.demo-text-container {
  margin-bottom: 2rem;
}

.interactive-text {
  font-size: 1.3rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin: 0;
  transition: color var(--transition-normal);
}

.demo-word {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.demo-word:hover {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
  transform: translateY(-1px);
}

.demo-instructions {
  background: var(--primary-blue-subtle);
  border-radius: 10px;
  padding: 1rem;
  border-left: 4px solid var(--primary-blue);
}

.demo-instructions p {
  margin: 0;
  color: var(--primary-blue);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.demo-popup {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-primary);
  z-index: 1000;
  position: fixed;
  max-width: 300px;
  min-width: 200px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform-origin: center bottom;
  will-change: opacity, transform;
}

/* ===== ANIMATIONS ===== */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes popupSlide {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroPopupPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(74, 144, 226, 0.4);
  }
}

/* ===== DARK MODE ===== */
body.active .hero-section {
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.15) 0%, 
    rgba(245, 158, 11, 0.15) 50%, 
    rgba(59, 130, 246, 0.15) 100%);
}

body.active .hero-title {
  color: var(--text-primary);
}

body.active .hero-description {
  color: var(--text-secondary);
}

body.active .stat-label {
  color: var(--text-muted);
}

body.active .book-mockup {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

body.active .demo-text,
body.active .interactive-text {
  color: var(--text-primary);
}

body.active .demo-section {
  background: var(--bg-tertiary);
}

body.active .demo-title {
  color: var(--text-primary);
}

body.active .demo-subtitle {
  color: var(--text-secondary);
}

body.active .interactive-demo {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

body.active .demo-popup {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

body.active .popup-word {
  color: var(--text-primary);
}

body.active .demo-instruction {
  background: var(--primary-blue-subtle);
  border-color: var(--primary-blue);
}

body.active .demo-instruction p {
  color: var(--primary-blue-light);
}

body.active .translation-popup {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

body.active .popup-word {
  color: var(--text-primary);
}

body.active .popup-translation {
  color: var(--primary-blue-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-section {
    padding-top: 110px; /* Adjust for mobile header height */
    min-height: calc(100vh - 110px);
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-description {
    font-size: 1.1rem;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .demo-title {
    font-size: 2rem;
  }
  
  .interactive-demo {
    padding: 2rem 1.5rem;
  }
  
  .interactive-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 1rem;
    padding-top: 85px; /* Adjust for smaller mobile header height */
    min-height: calc(100vh - 85px);
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .cta-primary, .cta-secondary {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  
  .hero-stats {
    gap: 1rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .demo-title {
    font-size: 1.8rem;
  }
  
  .interactive-demo {
    padding: 1.5rem 1rem;
  }
}

/* Specific adjustments for iPhone SE and similar small devices */
@media (max-width: 414px) {
  .hero-section {
    padding-top: 80px; /* Adjust for iPhone SE header height */
    min-height: calc(100vh - 80px);
  }
}

@media (max-width: 375px) {
  .hero-section {
    padding-top: 75px; /* Adjust for iPhone 12 Pro header height */
    min-height: calc(100vh - 75px);
  }
}

@media (max-width: 320px) {
  .hero-section {
    padding-top: 70px; /* Adjust for very small devices */
    min-height: calc(100vh - 70px);
  }
}

/* ===== USER DASHBOARD LIBRARY STYLES - Updated 2024-12-19 ===== */
.user-dashboard {
  padding: 2rem 1rem;
  background: var(--bg-primary);
  transition: background var(--transition-normal);
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  font-size: 3rem;
  color: var(--primary-blue);
}

.greeting-content h1 {
  font-size: 2rem;
  color: var(--text-primary);
  margin: 0;
  font-family: 'Alegreya Sans', sans-serif;
}

.user-highlight {
  color: var(--primary-blue);
}

.greeting-subtitle {
  color: var(--text-secondary);
  margin: 0.5rem 0 0 0;
  font-size: 1.1rem;
}

.dashboard-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-blue);
  font-family: 'Alegreya Sans', sans-serif;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.library-section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Alegreya Sans', sans-serif;
}

.catalog-btn {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.catalog-btn:hover {
  background: var(--primary-blue-light);
  transform: translateY(-2px);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
  gap: 1.5rem;
  justify-content: center;
}

.library-book-card {
  background: var(--bg-secondary);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
  cursor: pointer;
  border: 1px solid var(--border-primary);
  position: relative;
  max-width: 320px;
  width: 100%;
}

.library-book-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-blue);
}

.library-book-card:hover .library-book-cover img {
  transform: scale(1.05);
}

.library-book-card:hover .library-book-details h4 {
  transform: translateY(-1px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.library-book-cover {
  position: relative;
  text-align: center;
  margin-bottom: 1.5rem;
}

.library-book-cover img {
  width: 140px;
  height: auto;
  max-height: 180px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-normal);
}

.library-book-card .progress-overlay {
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  z-index: 2 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.library-book-card .circular-progress {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(var(--primary-blue) 0deg, var(--primary-blue) calc(var(--progress) * 3.6deg), var(--border-primary) calc(var(--progress) * 3.6deg), var(--border-primary) 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.library-book-card .circular-progress::before {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  z-index: 1;
}

.library-book-card .progress-percentage {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-blue);
  z-index: 2;
  position: relative;
}

.library-book-details h4 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin: 0 0 1rem 0;
  font-family: 'Alegreya Sans', sans-serif;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-normal);
}

.library-book-details p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 1.25rem 0;
  text-align: center;
  font-weight: 400;
  opacity: 0.7;
  font-style: italic;
}

.reading-position {
  font-size: 0.85rem !important;
  color: var(--accent-gold) !important;
  opacity: 1 !important;
  margin-bottom: 0.75rem !important;
  font-weight: 600 !important;
  font-style: normal !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.reading-position::before {
  content: '📖';
  font-size: 0.9rem;
}

.book-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
  padding: 0.875rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  margin-top: 0.75rem;
}

.book-action:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-1px);
}

.book-action i {
  font-size: 1.1rem;
}

.continue-reading-card {
  background: var(--bg-secondary);
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-primary);
}

.continue-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.continue-book-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.book-thumbnail-small {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-thumbnail-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.continue-details h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  font-family: 'Alegreya Sans', sans-serif;
}

.continue-details p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.continue-reading-btn {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.continue-reading-btn:hover {
  background: var(--primary-blue-light);
  transform: translateY(-2px);
}

.quick-actions-section {
  margin-top: 2rem;
}

.actions-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.quick-action {
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-primary);
  min-width: 120px;
}

.quick-action:hover {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
  transform: translateY(-3px);
  text-decoration: none;
}

.quick-action i {
  font-size: 1.5rem;
}

.quick-action span {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Dark mode styles for user dashboard */
body.active .user-dashboard {
  background: var(--bg-secondary);
}

body.active .library-book-card {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

body.active .library-book-card:hover {
  border-color: var(--accent-gold);
}

body.active .continue-reading-card {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

body.active .quick-action {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

body.active .quick-action:hover {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
}

/* Guide download button specific styles */
.guide-download-action {
  background: var(--accent-gold-subtle) !important;
  border-color: var(--accent-gold) !important;
  color: var(--accent-gold) !important;
}

.guide-download-action:hover {
  background: var(--accent-gold) !important;
  color: white !important;
  transform: translateY(-3px);
}

body.active .guide-download-action {
  background: var(--accent-gold-subtle) !important;
  border-color: var(--accent-gold) !important;
  color: var(--accent-gold) !important;
}

body.active .guide-download-action:hover {
  background: var(--accent-gold) !important;
  color: #1a1a1a !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 4px 15px rgba(253, 194, 28, 0.4) !important;
  transform: translateY(-3px) !important;
}

body.active .library-book-card .circular-progress::before {
  background: var(--bg-tertiary);
}

body.active .library-book-card .progress-percentage {
  color: var(--accent-gold);
}

body.active .library-book-card .circular-progress {
  background: conic-gradient(var(--accent-gold) 0deg, var(--accent-gold) calc(var(--progress) * 3.6deg), var(--border-secondary) calc(var(--progress) * 3.6deg), var(--border-secondary) 360deg);
}

body.active .library-book-details h4 {
  color: var(--accent-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.active .library-book-details p {
  color: var(--text-secondary);
}

body.active .book-action {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
}

body.active .book-action:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

/* Responsive styles for user dashboard */
@media (min-width: 1200px) {
  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 320px));
    max-width: 1200px;
    margin: 0 auto;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 300px));
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    text-align: center;
  }
  
  .dashboard-stats {
    justify-content: center;
  }
  
  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }
  
  .continue-content {
    flex-direction: column;
    text-align: center;
  }
  
  .actions-row {
    flex-direction: column;
    align-items: center;
  }
  
  .quick-action {
    width: 100%;
    max-width: 200px;
  }
}

/* ===== GUIDE CTA SECTION STYLES ===== */
.guide-cta-section {
  background: linear-gradient(135deg, #4A90E2 0%, #F5A623 100%);
  color: white;
  padding: 3rem 2rem;
  margin: 3rem 0;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(74, 144, 226, 0.2);
}

.guide-cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.guide-cta-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.guide-cta-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.guide-cta-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
  font-family: 'Alegreya Sans', sans-serif;
}

.guide-cta-highlight {
  color: #FDC21C;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  font-weight: 800;
  background: rgba(253, 194, 28, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(253, 194, 28, 0.3);
  display: inline-block;
  line-height: 1.2;
  vertical-align: baseline;
}

.guide-cta-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.guide-cta-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.guide-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  opacity: 0.9;
}

.guide-feature i {
  font-size: 1.2rem;
  color: #FDC21C;
}

.guide-feature span {
  color: white;
}

.guide-cta-action {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.guide-cta-button {
  background: var(--primary-blue);
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  min-width: 200px;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.guide-cta-button:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
  text-decoration: none;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.guide-cta-button.secondary {
  background: var(--bg-primary);
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
}

.guide-cta-button.secondary:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
  border-color: var(--primary-blue-dark);
}

.guide-cta-button i {
  margin-right: 0.5rem;
}

/* Fix for mobile text rendering over gradients */
.guide-cta-section * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Dark mode styles for Guide CTA */
body.active .guide-cta-section {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(253, 194, 28, 0.2);
}

body.active .guide-cta-button {
  background: linear-gradient(135deg, #FDC21C, #F59E0B);
  color: #1e293b;
  box-shadow: 0 4px 15px rgba(253, 194, 28, 0.3);
}

body.active .guide-cta-button:hover {
  background: linear-gradient(135deg, #FBBF24, #FDC21C);
  color: #0f172a;
  box-shadow: 0 8px 25px rgba(253, 194, 28, 0.5);
  transform: translateY(-2px);
}

body.active .guide-cta-highlight {
  color: #FDC21C;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  background: rgba(253, 194, 28, 0.2);
  border-color: rgba(253, 194, 28, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(253, 194, 28, 0.4);
  display: inline-block;
  line-height: 1.2;
  vertical-align: baseline;
}

/* Next Step Section for Guía Gratuita */
.next-step-section {
  background: #f8fafc;
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid #e2e8f0;
}

.next-step-content {
  max-width: 600px;
  margin: 0 auto;
}

.next-step-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  font-family: 'Alegreya Sans', sans-serif;
}

.next-step-description {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.next-step-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Dark mode styles for next step section */
body.active .next-step-section {
  background: #1e293b;
  border-color: #334155;
}

body.active .next-step-title {
  color: white;
}

body.active .next-step-description {
  color: #cbd5e1;
}

/* Container específico para la página de guía */
.guia-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Back to site link */
.back-to-site {
  text-align: center;
  margin-top: 40px;
}

.back-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity var(--transition-normal);
}

.back-link:hover {
  opacity: 1;
}

.back-link i {
  margin-right: 5px;
}

/* Responsive design for Guide CTA */
@media (max-width: 768px) {
  .guia-container {
    padding: 15px;
  }

  .guide-cta-section {
    padding: 2rem 1.5rem;
    margin: 2rem 0;
  }

  .guide-cta-icon {
    font-size: 3rem;
  }

  .guide-cta-title {
    font-size: 1.8rem;
  }

  .guide-cta-description {
    font-size: 1rem;
  }

  .guide-cta-features {
    flex-direction: column;
    gap: 1rem;
  }

  .guide-cta-action {
    flex-direction: column;
    align-items: center;
  }

  .guide-cta-button {
    padding: 12px 24px;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
  }
  
  .next-step-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .next-step-actions .guide-cta-button {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .guide-cta-section {
    padding: 1.5rem 1rem;
  }

  .guide-cta-title {
    font-size: 1.6rem;
  }

  .guide-cta-description {
    font-size: 0.9rem;
  }
}

/* ===== GUÍA GRATUITA PAGE STYLES ===== */

/* Container principal - usando el mismo diseño que la landing */
.guia-container {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background var(--transition-normal), color var(--transition-normal);
}

body.active .guia-container {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Hero Section - siguiendo el patrón de la landing */
.guide-hero-section {
  padding: var(--spacing-xxxl) var(--spacing-lg);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  position: relative;
  overflow: hidden;
}

.guide-hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-blue-subtle) 0%, var(--accent-gold-subtle) 100%);
  pointer-events: none;
}

.guide-hero-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.guide-hero-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-lg);
  animation: gentleBounce 3s ease-in-out infinite;
}

@keyframes gentleBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.guide-hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: var(--spacing-md);
  line-height: 1.1;
  color: var(--text-primary);
  transition: color var(--transition-normal);
}

.guide-hero-highlight {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.guide-hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  transition: color var(--transition-normal);
}

.guide-hero-action {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}


/* Benefits Section - usando el sistema de colores de la landing */
.guide-benefits-section {
  padding: var(--spacing-xxxl) var(--spacing-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

.guide-benefits-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.benefits-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xxxl);
  transition: color var(--transition-normal);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-xl);
}

.benefit-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: var(--spacing-xl);
  text-align: center;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-blue);
}

.benefit-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
}

.benefit-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  transition: color var(--transition-normal);
}

.benefit-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1rem;
  transition: color var(--transition-normal);
}

.simple-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-primary);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  transition: color var(--transition-normal);
  opacity: 0.8;
}

/* Explore Platform Section */
.explore-platform-section {
  padding: var(--spacing-xl) var(--spacing-lg);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

.explore-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.explore-content h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  transition: color var(--transition-normal);
}

.explore-content p {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xl);
  line-height: 1.6;
  transition: color var(--transition-normal);
  opacity: 0.8;
}

.platform-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Next Steps Section */
.next-steps-section {
  padding: var(--spacing-xxxl) var(--spacing-lg);
  background: var(--bg-primary);
  transition: background var(--transition-normal);
}

.next-steps-content {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.next-steps-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  transition: color var(--transition-normal);
}

.next-steps-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xxxl);
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  transition: color var(--transition-normal);
}

.book-recommendation {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  padding: var(--spacing-xl);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.book-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  text-align: left;
}

.book-cover {
  flex-shrink: 0;
}

.book-cover img {
  width: 120px;
  height: 180px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  object-fit: cover;
}

.book-info {
  flex: 1;
}

.book-info h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  transition: color var(--transition-normal);
}

.book-author {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-md);
  font-style: italic;
  transition: color var(--transition-normal);
}

.book-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--spacing-sm);
  transition: color var(--transition-normal);
  max-height: 80px; /* Limit description height */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4; /* Show max 4 lines */
  -webkit-box-orient: vertical;
}

.book-stats {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.book-level,
.book-chapters {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-normal);
}

.book-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive design para la página de guía */
@media (max-width: 768px) {
  .guide-hero-section {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .guide-hero-title {
    font-size: 2.2rem;
  }

  .guide-hero-subtitle {
    font-size: 1.1rem;
  }

  .guide-hero-action {
    flex-direction: column;
    align-items: center;
  }

  .guide-benefits-section,
  .explore-platform-section,
  .next-steps-section {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .benefits-title,
  .next-steps-title {
    font-size: 2rem;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .book-card {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-lg);
  }

  .book-cover img {
    width: 100px;
    height: 150px;
  }

  .book-actions {
    flex-direction: column;
    align-items: center;
  }

  .book-actions .guide-cta-button,
  .platform-actions .guide-cta-button {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .guide-hero-title {
    font-size: 1.8rem;
  }

  .guide-hero-icon {
    font-size: 3rem;
  }

  .benefit-card {
    padding: var(--spacing-lg);
  }

  .book-recommendation {
    padding: var(--spacing-lg);
  }

  .book-info h3 {
    font-size: 1.5rem;
  }

  .benefits-title,
  .next-steps-title {
    font-size: 1.6rem;
  }

}

/* ===== BOOK CARDS RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  .books-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .book-card {
    height: 480px; /* Slightly smaller on mobile */
    padding: 20px;
  }
  
  .book-description {
    max-height: 90px; /* Smaller max height on mobile */
    font-size: 0.9rem;
  }
  
  .book-tags {
    gap: 6px;
    margin-bottom: 12px;
  }
  
  .theme-tag {
    padding: 3px 6px;
    font-size: 0.7rem;
  }
  
  .book-stats {
    gap: 8px;
    padding-top: 8px;
  }
  
  .chapters-count,
  .difficulty {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
  
  .coming-soon-card {
    opacity: 0.8;
    /* Ensure consistent height on mobile */
    height: 560px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .books-grid {
    gap: 15px;
  }
  
  .book-card {
    height: 460px; /* Even smaller on very small screens */
    padding: 15px;
  }
  
  .book-title {
    font-size: 1.7rem;
    line-height: 1.2;
  }
  
  .book-author {
    font-size: 0.9rem;
    min-height: 1.8em;
  }
  
  .book-description {
    max-height: 80px;
    font-size: 0.85rem;
    margin-bottom: 15px;
  }
  
  .book-tags {
    gap: 4px;
    margin-bottom: 10px;
  }
  
  .theme-tag {
    padding: 2px 5px;
    font-size: 0.65rem;
  }
  
  .book-stats {
    gap: 6px;
    padding-top: 6px;
  }
  
  .chapters-count,
  .difficulty {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  
  .coming-soon-card {
    height: 520px !important;
  }
}

