/* ==========================================================================
   Drilo Presence Styles
   Based on Interactive Presence Research specifications
   ========================================================================== */

/* --------------------------------------------------------------------------
   Coach Message Bubble
   -------------------------------------------------------------------------- */
.coach-message {
  max-width: 320px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  font-size: 15px;
  line-height: 1.5;
  border: var(--border);
}

/* Mobile: wider bubbles */
@media (max-width: 576px) {
  .coach-message {
    max-width: 80%;
    font-size: 16px;
  }
}

/* --------------------------------------------------------------------------
   Coach Presence Container
   Avatar + message layout
   -------------------------------------------------------------------------- */
.coach-presence {
  margin-bottom: 1rem;
}

.coach-avatar {
  flex-shrink: 0;
  background-color: var(--color-positive-hover);
}

/* --------------------------------------------------------------------------
   Message Entrance Animation
   -------------------------------------------------------------------------- */
.message-enter {
  opacity: 0;
  transform: translateY(20px);
  animation: messageEnter 300ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes messageEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger delays for multiple elements */
.message-enter-delay-1 { animation-delay: 100ms; }
.message-enter-delay-2 { animation-delay: 200ms; }
.message-enter-delay-3 { animation-delay: 300ms; }

/* --------------------------------------------------------------------------
   Typing Indicator (three bouncing dots)
   -------------------------------------------------------------------------- */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: var(--border);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--color-text-secondary);
  border-radius: var(--radius-md);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Observation Badge (pulsing dot indicator)
   -------------------------------------------------------------------------- */
.coach-observation {
  position: relative;
}

.observation-trigger {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.observation-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--color-positive-hover);
  border-radius: var(--radius-md);
  animation: observationPulse 2s infinite;
}

@keyframes observationPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

.observation-content {
  display: none;
}

.coach-observation[data-expanded="true"] .observation-content {
  display: block;
}

/* --------------------------------------------------------------------------
   Quick Action Pills
   -------------------------------------------------------------------------- */
.coach-actions {
  margin-top: 12px;
}

.coach-actions .btn {
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-size: 14px;
}

/* Touch targets: 44px minimum */
@media (max-width: 576px) {
  .coach-actions .btn {
    min-height: 44px;
    padding: 10px 20px;
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion Support
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .message-enter,
  .typing-dot,
  .observation-dot {
    animation: none !important;
    transition: none !important;
  }

  .message-enter {
    opacity: 1;
    transform: none;
  }

  .typing-dot {
    opacity: 1;
    transform: scale(1);
  }

  .observation-dot {
    transform: scale(1);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Celebration Styles (export success)
   -------------------------------------------------------------------------- */
.celebration-avatar {
  animation: celebrationBounce 0.6s ease-out;
}

@keyframes celebrationBounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
