/* collie-speech-bubble.css - Styling for the collie mascot speech bubbles */

:root {
  --bubble-bg: #ffffff;
  --bubble-text: #333333;
  --bubble-border: #d1d5db;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bubble-bg: #3a4a5a;
    --bubble-text: #e0e0e0;
    --bubble-border: #4a5a6a;
  }
}

/* Base speech bubble styles */
.collie-speech-bubble {
  position: absolute;
  background: var(--bubble-bg);
  color: var(--bubble-text);
  border: 1px solid var(--bubble-border);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.85em;
  line-height: 1.4;
  max-width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: none;
  pointer-events: none;
  z-index: 100;
}

.collie-speech-bubble.visible {
  animation: bubbleAppear 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             bubbleBounce 2s ease-in-out 400ms infinite;
  pointer-events: auto;
}

.collie-speech-bubble.exiting {
  animation: bubbleExit 250ms ease-in forwards;
}

/* Bubble content */
.bubble-content {
  position: relative;
  z-index: 1;
}

/* Bubble types - different colors for different message types */
.bubble-approval {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  color: #78350f;
}

.bubble-approval.visible {
  animation: bubbleAppear 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             pulse-bubble 2s ease-in-out infinite;
}

.bubble-completion {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #10b981;
  color: #065f46;
}

.bubble-hint {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  color: #1e3a8a;
}

/* Dark mode overrides for bubble types */
@media (prefers-color-scheme: dark) {
  .bubble-approval {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-color: #f59e0b;
    color: #fef3c7;
  }

  .bubble-completion {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    border-color: #10b981;
    color: #d1fae5;
  }

  .bubble-hint {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-color: #3b82f6;
    color: #dbeafe;
  }
}

/* Bubble tail (pointing to collie) */
.bubble-tail {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--bubble-bg);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

/* Type-specific tails */
.bubble-approval .bubble-tail {
  border-top-color: #fde68a;
}

.bubble-completion .bubble-tail {
  border-top-color: #a7f3d0;
}

.bubble-hint .bubble-tail {
  border-top-color: #bfdbfe;
}

@media (prefers-color-scheme: dark) {
  .bubble-approval .bubble-tail {
    border-top-color: #92400e;
  }

  .bubble-completion .bubble-tail {
    border-top-color: #047857;
  }

  .bubble-hint .bubble-tail {
    border-top-color: #1e40af;
  }
}

/* Dismiss button */
.bubble-dismiss {
  position: absolute;
  top: 4px;
  right: 4px;
  background: transparent;
  border: none;
  font-size: 1.2em;
  color: currentColor;
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  line-height: 1;
  transition: opacity 150ms;
  z-index: 2;
}

.bubble-dismiss:hover {
  opacity: 1;
}

/* Animations */
@keyframes bubbleAppear {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  50% {
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bubbleExit {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(-5px);
  }
}

@keyframes bubbleBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes pulse-bubble {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .collie-speech-bubble,
  .collie-speech-bubble.visible,
  .collie-speech-bubble.exiting {
    animation: none;
    transition: opacity 200ms ease;
  }

  .collie-speech-bubble.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .collie-speech-bubble.exiting {
    opacity: 0;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .collie-speech-bubble {
    max-width: 220px;
    font-size: 0.8em;
    padding: 6px 10px;
  }

  .bubble-dismiss {
    width: 18px;
    height: 18px;
    font-size: 1.1em;
  }
}
