/* Estilos limpios - solo los necesarios para el nuevo diseño */

.progress-check-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-check-info h4 {
  margin: 1rem 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.progress-check-info p {
  margin: 0;
  opacity: 0.9;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* Estilos para el aviso "Próximamente" */
.coming-soon-card {
  position: relative;
  opacity: 0.7;
  cursor: default;
  transition: all 0.3s ease;
  /* Ensure consistent structure with regular book cards */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: inherit; /* Inherit from parent book-card */
}

.coming-soon-card:hover {
  opacity: 0.8;
  transform: none;
}

/* Dark mode improvements for coming-soon card */
body.active .coming-soon-card {
  opacity: 0.9;
  background: var(--bg-secondary);
  border: 2px solid var(--border-secondary);
}

body.active .coming-soon-card:hover {
  opacity: 1;
  border-color: var(--accent-gold);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.coming-soon-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Dark mode improvements for coming-soon overlay */
body.active .coming-soon-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.coming-soon-badge {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
  animation: pulse 2s infinite;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  animation: pulse 2s infinite;
}

/* Dark mode improvements for coming-soon badge */
body.active .coming-soon-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  border: 2px solid rgba(245, 158, 11, 0.3);
}

.coming-soon-badge i {
  font-size: 1.1rem;
}

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

.coming-soon-message {
  margin-top: 15px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #ff6b6b;
}

.coming-soon-message p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.coming-soon-message i {
  color: #ff6b6b;
}

/* Dark mode styles for coming-soon card text elements */
body.active .coming-soon-card .book-title {
  color: var(--accent-gold) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.active .coming-soon-card .book-author {
  color: var(--text-secondary) !important;
}

/* Ensure coming-soon card book-info has consistent structure */
.coming-soon-card .book-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1; /* Take remaining space */
}

/* Ensure coming-soon card author text has consistent height */
.coming-soon-card .book-author {
  min-height: 1.5em; /* Same as regular book cards */
  line-height: 1.5;
  display: flex;
  align-items: center;
  margin-bottom: 20px; /* Same margin as regular cards */
}

body.active .coming-soon-card .book-description {
  color: var(--text-secondary) !important;
}

body.active .coming-soon-card .chapters-count {
  color: var(--primary-blue-light) !important;
}

body.active .coming-soon-card .difficulty {
  color: var(--accent-gold) !important;
}

/* Dark mode improvements for coming-soon card book image */
body.active .coming-soon-card .book-image {
  filter: brightness(1.1) contrast(1.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile-specific improvements for coming-soon card */
@media (max-width: 768px) {
  .coming-soon-card {
    opacity: 0.8;
    /* Ensure consistent height on mobile */
    height: 560px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  body.active .coming-soon-card {
    opacity: 0.95;
  }
  
  .coming-soon-badge {
    font-size: 0.8rem;
    padding: 10px 16px;
  }
  
  body.active .coming-soon-badge {
    font-size: 0.8rem;
    padding: 10px 16px;
  }
  
  /* Ensure coming-soon card author text has consistent height on mobile */
  .coming-soon-card .book-author {
    min-height: 1.8em; /* Same as regular book cards on mobile */
    margin-bottom: 15px; /* Same margin as regular cards on mobile */
  }
}

@media (max-width: 480px) {
  .coming-soon-card {
    opacity: 0.85;
    /* Ensure consistent height on smaller mobile devices */
    height: 520px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  body.active .coming-soon-card {
    opacity: 1;
  }
  
  .coming-soon-badge {
    font-size: 0.75rem;
    padding: 8px 14px;
  }
  
  body.active .coming-soon-badge {
    font-size: 0.75rem;
    padding: 8px 14px;
  }
  
  /* Ensure coming-soon card author text has consistent height on small mobile */
  .coming-soon-card .book-author {
    min-height: 1.8em; /* Same as regular book cards on small mobile */
    margin-bottom: 12px; /* Same margin as regular cards on small mobile */
  }
}

/* Ocultar el botón de acceso directo para usuarios no autenticados */
.admin-access {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.admin-access.show {
  display: block;
}

.admin-access-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.admin-access-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Book card link styling */
.book-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s ease;
}

.book-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.book-card-link:hover .book-card {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Estilos para el menú "Próximamente" */
.coming-soon-link {
  position: relative;
  color: #999 !important;
  cursor: default;
  background: transparent !important;
}

.availability-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.availability-badge.available {
  background: #28a745;
  color: white;
}

.availability-badge.coming-soon {
  background: #dc3545;
  color: white;
}

.coming-soon-badge-small {
  background: #ff6b6b;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.coming-soon-link:hover {
  color: #999 !important;
  background: rgba(253, 194, 28, 0.1) !important;
  transform: translateX(5px);
}

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

/* Loading states para evitar flickering */
.auth-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: #6c757d;
  font-size: 14px;
}

.auth-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #e9ecef;
  border-top: 2px solid #6c757d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.books-loading-badge {
  background: #6c757d !important;
  color: white !important;
  position: relative;
  overflow: hidden;
}

.books-loading-badge::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Estado de loading suave para transiciones */
.smooth-transition {
  transition: all 0.3s ease;
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#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 básicos para loading y transiciones */

/* Estilos para LoadingSpinner */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 2rem;
}

.loading-spinner-large {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(102, 126, 234, 0.3);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-text {
  color: #6c757d;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

/* Estilos para transiciones suaves y evitar pestañeo */
#landing-content {
  transition: opacity 0.3s ease;
  min-height: 60vh; /* Asegurar altura mínima para evitar saltos del footer */
}

/* Smooth transitions solo para elementos de landing - no afectar footer */
#landing-content * {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Loading states optimizados */
.loading-container {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Estilos básicos para layout principal */

/* Classic Sticky Footer - Método más confiable */
html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  position: relative;
}

/* Barrera visual entre contenido y footer */
.main-content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #f0f0f0;
  z-index: 999;
}

body.active .main-content::after {
  background: #16213e;
}

/* FOOTER - Sobrescribir completamente todos los estilos */
footer.footer,
.footer {
  all: unset !important;
  display: block !important;
  width: 100% !important;
  min-height: 140px !important;
  background-color: #f0f0f0 !important;
  text-align: center !important;
  padding: 20px 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 10000 !important;
  border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
  /* Ensure footer is always visible and not cut off */
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

/* Footer modo oscuro */
body.active footer.footer,
body.active .footer {
  background-color: #16213e !important;
  color: #f1f5f9 !important;
  border-top: 1px solid rgba(253, 194, 28, 0.2) !important;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Textos del footer */
footer.footer p,
.footer p {
  font-weight: bold !important;
  font-size: 14px !important;
  letter-spacing: 1.5px !important;
  margin: 0 43px !important;
  padding: 15px 0 10px 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important;
  color: #374151 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  background: transparent !important;
}

footer.footer p.copyright,
.footer p.copyright {
  font-size: 12px !important;
  font-weight: normal !important;
  letter-spacing: 0.5px !important;
  margin: 0 43px !important;
  padding: 8px 0 5px 0 !important;
  border-bottom: none !important;
  color: #6b7280 !important;
  text-shadow: none !important;
  background: transparent !important;
}

/* Footer modo oscuro - textos */
body.active footer.footer p,
body.active .footer p {
  color: #fdc21c !important;
  border-bottom: 1px solid rgba(253, 194, 28, 0.3) !important;
  text-shadow: 0 0 8px rgba(253, 194, 28, 0.3) !important;
}

body.active footer.footer p.copyright,
body.active .footer p.copyright {
  color: #9ca3af !important;
  border-bottom: none !important;
  text-shadow: none !important;
}

/* Social media */
footer.footer .social-media,
.footer .social-media {
  padding-top: 15px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  flex-wrap: wrap !important;
  background: transparent !important;
}

/* Enlaces del footer */
footer.footer a,
.footer a {
  text-decoration: none !important;
  color: #374151 !important;
  transition: all 0.3s ease !important;
  display: inline-block !important;
  background: transparent !important;
}

footer.footer a:hover,
.footer a:hover {
  transform: translateY(-2px) !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)) !important;
}

body.active footer.footer a,
body.active .footer a {
  color: #fdc21c !important;
  filter: drop-shadow(0 0 5px rgba(253, 194, 28, 0.3)) !important;
}

body.active footer.footer a:hover,
body.active .footer a:hover {
  color: #fbbf24 !important;
  transform: translateY(-2px) scale(1.05) !important;
  filter: drop-shadow(0 0 10px rgba(253, 194, 28, 0.5)) !important;
}

/* SVGs del footer */
footer.footer svg,
.footer svg {
  transition: all 0.3s ease !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)) !important;
}

body.active footer.footer svg,
body.active .footer svg {
  filter: drop-shadow(0 0 5px rgba(253, 194, 28, 0.3)) !important;
}

/* ===== SISTEMA DE ESPACIADO CONSISTENTE ===== */
:root {
  /* Espaciado base - múltiplos de 8px */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 0.75rem;    /* 12px */
  --space-lg: 1rem;       /* 16px */
  --space-xl: 1.5rem;     /* 24px */
  --space-2xl: 2rem;      /* 32px */
  --space-3xl: 2.5rem;    /* 40px */
  --space-4xl: 3rem;      /* 48px */
  --space-5xl: 4rem;      /* 64px */
  --space-6xl: 5rem;      /* 80px */
  
  /* Espaciado específico para componentes */
  --component-padding-sm: var(--space-md);
  --component-padding-md: var(--space-xl);
  --component-padding-lg: var(--space-2xl);
  --component-padding-xl: var(--space-3xl);
  
  /* Espaciado entre elementos */
  --element-gap-sm: var(--space-sm);
  --element-gap-md: var(--space-lg);
  --element-gap-lg: var(--space-xl);
  --element-gap-xl: var(--space-2xl);
  
  /* Espaciado de secciones */
  --section-gap-sm: var(--space-2xl);
  --section-gap-md: var(--space-3xl);
  --section-gap-lg: var(--space-4xl);
}
.user-dashboard {
  background: linear-gradient(135deg, 
    var(--primary-blue-subtle) 0%, 
    var(--accent-gold-subtle) 50%, 
    var(--info-subtle) 100%);
  padding: var(--component-padding-lg);
  padding-top: 120px; /* Espacio para el header fijo */
  padding-bottom: var(--component-padding-lg);
  color: var(--text-primary);
  transition: background var(--transition-slow);
  position: relative;
  overflow: visible;
}

/* Patrón de textura sutil como PublicLanding */
.user-dashboard::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;
}

/* Modo oscuro para UserLanding - igual que PublicLanding */
body.active .user-dashboard {
  background: linear-gradient(135deg, 
    var(--bg-secondary) 0%, 
    var(--bg-tertiary) 50%, 
    var(--primary-blue-subtle) 100%);
  color: var(--text-primary);
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--component-padding-md);
  display: flex;
  flex-direction: column;
  gap: var(--section-gap-md);
  animation: fadeInUp 0.6s ease-out;
  overflow: visible;
}

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

/* Header del Dashboard */
.dashboard-header {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--element-gap-xl);
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: var(--component-padding-lg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all var(--transition-smooth);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.active .dashboard-header {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Continuar con el resto de los estilos del dashboard y demás... */

/* ===== DEMO SECTION STYLES ===== */
.demo-section {
  margin: 4rem 0;
  padding: 3rem 2rem;
  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%);
  border-radius: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.demo-container {
  max-width: 800px;
  margin: 0 auto;
}

.demo-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-family: 'Alegreya Sans', sans-serif;
}

.demo-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.interactive-demo {
  margin-top: 2rem;
}

.demo-text-container {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--border-primary);
  position: relative;
}

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

.interactive-text .translated-word {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  display: inline-block;
}

.interactive-text .translated-word:hover {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  border-radius: 4px;
}

.demo-instructions {
  margin-top: 1.5rem;
}

.demo-instructions p {
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.demo-instructions i {
  color: var(--accent-gold);
  font-size: 1.2rem;
}

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

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

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

body.active .demo-text-container {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body.active .interactive-text .translated-word:hover {
  background: rgba(245, 158, 11, 0.25);
  color: var(--accent-gold);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px) scale(1.05);
}

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

/* Responsive design for demo section */
@media (max-width: 768px) {
  .demo-section {
    margin: 3rem 0;
    padding: 2rem 1rem;
  }
  
  .demo-title {
    font-size: 1.8rem;
  }
  
  .demo-subtitle {
    font-size: 1rem;
  }
  
  .demo-text-container {
    padding: 1.5rem;
  }
  
  .interactive-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .demo-section {
    margin: 2rem 0;
    padding: 1.5rem 0.75rem;
  }
  
  .demo-title {
    font-size: 1.6rem;
  }
  
  .demo-text-container {
    padding: 1rem;
  }
  
  .interactive-text {
    font-size: 1rem;
  }
  
  .demo-instructions p {
    font-size: 0.9rem;
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ===== INTERACTIVE DEMO SECTION STYLES ===== */
.interactive-demo-section {
  margin: 4rem 0;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, 
    var(--primary-blue-subtle) 0%, 
    var(--accent-gold-subtle) 50%, 
    var(--info-subtle) 100%);
  border-radius: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.interactive-demo-section h3 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  font-family: 'Alegreya Sans', sans-serif;
}

.demo-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.demo-text-container {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--border-primary);
  position: relative;
}

.demo-text {
  font-size: 1.3rem;
  line-height: 1.8;
  color: var(--text-primary);
  text-align: left;
  max-width: 800px;
  margin: 0 auto;
}

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

.demo-text .translated-word:hover {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(253, 194, 28, 0.3);
}

.demo-instructions {
  margin-top: 1.5rem;
}

.demo-instructions p {
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.demo-instructions i {
  color: var(--accent-gold);
  font-size: 1.2rem;
}

/* Dark mode styles for demo section */
body.active .interactive-demo-section {
  background: linear-gradient(135deg, 
    var(--bg-secondary) 0%, 
    var(--bg-tertiary) 50%, 
    var(--primary-blue-subtle) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.active .interactive-demo-section h3 {
  color: var(--accent-gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

body.active .demo-text-container {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body.active .demo-text .translated-word:hover {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(253, 194, 28, 0.4);
}

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

/* Responsive design for demo section */
@media (max-width: 768px) {
  .interactive-demo-section {
    margin: 3rem 0;
    padding: 2rem 1rem;
  }
  
  .interactive-demo-section h3 {
    font-size: 1.8rem;
  }
  
  .demo-description {
    font-size: 1rem;
  }
  
  .demo-text-container {
    padding: 1.5rem;
  }
  
  .demo-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .interactive-demo-section {
    margin: 2rem 0;
    padding: 1.5rem 0.75rem;
  }
  
  .interactive-demo-section h3 {
    font-size: 1.6rem;
  }
  
  .demo-text-container {
    padding: 1rem;
  }
  
  .demo-text {
    font-size: 1rem;
  }
  
  .demo-instructions p {
    font-size: 0.9rem;
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ===== 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);
}

/* 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);
}

/* Estilos para el dropdown principal de libros */
.dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* Asegurar alineación a la derecha del nav */
.nav-opcions {
  justify-content: flex-end !important;
}

.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: #fdc21c;
}

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

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

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  margin: 5px 0 0 0;
  min-width: 320px;
  width: max-content;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  border: 1px solid rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

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

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

.dropdown-menu a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #1e293b;
  text-decoration: none;
  transition: all 0.3s ease;
  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-menu a:hover {
  background: rgba(253, 194, 28, 0.1);
  color: #fdc21c;
  padding-left: 25px;
  transform: translateX(5px);
}

/* Estilos específicos para el dropdown de libros en modo oscuro */
body.active #books-dropdown-menu {
  background: rgba(15, 23, 42, 0.98) !important;
  border-color: rgba(253, 194, 28, 0.2) !important;
  backdrop-filter: blur(15px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

/* Estilos específicos para los enlaces del dropdown de libros en modo oscuro */
body.active #books-dropdown-menu a {
  color: #f1f5f9 !important;
}

/* Estilos específicos para el hover del dropdown de libros en modo oscuro */
body.active #books-dropdown-menu a:hover {
  background: rgba(253, 194, 28, 0.1) !important;
  color: #fdc21c !important;
  transform: translateX(5px) !important;
  box-shadow: 0 0 10px rgba(253, 194, 28, 0.2) !important;
}

/* Dark Mode Styles for User Menu */
/* Contenedor del dropdown del usuario en modo oscuro - Combinando con el esquema de la página */
body.active #user-dropdown-menu {
  background-color: rgba(15, 23, 42, 0.98) !important;
  border: 1px solid rgba(253, 194, 28, 0.2) !important;
  border-radius: 8px !important;
  backdrop-filter: blur(15px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

/* Botón de logout en modo oscuro - Combinando con el esquema de la página */
body.active #logout-btn {
  color: #f1f5f9 !important;
  background-color: transparent !important;
  font-weight: 500 !important;
  border: none !important;
  transition: all 0.3s ease !important;
}

body.active #logout-btn:hover {
  color: #fdc21c !important;
  background-color: rgba(253, 194, 28, 0.1) !important;
  font-weight: 600 !important;
  transform: translateX(5px) !important;
  box-shadow: 0 0 10px rgba(253, 194, 28, 0.2) !important;
}

body.active #logout-btn i {
  color: #f1f5f9 !important;
  margin-right: 8px !important;
}

body.active #logout-btn:hover i {
  color: #fdc21c !important;
}

/* ===== FINAL CTA SECTION STYLES ===== */
.final-cta-section {
  margin-top: 4rem;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, 
    var(--primary-blue-subtle) 0%, 
    var(--accent-gold-subtle) 50%, 
    var(--info-subtle) 100%);
  border-radius: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Patrón de textura sutil */
.final-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"/><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;
}

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

.cta-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: 'Alegreya Sans', sans-serif;
  line-height: 1.2;
}

.cta-title i {
  font-size: 2rem;
  color: var(--accent-gold);
}

.cta-description {
  font-size: 1.2rem;
  color: #475569;
  margin-bottom: 2rem;
  line-height: 1.6;
}

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

.cta-primary-btn {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: #000000;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  border: 2px solid transparent;
  text-shadow: none;
}

.cta-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
  text-decoration: none;
  color: #000000;
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
}

.cta-secondary-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 500;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: 2px solid rgba(30, 41, 59, 0.1);
  backdrop-filter: blur(10px);
}

.cta-secondary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: #1e293b;
  background: rgba(255, 255, 255, 1);
  border-color: rgba(30, 41, 59, 0.2);
}

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

.mini-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #475569;
  font-weight: 500;
}

.mini-feature i {
  color: #22c55e;
  font-size: 1rem;
}

/* Dark mode styles for CTA */
body.active .final-cta-section {
  background: linear-gradient(135deg, 
    var(--bg-secondary) 0%, 
    var(--bg-tertiary) 50%, 
    var(--primary-blue-subtle) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

body.active .cta-title i {
  color: var(--accent-gold-light);
}

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

body.active .cta-secondary-btn {
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

body.active .cta-secondary-btn:hover {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.3);
}

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

/* Dark mode specific styles for CTA primary button */
body.active .cta-primary-btn {
  color: #1e293b;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
}

body.active .cta-primary-btn:hover {
  color: #1e293b;
  background: linear-gradient(135deg, #fbbf24, var(--accent-gold-light));
}

/* Responsive design for CTA */
@media (max-width: 768px) {
  .final-cta-section {
    margin-top: 3rem;
    padding: 2rem 1rem;
  }

  .cta-title {
    font-size: 1.8rem;
    flex-direction: column;
    gap: 0.5rem;
  }

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

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

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

  .cta-primary-btn,
  .cta-secondary-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .cta-features-mini {
    gap: 1rem;
  }

  .mini-feature {
    font-size: 0.9rem;
  }
}

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

  .cta-title {
    font-size: 1.5rem;
  }

  .cta-features-mini {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ===== 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-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-cta-button {
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  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(0, 0, 0, 0.1);
}

.guide-cta-button:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: #1e293b;
}

/* 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;
}

body.active .guide-cta-button:hover {
  background: linear-gradient(135deg, #FBBF24, #FDC21C);
}

/* Responsive styles for Guide CTA */
@media (max-width: 768px) {
  .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-button {
    padding: 12px 24px;
    font-size: 1rem;
  }
}

@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;
  }
}

/* User greeting and dashboard elements */
.user-greeting {
  display: flex;
  align-items: center;
  gap: var(--element-gap-lg);
}

.user-avatar {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.9);
  transition: color var(--transition-smooth);
}

body.active .user-avatar {
  color: var(--accent-gold);
}

.greeting-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  font-family: 'Alegreya Sans', sans-serif;
  color: var(--text-primary);
  transition: color var(--transition-smooth);
  line-height: 1.1;
}

.user-highlight {
  color: var(--accent-gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: color var(--transition-smooth);
}

body.active .user-highlight {
  color: var(--accent-gold-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

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

.dashboard-stats {
  display: flex;
  gap: var(--element-gap-xl);
}

.stat-item {
  text-align: center;
  padding: var(--component-padding-sm);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  min-width: 100px;
  transition: all var(--transition-smooth);
}

body.active .stat-item {
  background: rgba(0, 0, 0, 0.2);
}

.stat-number {
  display: block;
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  transition: all var(--transition-smooth);
}

body.active .stat-number {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(245, 158, 11, 0.5);
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
  color: var(--text-secondary);
  transition: color var(--transition-smooth);
}

/* Continuar Leyendo */
.continue-reading-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(25px);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all var(--transition-smooth);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.7s ease-out 0.1s both;
}

body.active .continue-reading-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.continue-reading-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

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

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

.book-thumbnail-small {
  width: 50px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-smooth);
}

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

.continue-details h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  transition: color var(--transition-smooth);
}

.continue-details p {
  opacity: 0.8;
  margin: 0;
  color: var(--text-secondary);
  transition: color var(--transition-smooth);
}

.continue-reading-btn {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: var(--gray-900);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.continue-reading-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
}

body.active .continue-reading-btn {
  color: var(--gray-900);
}

/* Sección Biblioteca */
.library-section {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: var(--component-padding-lg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all var(--transition-smooth);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.7s ease-out 0.2s both;
  overflow: visible;
}

body.active .library-section {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--element-gap-lg);
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--text-primary);
  transition: color var(--transition-smooth);
}

.catalog-btn {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: var(--gray-900);
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  position: relative;
  overflow: hidden;
}

.catalog-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--element-gap-lg);
  margin-top: var(--element-gap-sm);
}

.library-book-card {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: var(--component-padding-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-smooth);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 460px;
  box-sizing: border-box;
  overflow: hidden;
}

body.active .library-book-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.library-book-card:hover {
  transform: translateY(-5px) scale(1.02);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.library-book-card:focus {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
  transform: translateY(-2px) scale(1.01);
}

.library-book-card:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Ensure focus is visible in dark mode */
body.active .library-book-card:focus,
body.active .library-book-card:focus-visible {
  outline-color: var(--accent-gold-light);
}

/* Book theme labels - subtle and desktop-only */
.book-theme-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
  transition: all var(--transition-smooth);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.active .book-theme-label {
  color: var(--accent-gold-light);
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

.library-book-card:hover .book-theme-label {
  background: rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
}

body.active .library-book-card:hover .book-theme-label {
  background: rgba(245, 158, 11, 0.25);
}

/* Hide theme labels on mobile to avoid clutter */
@media (max-width: 768px) {
  .book-theme-label {
    display: none;
  }
}

.library-book-cover {
  position: relative;
  width: 180px;
  height: 225px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.library-book-cover img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center 20%;
  /* Image optimization for mobile */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* Lazy loading support */
  loading: lazy;
  /* Prevent layout shift */
  aspect-ratio: 4/5;
}

body.active .library-book-cover {
  background: #2d3748;
}

.progress-overlay {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 60px;
  height: 60px;
}

.circular-progress {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-gold) 0deg, var(--accent-gold) calc(var(--progress) * 3.6deg), rgba(255,255,255,0.2) calc(var(--progress) * 3.6deg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-smooth);
}

body.active .circular-progress {
  background: conic-gradient(var(--accent-gold-light) 0deg, var(--accent-gold-light) calc(var(--progress) * 3.6deg), rgba(255,255,255,0.2) calc(var(--progress) * 3.6deg));
}

.circular-progress::before {
  content: '';
  position: absolute;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--primary-blue);
  transition: background var(--transition-smooth);
}

body.active .circular-progress::before {
  background: var(--primary-blue-light);
}

.progress-percentage {
  position: relative;
  z-index: 1;
  color: var(--text-primary);
  transition: color var(--transition-smooth);
}

.library-book-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: flex-start;
  gap: 1rem;
}

.library-book-details .book-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.library-book-details .book-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.library-book-details h4 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: color var(--transition-smooth);
  /* Enhanced contrast for better readability */
  filter: contrast(1.1);
}

.library-book-details p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  opacity: 0.95; /* Slightly increased from 0.9 for better contrast */
  transition: color var(--transition-smooth);
  /* Enhanced contrast for better readability */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.reading-position {
  font-size: 0.9rem !important;
  color: var(--accent-gold) !important;
  opacity: 1 !important;
  margin-bottom: 0.5rem !important;
  font-weight: 600 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  /* Enhanced contrast and readability */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  filter: contrast(1.2);
}

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

.book-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  color: white;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: all var(--transition-smooth);
  border: none;
  cursor: pointer;
  text-decoration: none;
  margin-top: 0;
  min-height: 3rem; /* 48px - exceeds 44px requirement */
  min-width: 8rem;
  /* Touch target accessibility */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* High contrast for better accessibility */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.book-action:hover {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

body.active .book-action {
  color: var(--accent-gold-light);
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

body.active .library-book-details h4 {
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
  filter: contrast(1.15);
}

body.active .library-book-details p {
  color: var(--text-secondary);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
  opacity: 0.95;
}

body.active .reading-position {
  color: var(--accent-gold-light) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
  filter: contrast(1.2) !important;
}


/* Acciones Rápidas */
.quick-actions-section {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  border-radius: 20px;
  padding: var(--component-padding-md);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all var(--transition-smooth);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.7s ease-out 0.4s both;
}

body.active .quick-actions-section {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.actions-row {
  display: flex;
  gap: var(--element-gap-md);
  justify-content: center;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--element-gap-sm);
  padding: var(--component-padding-sm);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-smooth);
  min-width: 80px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.active .quick-action {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.quick-action:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}

body.active .quick-action:hover {
  background: rgba(0, 0, 0, 0.3);
}

.quick-action i {
  font-size: 1.5rem;
  color: var(--accent-gold);
  transition: color var(--transition-smooth);
}

.quick-action span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: color var(--transition-smooth);
}

/* Modal Catálogo */
.catalog-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.catalog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.catalog-content {
  position: relative;
  background: var(--bg-primary);
  border-radius: 24px;
  max-width: 800px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-primary);
  transition: all var(--transition-smooth);
}

body.active .catalog-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(135deg, 
    var(--primary-blue-subtle) 0%, 
    var(--accent-gold-subtle) 50%, 
    var(--info-subtle) 100%);
  color: var(--text-primary);
}

.catalog-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.catalog-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background var(--transition-smooth);
}

.catalog-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.catalog-books {
  padding: 2rem;
  max-height: 60vh;
  overflow-y: auto;
  display: grid;
  gap: 1.5rem;
}

.catalog-book-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  border: 2px solid transparent;
}

body.active .catalog-book-card {
  background: var(--bg-tertiary);
}

.catalog-book-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

body.active .catalog-book-card:hover {
  background: var(--gray-700);
  border-color: var(--accent-gold);
}

.catalog-book-cover {
  width: 80px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

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

.catalog-book-info {
  flex: 1;
}

.catalog-book-info h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  transition: color var(--transition-smooth);
}

.catalog-author {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  transition: color var(--transition-smooth);
}

.catalog-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  transition: color var(--transition-smooth);
}

.catalog-stats {
  display: flex;
  gap: 1rem;
}

.catalog-chapters {
  background: var(--bg-tertiary);
  color: var(--primary-blue);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-smooth);
}

body.active .catalog-chapters {
  background: var(--gray-700);
  color: var(--primary-blue-light);
}

.catalog-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-smooth);
}

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

.catalog-difficulty.intermediate {
  background: var(--warning-subtle);
  color: var(--warning);
}

/* Catalog Tags */
.catalog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.catalog-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-smooth);
}

.catalog-tag.adventure {
  background: var(--info-subtle);
  color: var(--info);
}

.catalog-tag.classic {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
}

.catalog-tag.philosophy {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
}

.catalog-tag.romance {
  background: var(--error-subtle);
  color: var(--error);
}

.catalog-tag.society {
  background: var(--success-subtle);
  color: var(--success);
}

/* Dark mode for catalog tags */
body.active .catalog-tag.adventure {
  background: rgba(59, 130, 246, 0.2);
  color: var(--info-light);
}

body.active .catalog-tag.classic {
  background: rgba(37, 99, 235, 0.2);
  color: var(--primary-blue-light);
}

body.active .catalog-tag.philosophy {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold-light);
}

body.active .catalog-tag.romance {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error-light);
}

body.active .catalog-tag.society {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success-light);
}

/* Center catalog stats and access status on large screens */
@media (min-width: 769px) {
  .catalog-stats {
    justify-content: center;
  }
  
  .access-status {
    text-align: center;
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .user-dashboard {
    padding-top: 100px;
  }
}

@media (max-width: 768px) {
  .user-dashboard {
    padding: 1rem;
    padding-top: 90px;
    padding-bottom: 1rem;
  }

  .dashboard-container {
    gap: var(--section-gap-sm);
  }

  .dashboard-header {
    flex-direction: column;
    gap: var(--element-gap-lg);
    text-align: center;
    padding: var(--component-padding-md);
  }

  .user-greeting {
    flex-direction: column;
    gap: var(--element-gap-md);
    text-align: center;
  }

  .user-avatar {
    font-size: 3rem;
  }

  .greeting-title {
    font-size: 1.8rem;
  }

  .greeting-subtitle {
    font-size: 1rem;
  }

  .dashboard-stats {
    justify-content: center;
    gap: var(--element-gap-md);
  }

  .stat-item {
    min-width: 80px;
    padding: var(--component-padding-sm);
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--element-gap-md);
    text-align: center;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .library-section {
    padding: var(--component-padding-md);
  }

  .library-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--element-gap-sm);
  }

  .library-book-card {
    padding: var(--component-padding-sm);
    height: 380px;
  }

  .library-book-cover {
    width: 120px;
    height: 160px;
  }

  .library-book-details h4 {
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.85rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .continue-reading-card {
    padding: 1rem;
  }

  .continue-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .book-thumbnail-small {
    width: 40px;
    height: 60px;
  }

  .continue-details h3 {
    font-size: 1.1rem;
  }

  .continue-reading-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .quick-actions-section {
    padding: var(--component-padding-sm);
  }

  .actions-row {
    gap: var(--element-gap-sm);
  }

  .quick-action {
    padding: var(--component-padding-sm);
    min-width: 70px;
  }

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

  .quick-action span {
    font-size: 0.8rem;
  }

  /* Modal responsive */
  .catalog-modal {
    padding: 0.5rem;
  }

  .catalog-content {
    max-height: 95vh;
    margin: 0;
    border-radius: 16px;
  }

  .catalog-header {
    padding: 1.5rem;
  }

  .catalog-header h2 {
    font-size: 1.5rem;
  }

  .catalog-books {
    padding: 1rem;
  }

  .catalog-book-card {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .catalog-book-cover {
    align-self: center;
    width: 60px;
    height: 90px;
  }

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

  .catalog-author {
    font-size: 0.85rem;
  }

  .catalog-description {
    font-size: 0.85rem;
  }

  .catalog-stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .user-dashboard {
    padding: 0.75rem;
    padding-top: 80px;
  }

  .dashboard-header {
    padding: 1rem;
  }

  .greeting-title {
    font-size: 1.6rem;
  }

  .dashboard-stats {
    flex-direction: column;
    gap: var(--element-gap-sm);
  }

  .stat-item {
    width: 100%;
    max-width: 200px;
  }

  .library-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--element-gap-sm);
  }

  .library-book-card {
    height: 360px;
  }

  .library-book-cover {
    width: 100px;
    height: 140px;
  }

  .library-book-details h4 {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.8rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 40px;
    height: 40px;
    font-size: 0.6rem;
  }

  .circular-progress::before {
    width: 28px;
    height: 28px;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .catalog-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* ===== DISPOSITIVOS MUY PEQUEÑOS (iPhone SE, etc.) ===== */
@media (max-width: 375px) {
  .user-dashboard {
    padding: var(--space-sm);
    padding-top: 70px;
  }

  .dashboard-container {
    gap: var(--space-lg);
    padding: 0 var(--space-sm);
  }

  .dashboard-header {
    padding: var(--space-lg);
    gap: var(--space-lg);
  }

  .greeting-title {
    font-size: 1.4rem;
  }

  .greeting-subtitle {
    font-size: 0.9rem;
  }

  .dashboard-stats {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .stat-item {
    padding: var(--space-sm);
    min-width: 60px;
  }

  .stat-number {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .library-section {
    padding: var(--space-lg);
  }

  .library-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .library-book-card {
    height: 320px;
    padding: var(--space-sm);
  }

  .library-book-cover {
    width: 70px;
    height: 100px;
  }

  .library-book-details h4 {
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.75rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 35px;
    height: 35px;
    font-size: 0.5rem;
  }

  .circular-progress::before {
    width: 25px;
    height: 25px;
  }

  .quick-actions-section {
    padding: var(--space-sm);
  }

  .actions-row {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .quick-action {
    padding: var(--space-sm);
    min-width: 60px;
  }

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

  .quick-action span {
    font-size: 0.7rem;
  }

  .catalog-btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9rem;
  }
}

/* ===== SAMSUNG GALAXY S6/S7/S8 Y DISPOSITIVOS PEQUEÑOS ===== */
@media (min-width: 350px) and (max-width: 360px) {
  .user-dashboard {
    padding: var(--space-xs);
    padding-top: 60px;
  }

  .dashboard-container {
    gap: var(--space-md);
    padding: 0 var(--space-xs);
  }

  .dashboard-header {
    padding: var(--space-md);
    gap: var(--space-md);
  }

  .greeting-title {
    font-size: 1.2rem;
  }

  .greeting-subtitle {
    font-size: 0.8rem;
  }

  .dashboard-stats {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .stat-item {
    padding: var(--space-xs);
    min-width: 50px;
  }

  .stat-number {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .library-section {
    padding: var(--space-md);
  }

  .library-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    max-width: 300px;
    margin: var(--element-gap-sm) auto 0;
  }

  .library-book-card {
    width: 100%;
    max-width: 280px;
    height: 300px;
    padding: var(--space-xs);
  }

  .library-book-cover {
    width: 60px;
    height: 90px;
  }

  .library-book-details h4 {
    font-size: 0.85rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.7rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 30px;
    height: 30px;
    font-size: 0.45rem;
  }

  .circular-progress::before {
    width: 20px;
    height: 20px;
  }

  .quick-actions-section {
    padding: var(--space-xs);
  }

  .actions-row {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .quick-action {
    padding: var(--space-xs);
    min-width: 50px;
  }

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

  .quick-action span {
    font-size: 0.65rem;
  }

  .catalog-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
  }
}

/* ===== DISPOSITIVOS MUY PEQUEÑOS (iPhone SE, etc.) ===== */
@media (max-width: 349px) {
  .user-dashboard {
    padding: var(--space-xs);
    padding-top: 60px;
  }

  .dashboard-container {
    gap: var(--space-md);
    padding: 0 var(--space-xs);
  }

  .dashboard-header {
    padding: var(--space-md);
    gap: var(--space-md);
  }

  .greeting-title {
    font-size: 1.2rem;
  }

  .greeting-subtitle {
    font-size: 0.8rem;
  }

  .dashboard-stats {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .stat-item {
    padding: var(--space-xs);
    min-width: 50px;
  }

  .stat-number {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .library-section {
    padding: var(--space-md);
  }

  .library-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  .library-book-card {
    height: 300px;
    padding: var(--space-xs);
  }

  .library-book-cover {
    width: 60px;
    height: 90px;
  }

  .library-book-details h4 {
    font-size: 0.85rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.7rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 30px;
    height: 30px;
    font-size: 0.45rem;
  }

  .circular-progress::before {
    width: 20px;
    height: 20px;
  }

  .quick-actions-section {
    padding: var(--space-xs);
  }

  .actions-row {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .quick-action {
    padding: var(--space-xs);
    min-width: 50px;
  }

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

  .quick-action span {
    font-size: 0.65rem;
  }

  .catalog-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
  }
}

/* ===== SAMSUNG GALAXY S21/S22/S23 SERIES ===== */
@media (min-width: 384px) and (max-width: 409px) {
  .user-dashboard {
    padding: var(--component-padding-md);
    padding-top: 85px;
  }

  .dashboard-container {
    gap: var(--section-gap-sm);
    padding: 0 var(--component-padding-sm);
  }

  .dashboard-header {
    padding: var(--component-padding-md);
    gap: var(--element-gap-lg);
  }

  .greeting-title {
    font-size: 1.7rem;
  }

  .greeting-subtitle {
    font-size: 0.95rem;
  }

  .dashboard-stats {
    gap: var(--element-gap-md);
  }

  .stat-item {
    padding: var(--component-padding-sm);
    min-width: 75px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--element-gap-sm);
    text-align: center;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .library-section {
    padding: var(--component-padding-md);
  }

  .library-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--element-gap-lg);
    max-width: 340px;
    margin: var(--element-gap-sm) auto 0;
  }

  .library-book-card {
    width: 100%;
    max-width: 310px;
    height: 355px;
    padding: var(--component-padding-sm);
  }

  .library-book-cover {
    width: 85px;
    height: 125px;
  }

  .library-book-details h4 {
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.75rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 40px;
    height: 40px;
    font-size: 0.55rem;
  }

  .circular-progress::before {
    width: 28px;
    height: 28px;
  }

  .quick-actions-section {
    padding: var(--component-padding-sm);
  }

  .actions-row {
    gap: var(--element-gap-sm);
    justify-content: center;
  }

  .quick-action {
    padding: var(--component-padding-sm);
    min-width: 75px;
  }

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

  .quick-action span {
    font-size: 0.75rem;
  }

  .catalog-btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.85rem;
  }
}

/* ===== DISPOSITIVOS MEDIANOS (Samsung Galaxy S8, iPhone 12 mini, etc.) ===== */
@media (min-width: 361px) and (max-width: 414px) {
  .user-dashboard {
    padding: var(--space-sm);
    padding-top: 80px;
  }

  .dashboard-container {
    gap: var(--space-lg);
    padding: 0 var(--space-sm);
  }

  .dashboard-header {
    padding: var(--space-lg);
    gap: var(--space-lg);
  }

  .greeting-title {
    font-size: 1.6rem;
  }

  .greeting-subtitle {
    font-size: 0.9rem;
  }

  .dashboard-stats {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .stat-item {
    padding: var(--space-sm);
    min-width: 70px;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .library-section {
    padding: var(--space-lg);
  }

  .library-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    max-width: 320px;
    margin: var(--element-gap-sm) auto 0;
  }

  .library-book-card {
    width: 100%;
    max-width: 300px;
    height: 340px;
    padding: var(--space-sm);
  }

  .library-book-cover {
    width: 80px;
    height: 120px;
  }

  .library-book-details h4 {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.8rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 40px;
    height: 40px;
    font-size: 0.6rem;
  }

  .circular-progress::before {
    width: 28px;
    height: 28px;
  }

  .quick-actions-section {
    padding: var(--space-sm);
  }

  .actions-row {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .quick-action {
    padding: var(--space-sm);
    min-width: 70px;
  }

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

  .quick-action span {
    font-size: 0.75rem;
  }

  .catalog-btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9rem;
  }
}

/* ===== SAMSUNG GALAXY S20 ULTRA Y SIMILARES ===== */
@media (min-width: 410px) and (max-width: 420px) {
  .user-dashboard {
    padding: var(--component-padding-md);
    padding-top: 90px;
  }

  .dashboard-container {
    gap: var(--section-gap-sm);
    padding: 0 var(--component-padding-sm);
  }

  .dashboard-header {
    padding: var(--component-padding-md);
    gap: var(--element-gap-lg);
  }

  .greeting-title {
    font-size: 1.8rem;
  }

  .greeting-subtitle {
    font-size: 1rem;
  }

  .dashboard-stats {
    gap: var(--element-gap-md);
  }

  .stat-item {
    padding: var(--component-padding-sm);
    min-width: 80px;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.85rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--element-gap-sm);
    text-align: center;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .library-section {
    padding: var(--component-padding-md);
  }

  .library-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--element-gap-lg);
    max-width: 360px;
    margin: var(--element-gap-sm) auto 0;
  }

  .library-book-card {
    width: 100%;
    max-width: 330px;
    height: 365px;
    padding: var(--component-padding-sm);
  }

  .library-book-cover {
    width: 95px;
    height: 135px;
  }

  .library-book-details h4 {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.8rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 43px;
    height: 43px;
    font-size: 0.6rem;
  }

  .circular-progress::before {
    width: 31px;
    height: 31px;
  }

  .quick-actions-section {
    padding: var(--component-padding-sm);
  }

  .actions-row {
    gap: var(--element-gap-sm);
    justify-content: center;
  }

  .quick-action {
    padding: var(--component-padding-sm);
    min-width: 80px;
  }

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

  .quick-action span {
    font-size: 0.8rem;
  }

  .catalog-btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9rem;
  }
}

/* ===== DISPOSITIVOS GRANDES (iPhone XR, iPhone 11, etc.) ===== */
@media (min-width: 415px) and (max-width: 480px) {
  .user-dashboard {
    padding: var(--component-padding-md);
    padding-top: 90px;
  }

  .dashboard-container {
    gap: var(--section-gap-sm);
    padding: 0 var(--component-padding-sm);
  }

  .dashboard-header {
    padding: var(--component-padding-md);
    gap: var(--element-gap-lg);
  }

  .greeting-title {
    font-size: 1.8rem;
  }

  .greeting-subtitle {
    font-size: 1rem;
  }

  .dashboard-stats {
    gap: var(--element-gap-md);
  }

  .stat-item {
    padding: var(--component-padding-sm);
    min-width: 80px;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.85rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--element-gap-sm);
    text-align: center;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .library-section {
    padding: var(--component-padding-md);
  }

  .library-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--element-gap-lg);
    max-width: 350px;
    margin: var(--element-gap-sm) auto 0;
  }

  .library-book-card {
    width: 100%;
    max-width: 320px;
    height: 360px;
    padding: var(--component-padding-sm);
  }

  .library-book-cover {
    width: 90px;
    height: 130px;
  }

  .library-book-details h4 {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.8rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 42px;
    height: 42px;
    font-size: 0.6rem;
  }

  .circular-progress::before {
    width: 30px;
    height: 30px;
  }

  .quick-actions-section {
    padding: var(--component-padding-sm);
  }

  .actions-row {
    gap: var(--element-gap-sm);
    justify-content: center;
  }

  .quick-action {
    padding: var(--component-padding-sm);
    min-width: 80px;
  }

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

  .quick-action span {
    font-size: 0.8rem;
  }

  .catalog-btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9rem;
  }
}

/* ===== TABLETS PEQUEÑAS (iPad mini, etc.) ===== */
@media (min-width: 481px) and (max-width: 768px) {
  .user-dashboard {
    padding: var(--component-padding-md);
    padding-top: 100px;
  }

  .dashboard-container {
    gap: var(--section-gap-sm);
    padding: 0 var(--component-padding-sm);
  }

  .dashboard-header {
    padding: var(--component-padding-md);
    gap: var(--element-gap-lg);
  }

  .greeting-title {
    font-size: 2rem;
  }

  .greeting-subtitle {
    font-size: 1rem;
  }

  .dashboard-stats {
    gap: var(--element-gap-md);
  }

  .stat-item {
    padding: var(--component-padding-sm);
    min-width: 80px;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .stat-label {
    font-size: 0.85rem;
  }

  .section-header {
    flex-direction: column;
    gap: var(--element-gap-sm);
    text-align: center;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .library-section {
    padding: var(--component-padding-md);
  }

  .library-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--element-gap-sm);
  }

  .library-book-card {
    height: 420px;
    padding: var(--component-padding-sm);
  }

  .library-book-cover {
    width: 100px;
    height: 140px;
  }

  .library-book-details h4 {
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.85rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 45px;
    height: 45px;
    font-size: 0.65rem;
  }

  .circular-progress::before {
    width: 32px;
    height: 32px;
  }

  .quick-actions-section {
    padding: var(--component-padding-sm);
  }

  .actions-row {
    gap: var(--element-gap-sm);
    justify-content: center;
  }

  .quick-action {
    padding: var(--component-padding-sm);
    min-width: 80px;
  }

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

  .quick-action span {
    font-size: 0.8rem;
  }

  .catalog-btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.95rem;
  }
}

/* ===== TABLETS GRANDES (iPad, iPad Air, etc.) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .user-dashboard {
    padding: var(--component-padding-lg);
    padding-top: 110px;
  }

  .dashboard-container {
    gap: var(--section-gap-md);
    padding: 0 var(--component-padding-md);
  }

  .dashboard-header {
    padding: var(--component-padding-lg);
    gap: var(--element-gap-xl);
  }

  .greeting-title {
    font-size: 2.4rem;
  }

  .greeting-subtitle {
    font-size: 1.1rem;
  }

  .dashboard-stats {
    gap: var(--element-gap-lg);
  }

  .stat-item {
    padding: var(--component-padding-sm);
    min-width: 90px;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  .stat-label {
    font-size: 0.9rem;
  }

  .section-header {
    flex-direction: row;
    gap: var(--element-gap-md);
    text-align: left;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .library-section {
    padding: var(--component-padding-lg);
  }

  .library-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--element-gap-md);
  }

  .library-book-card {
    height: 450px;
    padding: var(--component-padding-md);
  }

  .library-book-cover {
    width: 120px;
    height: 160px;
  }

  .library-book-details h4 {
    font-size: 1.05rem;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .library-book-details p {
    font-size: 0.9rem;
    margin-top: -0.2rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .circular-progress {
    width: 50px;
    height: 50px;
    font-size: 0.7rem;
  }

  .circular-progress::before {
    width: 35px;
    height: 35px;
  }

  .quick-actions-section {
    padding: var(--component-padding-md);
  }

  .actions-row {
    gap: var(--element-gap-md);
    justify-content: center;
  }

  .quick-action {
    padding: var(--component-padding-sm);
    min-width: 90px;
  }

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

  .quick-action span {
    font-size: 0.85rem;
  }

  .catalog-btn {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
  }
}

/* Mobile optimizations for library book cards */
@media (max-width: 768px) {
  .library-book-card {
    padding: 1.5rem;
    height: auto;
    min-height: 420px;
  }

  .library-book-cover {
    width: 140px;
    height: 180px;
    margin: 0 auto 1.25rem;
  }

  .library-book-cover img {
    /* Mobile image optimization */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Reduce file size for mobile */
    filter: contrast(1.05) brightness(1.02);
  }

  .library-book-details h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }

  .library-book-details p {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }

  .reading-position {
    font-size: 0.85rem !important;
    margin-bottom: 0.75rem !important;
  }

  .book-action {
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    min-height: 3.5rem; /* 56px - well above 44px requirement */
    margin-top: 0.5rem;
    /* Enhanced touch target for mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }

  .progress-overlay {
    width: 50px;
    height: 50px;
    top: -6px;
    right: -6px;
  }

  .circular-progress {
    width: 50px;
    height: 50px;
    font-size: 0.75rem;
  }

  .circular-progress::before {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  .library-book-card {
    padding: 1.25rem;
    min-height: 380px;
  }

  .library-book-cover {
    width: 120px;
    height: 160px;
    margin: 0 auto 1rem;
  }

  .library-book-cover img {
    /* Small mobile image optimization */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Enhanced optimization for small screens */
    filter: contrast(1.08) brightness(1.03);
  }

  .library-book-details h4 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
  }

  .library-book-details p {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
  }

  .reading-position {
    font-size: 0.8rem !important;
    margin-bottom: 0.6rem !important;
  }

  .book-action {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 3rem; /* 48px - exceeds 44px requirement */
    margin-top: 0.4rem;
    /* Enhanced touch target for small mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }

  .progress-overlay {
    width: 45px;
    height: 45px;
    top: -5px;
    right: -5px;
  }

  .circular-progress {
    width: 45px;
    height: 45px;
    font-size: 0.7rem;
  }

  .circular-progress::before {
    width: 28px;
    height: 28px;
  }
}


