/* ReactionComponent.css - Styles for emoji reactions */

.reaction-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 4px;
  padding: 0;
  min-height: 24px;
  border-radius: 0;
  background: transparent;
}

.reaction-display {
  display: none; /* Hidden by default, shown when reactions exist */
  flex-wrap: wrap;
  gap: 4px;
  margin-right: 8px;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #FFFFFF;
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.reaction-btn.user-reacted {
  background: rgba(85, 93, 255, 0.15);
  border-color: rgba(85, 93, 255, 0.3);
  color: #FFFFFF;
}

.reaction-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.reaction-bar {
  display: none;
  position: absolute;
  bottom: -10px;
  left: 0px;
  right: auto;
  flex-direction: row;
  gap: 6px;
  padding: 8px;
  width: 290px;
  height: 50px;
  background: #38394F;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 200;
}

/* Own messages - blue background to match sent bubble */
.chat-message.own .reaction-bar,
.private-chat-message.own .reaction-bar {
  background: #313578;
  left: auto;
  right: 0px;
}

/* Other messages - gray background to match received bubble */
.chat-message.other .reaction-bar,
.private-chat-message.other .reaction-bar {
  background: #38394F;
  left: 0px;
  right: auto;
}

.reaction-picker {
  display: flex;
  gap: 6px;
}

.reaction-emoji {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
}

.reaction-emoji:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.15);
}

.reaction-emoji.active {
  background: rgba(85, 93, 255, 0.2);
  border-color: rgba(85, 93, 255, 0.4);
  transform: scale(1.1);
}

.reaction-emoji:active {
  transform: scale(0.95);
}

.reaction-toggle-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #536285;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  margin: 0 2px;
}

.reaction-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  transform: scale(1.1);
}

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

.reaction-toggle-btn.active {
  background: rgba(85, 93, 255, 0.15);
  border-color: rgba(85, 93, 255, 0.3);
  color: #555DFF;
}

/* Feedback animations */
.reaction-feedback {
  position: fixed;
  z-index: 1000;
  font-size: 24px;
  pointer-events: none;
  animation: reactionFloat 1.5s ease-out forwards;
}

.reaction-feedback.added {
  color: #10b981;
}

.reaction-feedback.removed {
  color: #ef4444;
}

.reaction-feedback.pending {
  color: #f59e0b;
}

@keyframes reactionFloat {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(0);
  }
  20% {
    opacity: 1;
    transform: scale(1.2) translateY(-10px);
  }
  100% {
    opacity: 0;
    transform: scale(1) translateY(-30px);
  }
}

/* Error toast */
.reaction-error {
  position: fixed;
  z-index: 1000;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
  animation: errorSlideIn 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes errorSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .reaction-btn {
    padding: 3px 6px;
    font-size: 11px;
  }

  .reaction-emoji {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .reaction-toggle-btn {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .reaction-bar {
    padding: 6px 10px;
  }
}

/* Dark theme support - REMOVED: App is always dark themed, using consistent subtle styling */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .reaction-btn {
    border-width: 2px;
  }

  .reaction-emoji {
    border-width: 2px;
  }

  .reaction-toggle-btn {
    border-width: 2px;
  }

  .reaction-bar {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .reaction-btn,
  .reaction-emoji,
  .reaction-toggle-btn {
    transition: none;
  }

  .reaction-feedback {
    animation: none;
  }

  .reaction-error {
    animation: none;
  }
}
