/* Highlight Cursor Styles */

/* Base styles for highlightable areas */
.message-content {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="%23A855F7" stroke-width="2"><path d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"/></svg>') 3 18, text;
}

/* When text is being selected */
.message-content::selection,
.message-content *::selection {
  background-color: rgba(168, 85, 247, 0.3); /* Light purple highlight */
  color: inherit;
}

/* Highlight animation when text is selected */
@keyframes highlightPulse {
  0% { background-color: rgba(168, 85, 247, 0.3); }
  50% { background-color: rgba(168, 85, 247, 0.5); }
  100% { background-color: rgba(168, 85, 247, 0.3); }
}

.message-content.selecting *::selection {
  animation: highlightPulse 2s infinite;
}

/* Highlight menu enhancements */
.highlight-menu {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.2);
  transition: all 0.2s ease;
  transform-origin: top center;
  animation: menuAppear 0.2s ease-out;
}

@keyframes menuAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Arrow indicators for the menu */
.highlight-menu.arrow-top:before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  margin-left: -8px;
  border-bottom: 8px solid rgba(255, 255, 255, 0.95);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.highlight-menu.arrow-bottom:before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  margin-left: -8px;
  border-top: 8px solid rgba(255, 255, 255, 0.95);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

/* Enhanced button styles */
.highlight-btn {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  font-weight: 500;
}

.highlight-btn:hover {
  background-color: rgba(168, 85, 247, 0.1);
}

.highlight-btn:active {
  transform: scale(0.95);
}

/* Highlight effect for existing highlights */
.text-highlight {
  position: relative;
  border-radius: 2px;
  background-color: rgba(168, 85, 247, 0.2);
  transition: background-color 0.2s ease;
}

.text-highlight:hover {
  background-color: rgba(168, 85, 247, 0.4);
}

/* Animated sparkle effect when highlighting is complete */
@keyframes sparkle {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

.highlight-sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: #A855F7;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  animation: sparkle 0.6s ease-out forwards;
}

/* Trailing effect behind cursor while selecting */
.highlight-trail {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: rgba(168, 85, 247, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
