/* Estilos personalizados para el Test de Liderazgo Transformacional */

/* Colores de marca */
:root {
  --brand-background: #E5E5E5;
  --brand-foreground: #172a49;
  --brand-accent1: #54164C;
  --brand-accent2: #920E50;
  --brand-accent3: #D00054;
}

/* Gradiente principal */
.gradient-bg {
  background: linear-gradient(135deg, var(--brand-foreground) 0%, var(--brand-accent1) 50%, var(--brand-accent2) 100%);
}

/* Animaciones personalizadas */
.animate-bounce-slow {
  animation: bounce 2s infinite;
}

.typing-indicator {
  animation: typing 1.5s infinite;
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.4; }
  30% { opacity: 1; }
}

.chat-bubble-enter {
  animation: slideInUp 0.3s ease-out;
}

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

/* Barra de progreso */
.progress-bar {
  transition: width 0.3s ease-in-out;
}

/* Botones con efecto scale */
.scale-button {
  transition: all 0.2s ease-in-out;
}

.scale-button:hover {
  transform: scale(1.05);
}

.scale-button.selected {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(84, 22, 76, 0.3);
}

/* Efectos de hover para cards */
.card-hover {
  transition: all 0.3s ease-in-out;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Estilo para iconos animados */
.icon-bounce {
  animation: iconBounce 2s infinite;
}

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

/* Efectos de focus personalizados */
input:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(84, 22, 76, 0.1);
  border-color: var(--brand-accent1);
}

/* Scrollbar personalizado para el chat */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--brand-accent1), var(--brand-accent2));
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, var(--brand-accent2), var(--brand-accent3));
}

/* Efectos de loading */
.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

/* Responsive design mejorado para móviles */
@media (max-width: 768px) {
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Tipografía más grande y legible en móvil */
  .text-4xl {
    font-size: 2rem !important;
    line-height: 2.5rem !important;
    font-weight: 800;
  }
  
  .text-3xl {
    font-size: 1.75rem !important;
    line-height: 2.25rem !important;
    font-weight: 700;
  }
  
  .text-2xl {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
    font-weight: 600;
  }
  
  .text-xl {
    font-size: 1.25rem !important;
    line-height: 1.75rem !important;
  }
  
  .text-lg {
    font-size: 1.125rem !important;
    line-height: 1.625rem !important;
  }
  
  .text-base {
    font-size: 1rem !important;
    line-height: 1.5rem !important;
  }
  
  .text-sm {
    font-size: 0.9rem !important;
    line-height: 1.375rem !important;
  }
  
  /* Chat optimizado para móvil */
  #chat-messages {
    max-height: 350px !important;
    min-height: 250px !important;
    font-size: 1rem !important;
  }
  
  /* Mensajes del chat más legibles */
  .chat-bubble-enter p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }
  
  /* Botones touch-friendly */
  button {
    min-height: 48px !important;
    font-size: 1rem !important;
    padding: 12px 20px !important;
    font-weight: 600;
  }
  
  input {
    min-height: 48px !important;
    font-size: 1rem !important;
    padding: 12px 16px !important;
  }
  
  /* Spacing móvil */
  .space-y-4 > * + * {
    margin-top: 1rem;
  }
  
  .space-y-6 > * + * {
    margin-top: 1.5rem;
  }
  
  .space-y-8 > * + * {
    margin-top: 2rem;
  }
  
  /* Padding móvil */
  .p-8 {
    padding: 1.25rem !important;
  }
  
  .p-6 {
    padding: 1rem !important;
  }
  
  .p-4 {
    padding: 0.875rem !important;
  }
  
  /* Grid móvil */
  .grid-cols-3 {
    grid-template-columns: repeat(1, 1fr) !important;
    gap: 1.5rem !important;
  }
  
  .grid-cols-5 {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  /* Márgenes móvil */
  .mb-8 {
    margin-bottom: 1.5rem !important;
  }
  
  .mb-6 {
    margin-bottom: 1rem !important;
  }
  
  .mb-4 {
    margin-bottom: 0.75rem !important;
  }
}

/* Para pantallas muy pequeñas (menos de 480px) */
@media (max-width: 480px) {
  .container {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  
  .text-4xl {
    font-size: 1.75rem !important;
    line-height: 2.25rem !important;
  }
  
  .text-3xl {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
  }
  
  .p-8 {
    padding: 1rem !important;
  }
  
  .p-6 {
    padding: 0.75rem !important;
  }
  
  #chat-messages {
    max-height: 320px !important;
  }
  
  /* Hacer botones aún más grandes en pantallas muy pequeñas */
  button {
    min-height: 52px !important;
    width: 100% !important;
  }
  
  /* Grid responsive extremo */
  .grid-cols-5 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
  }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
  .text-3xl {
    font-size: 1.375rem;
  }
  
  .grid-cols-5 {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
  }
  
  #chat-messages {
    max-height: 250px !important;
  }
}

/* Estilos para resultados */
.result-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 4px solid var(--brand-accent2);
}

.dimension-score {
  background: linear-gradient(90deg, var(--brand-accent1) 0%, var(--brand-accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
}

/* Animación para elementos que aparecen */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

/* Estilo para badges de nivel */
.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.level-high {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.level-process {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.level-transactional {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

/* Efectos especiales para botones de acción */
.action-button {
  background: linear-gradient(135deg, var(--brand-accent1) 0%, var(--brand-accent2) 100%);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.action-button:hover::before {
  left: 100%;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(84, 22, 76, 0.4);
}

/* Loader personalizado */
.custom-loader {
  width: 40px;
  height: 40px;
  border: 4px solid var(--brand-background);
  border-top: 4px solid var(--brand-accent2);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* === SISTEMA DE PANTALLAS === */

/* Estilos base para todas las pantallas */
.screen {
  display: block;
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s ease-in-out;
  min-height: 100vh;
}

/* Pantalla oculta */
.screen.hidden {
  display: none !important;
}

/* Animaciones de transición entre pantallas */
.screen.fade-out {
  opacity: 0;
  transform: translateX(-50px);
}

.screen.fade-in {
  opacity: 1;
  transform: translateX(0);
  animation: screenFadeIn 0.4s ease-out;
}

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

/* Botones de navegación entre pantallas */
.nav-button {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.nav-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Indicador de progreso visual */
.step-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 8px 16px;
  z-index: 1000;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-foreground);
  border: 1px solid rgba(84, 22, 76, 0.2);
}

/* Estilos específicos para móvil */
@media (max-width: 768px) {
  .step-indicator {
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 6px 12px;
  }
  
  /* Asegurar que las pantallas ocupen toda la altura en móvil */
  .screen {
    min-height: 100vh;
    padding-bottom: 2rem;
  }
  
  /* Hacer los botones de navegación más grandes en móvil */
  .nav-button {
    min-height: 52px !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
  }
  
  /* Spacing vertical mejorado */
  .screen > div > div {
    margin-bottom: 1.5rem;
  }
  
  /* Headers más compactos en pantallas 2 y 3 */
  #screen-explanation .text-center,
  #screen-chat .text-center {
    margin-bottom: 1rem !important;
  }
}

@media (max-width: 480px) {
  .screen {
    padding-bottom: 3rem;
  }
  
  .nav-button {
    min-height: 56px !important;
    font-size: 1.25rem !important;
  }
}