/* TELETOX - Estilos personalizados para complementar Tailwind CSS */

/* Animaciones personalizadas */
@keyframes glow {
  0% {
    opacity: 0.4;
    filter: blur(1px);
  }
  50% {
    opacity: 0.8;
    filter: blur(0px);
  }
  100% {
    opacity: 0.4;
    filter: blur(1px);
  }
}

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

/* Animación rain-fall se maneja dinámicamente en RainEffect.js para mejor control */

/* Partículas de lluvia */
.rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.rain-drop {
  position: absolute;
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0), rgba(59, 130, 246, 0.8));
  border-radius: 0 0 5px 5px;
  opacity: 0.6;
  animation: rain-fall linear infinite;
  will-change: transform, opacity; /* Optimización para GPU */
  backface-visibility: hidden;     /* Evitar flickering */
}

/* Estilos personalizados para checkboxes */
input[type="checkbox"]:checked + div i {
  opacity: 1 !important;
}

input[type="checkbox"]:checked + div {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

/* Estilos para sliders personalizados */
.slider-blue::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  border: 2px solid white;
}

.slider-red::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  border: 2px solid white;
}

.slider-blue::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  border: 2px solid white;
}

.slider-red::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  border: 2px solid white;
}

/* Scrollbar personalizado */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 transparent;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: #4b5563;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: #6b7280;
}

/* Estilos para los logs */
.log {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255,255,255,0.02);
  border-left: 3px solid transparent;
}

.log-debug { 
  color: #9ca3af; 
  border-left-color: #9ca3af;
}

.log-info { 
  color: #d1d5db; 
  border-left-color: #d1d5db;
}

.log-verb { 
  color: #60a5fa; 
  border-left-color: #60a5fa;
}

.log-warn { 
  color: #fbbf24; 
  border-left-color: #fbbf24;
}

.log-error { 
  color: #f87171; 
  border-left-color: #f87171;
}

.log-success { 
  color: #34d399; 
  border-left-color: #34d399;
}

/* Animación para iconos de acordeón */
details[open] summary i.fa-chevron-down {
  transform: rotate(180deg);
}

details summary i.fa-chevron-down {
  transition: transform 0.3s ease;
}

/* Efecto de hover para los acordeones */
details summary:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05)) !important;
}

/* Scrollbar dark siempre visible para evitar saltos */
html {
  overflow-y: scroll; /* Siempre muestra el scrollbar vertical */
  scrollbar-gutter: stable; /* Reserva espacio para el scrollbar (navegadores modernos) */
}

body {
  overflow-x: hidden; /* Previene scrollbar horizontal no deseado */
}

/* Scrollbar personalizado dark para toda la página */
html::-webkit-scrollbar {
  width: 12px;
  background: rgba(0, 0, 0, 0.3);
}

html::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.8); /* Dark gray background */
  border-radius: 6px;
  border: 1px solid rgba(75, 85, 99, 0.3);
}

html::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, 
    rgba(55, 65, 81, 0.9), 
    rgba(75, 85, 99, 0.9)
  ); /* Dark gray gradient */
  border-radius: 6px;
  border: 1px solid rgba(156, 163, 175, 0.2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease-in-out;
}

html::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, 
    rgba(75, 85, 99, 1), 
    rgba(107, 114, 128, 1)
  ); /* Lighter on hover */
  border: 1px solid rgba(156, 163, 175, 0.4);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 
              0 0 4px rgba(59, 130, 246, 0.3),
              0 0 8px rgba(59, 130, 246, 0.1);
  transition: all 0.2s ease-in-out;
}

html::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg, 
    rgba(107, 114, 128, 1), 
    rgba(129, 140, 248, 0.8)
  ); /* Blue accent when clicked */
}

/* Scrollbar dark para Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(75, 85, 99, 0.9) rgba(17, 24, 39, 0.8);
}

/* Mejoras responsive adicionales */
@media (max-width: 640px) {
  .bg-gradient-to-br {
    padding: 1rem !important;
  }
  
  .text-xl {
    font-size: 1.125rem !important;
  }
  
  .space-y-6 > * + * {
    margin-top: 1rem !important;
  }
  
  /* Scrollbar más fino en móvil con diseño dark */
  html::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.2);
  }
  
  html::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(75, 85, 99, 0.2);
  }
  
  html::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
      rgba(55, 65, 81, 0.8), 
      rgba(75, 85, 99, 0.8)
    );
    border: 1px solid rgba(156, 163, 175, 0.1);
  }
}

/* Optimización para pantallas pequeñas */
@media (max-width: 768px) {
  .backdrop-blur-xl {
    backdrop-filter: blur(8px) !important;
  }
  
  /* Ajuste de altura mínima en móvil */
  .h-96 {
    height: 16rem !important;
  }
  
  /* Mejor spacing en móvil */
  .gap-4 {
    gap: 0.75rem !important;
  }
}
