/**
 * ═══════════════════════════════════════════════════════════════════
 * UX ENHANCEMENTS - ALL 9 FEATURES
 * ═══════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════
   1. TYPING INDICATOR (Beautiful bubble with text + dots)
   ═══════════════════════════════════════════════════════════════════ */

.typing-message {
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.typing-bubble,
.message.assistant .message-content.typing-bubble,
.message-content.typing-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0f1b2d 0%, #0a1220 100%) !important;
  border: 1px solid rgba(212, 168, 83, 0.18) !important;
  border-radius: 18px;
  color: #b8943a !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.typing-text {
  color: #b8943a;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.typing-dots {
  display: inline-flex;
  gap: 5px;
  margin-left: 8px;
  vertical-align: middle;
  align-items: center;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: #b8943a;
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   2. FOLLOW-UP PROMPTS (Suggested Questions)
   ═══════════════════════════════════════════════════════════════════ */

.follow-up-prompts {
  margin: 16px 0 16px 48px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.05) 0%, rgba(184, 148, 50, 0.05) 100%);
  border-left: 3px solid var(--primary-color, #D4A853);
  border-radius: 8px;
  animation: fadeInUp 0.4s ease-out;
}

.follow-up-prompts-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-color, #D4A853);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.follow-up-prompt-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 168, 83, 0.2);
  border-radius: 8px;
  color: var(--text-color, #e0e0e0);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.follow-up-prompt-btn:hover {
  background: rgba(212, 168, 83, 0.1);
  border-color: var(--primary-color, #D4A853);
  transform: translateX(4px);
}

.follow-up-prompt-btn:active {
  transform: translateX(2px);
}

.follow-up-prompt-btn:last-child {
  margin-bottom: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   3. MESSAGE TIMESTAMPS
   ═══════════════════════════════════════════════════════════════════ */

.message-timestamp {
  display: none !important; /* Hide timestamp everywhere - desktop and mobile */
}

.message.user .message-timestamp {
  display: none !important;
}

/* Container for timestamp + actions */
.timestamp-actions-container {
  display: flex; /* Desktop: flex (inline) */
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  min-height: 24px; /* Fixed height to prevent layout shift */
}

/* ═══════════════════════════════════════════════════════════════════
   4. COPY MESSAGE BUTTON
   ═══════════════════════════════════════════════════════════════════ */

/* DESKTOP: Copy + Star buttons inline, subtle */
.message-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  margin-left: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   5. VOICE INPUT BUTTON
   ═══════════════════════════════════════════════════════════════════ */

.voice-input-btn {
  position: absolute;
  right: 52px;
  bottom: 8px;
  background: rgba(212, 168, 83, 0.1);
  border: 1px solid rgba(212, 168, 83, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--primary-color, #D4A853);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-input-btn:hover {
  background: rgba(212, 168, 83, 0.2);
  transform: scale(1.05);
}

.voice-input-btn.recording {
  background: rgba(244, 67, 54, 0.2);
  border-color: #f44336;
  color: #f44336;
  animation: pulse 1s infinite;
}

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

/* ═══════════════════════════════════════════════════════════════════
   6. SAVE/FAVORITE MESSAGES
   ═══════════════════════════════════════════════════════════════════ */

.favorite-button, .message-favorite-btn {
  background: transparent;
  color: rgba(255, 215, 0, 0.5);
  border: none;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  min-width: 20px;
  min-height: 20px;
}

.favorite-button:hover, .message-favorite-btn:hover {
  background: rgba(255, 215, 0, 0.12);
  color: rgba(255, 215, 0, 0.9);
  transform: scale(1.05);
}

.favorite-button.favorited, .message-favorite-btn.favorited {
  color: rgba(255, 215, 0, 0.95);
  background: rgba(255, 215, 0, 0.08);
}

/* Favorites Tab */
.favorites-container {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.favorites-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light, #888);
}

.favorites-empty .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════
   7. EMOJI REACTIONS
   ═══════════════════════════════════════════════════════════════════ */

.message-reactions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  margin-left: 48px;
}

.reaction-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.reaction-btn:hover {
  background: rgba(212, 168, 83, 0.1);
  border-color: var(--primary-color, #D4A853);
  transform: scale(1.1);
}

.reaction-btn.active {
  background: rgba(212, 168, 83, 0.2);
  border-color: var(--primary-color, #D4A853);
}

.reaction-count {
  font-size: 12px;
  color: var(--text-light, #888);
  margin-left: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   8. LIGHT/DARK MODE TOGGLE - DISABLED (keeping only default dark theme)
   ═══════════════════════════════════════════════════════════════════ */

/* Theme toggle removed - only default theme available */

/* ═══════════════════════════════════════════════════════════════════
   9. TYPING ANIMATION (Streaming Effect)
   ═══════════════════════════════════════════════════════════════════ */

.message-content.typing {
  position: relative;
}

.message-content.typing::after {
  content: '▋';
  animation: blink 1s infinite;
  color: var(--primary-color, #D4A853);
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER ACTION BUTTONS - HIDDEN (using per-message buttons instead)
   ═══════════════════════════════════════════════════════════════════ */

.chat-header-actions {
  display: none !important;
}

/* Message actions - DESKTOP ONLY (mobile overrides in mobile-redesign-v2.css) */
@media (min-width: 769px) {
  .message {
    position: relative;
  }

  .message-actions {
    display: inline-flex !important;
    gap: 6px;
    align-items: center;
    margin-left: 0;
    opacity: 0.4;
    visibility: visible;
    transition: opacity 0.2s ease;
  }

  .message:hover .message-actions {
    opacity: 0.8;
  }
}

/* Copy Button - SVG icon style (like Claude) */
.copy-button {
  background: transparent;
  color: rgba(212, 168, 83, 0.5);
  border: none;
  padding: 3px 5px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-width: 20px;
  min-height: 20px;
}

.copy-button:hover {
  background: rgba(212, 168, 83, 0.12);
  color: rgba(212, 168, 83, 0.9);
  transform: scale(1.08);
}

.copy-button svg {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .follow-up-prompts {
    margin-left: 0;
    padding: 12px;
  }
  
  .message-reactions {
    margin-left: 0;
  }
  
  .voice-input-btn {
    right: 48px;
    bottom: 6px;
    padding: 6px 10px;
    font-size: 16px;
  }
  
  .theme-toggle {
    bottom: 80px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  
  .chat-header-actions {
    top: 15px;
    right: 15px;
    gap: 8px;
  }
  
  .header-action-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  /* MOBILE: Styles moved to mobile-claude-style.css */

  /* Visual feedback during long-press */
  .message-content.long-press-active {
    animation: pulse-glow 0.5s ease-in-out;
    box-shadow: 0 0 0 4px rgba(212, 168, 83, 0.3);
  }

  @keyframes pulse-glow {
    0% {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    50% {
      box-shadow: 0 0 0 6px rgba(212, 168, 83, 0.4);
    }
    100% {
      box-shadow: 0 0 0 4px rgba(212, 168, 83, 0.3);
    }
  }
}



