/* Efectos glassmorphism y nebulosa */ 
/* Archivo creado automáticamente */ 
/* Hijos de Caos - Efectos glassmorphism y nebulosa */

/* Fondo nebulosa animado */
.nebula-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(74, 144, 226, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(255, 140, 0, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 30%, rgba(30, 144, 255, 0.12) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
  animation: nebulaFloat 20s ease-in-out infinite;
}

@keyframes nebulaFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    filter: hue-rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(1deg);
    filter: hue-rotate(90deg);
  }
  50% {
    transform: translateY(-5px) rotate(-1deg);
    filter: hue-rotate(180deg);
  }
  75% {
    transform: translateY(-15px) rotate(0.5deg);
    filter: hue-rotate(270deg);
  }
}

/* Partículas flotantes */
.nebula-background::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(74, 144, 226, 0.4), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 140, 0, 0.3), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(138, 43, 226, 0.3), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.2), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: sparkles 15s linear infinite;
}

@keyframes sparkles {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-100px); }
}

/* Efectos glassmorphism mejorados */
.glass-effect {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-effect-strong {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Modal con efectos */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  max-width: 90vw;
  max-height: 80vh;
  width: 600px;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.modal:not(.hidden) .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e8e8e8;
  margin: 0;
}

.modal-body {
  padding: 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* Botón de profundización flotante */
.deepen-btn {
  position: absolute;
  background: linear-gradient(135deg, #4a90e2, #5ba0f2);
  border: none;
  border-radius: 25px;
  padding: 0.75rem 1.5rem;
  color: white;
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 
    0 8px 25px rgba(74, 144, 226, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}

.deepen-btn:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.deepen-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 
    0 12px 35px rgba(74, 144, 226, 0.4),
    0 6px 15px rgba(0, 0, 0, 0.3);
}

.deepen-btn:active {
  transform: scale(0.98);
}

.deepen-btn .icon {
  font-size: 1rem;
}

/* Efectos de texto seleccionado */
.selected-text {
  background: rgba(74, 144, 226, 0.1);
  border-left: 4px solid #4a90e2;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.selected-text h4 {
  color: #4a90e2;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.selected-text blockquote {
  margin: 0;
  font-style: italic;
  color: #b8b8b8;
  line-height: 1.6;
}

/* Respuesta de IA */
.ai-response h4 {
  color: #27ae60;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-content {
  background: rgba(39, 174, 96, 0.05);
  border: 1px solid rgba(39, 174, 96, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  line-height: 1.7;
}

.ai-content p {
  margin-bottom: 1rem;
  color: #e8e8e8;
}

.ai-content p:last-child {
  margin-bottom: 0;
}

/* Spinner de carga */
.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #b8b8b8;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #4a90e2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Controles de traducción */
.translate-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.translate-controls label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #b8b8b8;
  white-space: nowrap;
}

.translate-controls select {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e8e8e8;
  font-family: var(--font-secondary, 'Inter', sans-serif);
}

.translate-controls select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #4a90e2, #5ba0f2);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: white;
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Resultado de traducción */
.translation-result {
  background: rgba(255, 140, 0, 0.05);
  border: 1px solid rgba(255, 140, 0, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.translation-result h4 {
  color: #ff8c00;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   ESTILOS PARA CONFIGURACIONES DE LECTURA
   ======================================== */

/* Panel de configuraciones */
.reading-settings-panel {
  position: fixed;
  top: 80px;
  right: -350px;
  width: 320px;
  height: calc(100vh - 80px);
  z-index: 1500;
  transition: right 0.3s ease;
  backdrop-filter: blur(10px);
}

.reading-settings-panel:not(.hidden) {
  right: 0;
}

.settings-content {
  padding: 1.5rem;
  height: 100%;
  overflow-y: auto;
}

.settings-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e8e8e8;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.setting-group {
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.3s ease forwards;
}

.setting-group:nth-child(2) { animation-delay: 0.1s; }
.setting-group:nth-child(3) { animation-delay: 0.2s; }
.setting-group:nth-child(4) { animation-delay: 0.3s; }
.setting-group:nth-child(5) { animation-delay: 0.4s; }
.setting-group:nth-child(6) { animation-delay: 0.5s; }

.setting-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #b8b8b8;
  margin-bottom: 0.5rem;
}

/* Controles de tamaño de fuente */
.font-size-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.font-size-controls button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e8e8e8;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-size-controls button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
  border-color: #4a90e2;
}

.font-size-controls button:active {
  transform: scale(0.95);
}

#font-size-display {
  font-weight: 600;
  color: #4a90e2;
  min-width: 50px;
  text-align: center;
  font-size: 0.9rem;
}

/* Selects personalizados */
.setting-group select {
  width: 100%;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: #e8e8e8;
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.setting-group select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.setting-group select:hover {
  border-color: #4a90e2;
}

/* Toggle para modo nocturno */
.toggle-btn {
  position: relative;
  width: 60px;
  height: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  padding: 2px;
}

.toggle-btn::before {
  content: '';
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.toggle-btn.active {
  background: #4a90e2;
  border-color: #4a90e2;
}

.toggle-btn.active::before {
  transform: translateX(30px);
}

.toggle-btn:hover {
  border-color: #4a90e2;
}

/* Botón secundario */
.btn-secondary {
  width: 100%;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: #e8e8e8;
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  border-color: #4a90e2;
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Botón de configuraciones en el header */
.settings-btn {
  position: relative;
}

.settings-btn.active {
  background: #4a90e2;
  color: white;
  border-color: #4a90e2;
}

/* Overlay para cerrar configuraciones */
.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1400;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.settings-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

/* Modo nocturno - variables modificadas */
body.night-mode {
  --color-bg: #000000;
  --color-bg-secondary: #0a0a0a;
  --color-text: #ffffff;
  --color-text-secondary: #cccccc;
  --color-text-muted: #999999;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
}

body.night-mode .nebula-background {
  filter: brightness(0.3) contrast(1.2);
}

body.night-mode .modal-content {
  background: rgba(5, 5, 5, 0.98);
}

/* Toast para notificaciones */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: #e8e8e8;
  font-family: var(--font-secondary, 'Inter', sans-serif);
  font-size: 0.875rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 300px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid #27ae60;
}

.toast-info {
  border-left: 4px solid #4a90e2;
}

.toast-error {
  border-left: 4px solid #e74c3c;
}

/* Animaciones de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.animate-fade-in-scale {
  animation: fadeInScale 0.3s ease forwards;
}

/* Hover effects para elementos interactivos */
.interactive-hover {
  transition: all 0.3s ease;
}

.interactive-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Efecto de brillo para elementos especiales */
.glow-effect {
  position: relative;
  overflow: hidden;
}

.glow-effect::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.5s ease;
  opacity: 0;
}

.glow-effect:hover::before {
  animation: shine 0.8s ease-in-out;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
    opacity: 0;
  }
}

/* Responsive para efectos */
@media (max-width: 768px) {
  .modal-content {
    width: 95vw;
    margin: 1rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-header {
    padding: 1rem 1.5rem;
  }
  
  .deepen-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
  
  .nebula-background::before {
    background-size: 150px 75px;
  }
  
  .reading-settings-panel {
    width: 100%;
    right: -100%;
  }
  
  .font-size-controls button {
    width: 35px;
    height: 35px;
  }
  
  .toggle-btn {
    width: 50px;
    height: 25px;
  }
  
  .toggle-btn::before {
    width: 20px;
    height: 20px;
  }
  
  .toggle-btn.active::before {
    transform: translateX(25px);
  }
}

/* Efectos de performance optimizados */
@media (prefers-reduced-motion: reduce) {
  .nebula-background,
  .nebula-background::before,
  .spinner,
  .flame-icon {
    animation: none;
  }
  
  * {
    transition-duration: 0.01ms !important;
  }
}