/* Custom CSS Styles for Bioconstrucción Intake Copilot */

/* Custom Smooth Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.3);
  border-radius: 9999px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(75, 85, 99, 0.4);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(16, 185, 129, 0.5);
}

/* Pulse Highlight Animation for target card */
@keyframes cardPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    border-color: #059669;
  }
  50% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    border-color: #10b981;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.pulse-glow {
  animation: cardPulseGlow 1.4s cubic-bezier(0.24, 0, 0.38, 1);
}

/* Trailing Rainbow Border Animation for Agent-focused Cards (Fades after 3 seconds) */
@property --trail-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotateTrailAngle {
  0% {
    --trail-angle: 0deg;
  }
  100% {
    --trail-angle: 360deg;
  }
}

@keyframes fadeOutRainbowBorder {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.rainbow-glow {
  position: relative !important;
  border-color: transparent !important;
  z-index: 10;
}

/* Sharp 2.5px Rainbow Trail along the exact border edge */
.rainbow-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2.5px;
  background: conic-gradient(
    from var(--trail-angle, 0deg),
    transparent 0deg,
    transparent 160deg,
    #ef4444 200deg,
    #f97316 230deg,
    #eab308 260deg,
    #10b981 300deg,
    #06b6d4 335deg,
    #8b5cf6 360deg
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: rotateTrailAngle 1.6s linear infinite, fadeOutRainbowBorder 3s ease-in-out forwards !important;
  z-index: 2;
}

/* Subtle glow halo tightly hugging the outer border */
.rainbow-glow::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 3px;
  background: conic-gradient(
    from var(--trail-angle, 0deg),
    transparent 0deg,
    transparent 180deg,
    rgba(239, 68, 68, 0.45) 220deg,
    rgba(234, 179, 8, 0.45) 270deg,
    rgba(16, 185, 129, 0.45) 310deg,
    rgba(6, 182, 212, 0.45) 345deg,
    rgba(139, 92, 246, 0.45) 360deg
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  filter: blur(4px);
  pointer-events: none;
  animation: rotateTrailAngle 1.6s linear infinite, fadeOutRainbowBorder 3s ease-in-out forwards !important;
  z-index: 1;
}




/* Chat Markdown Formatting */
.chat-content strong {
  font-weight: 600;
  color: inherit;
}

.chat-content h4 {
  font-weight: 700;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.chat-content h5 {
  font-weight: 600;
  margin-top: 0.375rem;
  margin-bottom: 0.125rem;
}

.chat-content ul, .chat-content ol {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  padding-left: 1rem;
}

.chat-content li {
  margin-top: 0.125rem;
  margin-bottom: 0.125rem;
}
