/* AI Thought Bubble Component Styles */
/* Simple, subtle one-line text label that appears to the right of the header */

/* Container for both AI thinking banner and thought bubble */
#ai-thought-bubble-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

#ai-thought-bubble {
  position: fixed;
  top: 24px; /* Aligned with header title on desktop */
  right: 20px; /* Position from right side with spacing on desktop */
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-style: italic;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9500; /* Above most UI elements, below modals */
  pointer-events: none; /* Don't block clicks */
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ai-thought-bubble.visible {
  opacity: 1;
  visibility: visible;
}

/* Mobile positioning - top center above arena, out of the way of radial menu */
@media (max-width: 1024px) {
  #ai-thought-bubble {
    top: 10px;
    right: auto;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    max-width: 250px; /* Reasonable width for mobile */
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 16px;
    background: rgba(102, 126, 234, 0.3); /* More opaque for mobile */
    border-width: 2px; /* Thicker border for visibility */
    z-index: 10600; /* Above radial menu and other mobile UI */
    display: block !important;
    text-align: center;
  }
  
  #ai-thought-bubble.visible {
    transform: translateX(-50%);
  }
}

/* Only hide on actual touch devices for very small screens that can't fit it */
@media (max-width: 360px) {
  #ai-thought-bubble {
    font-size: 10px;
    padding: 4px 10px;
    max-width: 150px;
  }
}

/* Safari/WebKit specific fixes for Mac */
@supports (-webkit-appearance: none) {
  #ai-thought-bubble {
    /* Ensure proper rendering on Safari/WebKit */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* Simple fade-in animation */
@keyframes thoughtBubbleFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile fade-in from top */
@media (max-width: 1024px) {
  @keyframes thoughtBubbleFadeIn {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }
}

.ai-thought-bubble.animated-in {
  animation: thoughtBubbleFadeIn 0.4s ease;
}

#ai-thought-bubble.animated-in {
  animation: thoughtBubbleFadeIn 0.4s ease;
}

/* Dark edition compatibility */
.dark-edition #ai-thought-bubble {
  background: rgba(45, 27, 105, 0.2);
  border-color: rgba(102, 126, 234, 0.4);
}

/* Dark edition mobile - slightly more visible */
@media (max-width: 1024px) {
  .dark-edition #ai-thought-bubble {
    background: rgba(45, 27, 105, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
  }
}
