/* Fullscreen layout */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* Default scrollbar styling - subtle and only visible when needed */

/* Chat styling variables */
:root {
  /* Main colors used throughout the chat */
}

.full-screen-chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Chat box styling */
.chat-box {
  flex: 1;
  overflow-y: hidden; /* Hide scrolling on the container - we'll scroll the messages div */
  overflow-x: hidden;
  border: 1px solid #ddd;
  padding: 0; /* Remove padding - will be handled by messages container */
  background: #f9f9f9;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  animation: fadeIn 0.5s ease-in-out;
  display: flex !important; /* Use flex for proper layout */
  flex-direction: column !important; /* Stack children vertically */
  height: calc(100% - 60px) !important; /* Allow space for the input area */
  position: relative; /* For absolute positioning of scrollbar */
  box-sizing: border-box;
}

.chat-container {
  transition: filter 0.5s ease;
}

/* The overlay that appears above everything */
.banned-overlay {
  position: fixed;     /* full screen */
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); /* dim background */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;        /* above all */
  color: #fff;
  text-align: center;
  padding: 20px;
}

/* The content inside the overlay (heading, reason, etc.) */
.banned-overlay-content {
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 30px;
  max-width: 400px;
}

.banned-overlay-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #ff4444; /* red highlight */
}

.banned-overlay-content p {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.banned-overlay-content #banReason {
  color: #ffaaaa;
  font-weight: 500;
}
.banned-overlay-content #banUntil {
  color: #ffaaaa;
  font-style: italic;
}

/* When we blur the chat */
.blurred {
  filter: blur(6px);
  pointer-events: none;   /* user can't click anything in chat */
  user-select: none;      /* user can't select text in chat */
}

/* Simple fade animations for scrollbar */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Single fade animation, used with different directions */

/* WebKit (Chrome, Safari, Edge) scrollbar styling */
/* Set up overlay scrollbar in WebKit browsers */
#messages {
  -webkit-overflow-scrolling: touch; /* Smoother scrolling on touch devices */
  overflow-y: auto; /* Ensure scrolling behavior */
  scrollbar-width: thin; /* Show Firefox scrollbar but thin */
  scrollbar-color: transparent transparent; /* Hide by default (thumb, track) */
  transition: scrollbar-color 0.3s ease;
}

/* Create a custom scrollbar using pseudo-element */
.chat-box {
  position: relative; /* Required for absolute positioning */
}

/* Clean scrollbar styling */

/* Scrollbar styling for Firefox and WebKit browsers */

/* Basic styling for native scrollbar - Firefox */
#messages {
  scrollbar-width: thin; /* Use Firefox's thin scrollbar */
  scrollbar-color: transparent transparent; /* Hide by default (thumb, track) */
  transition: scrollbar-color 0.3s ease; /* Smooth transition */
}

/* Show scrollbar on hover - Firefox */
.chat-box:hover #messages {
  scrollbar-color: #00ffff transparent; /* Show cyan scrollbar on hover */
}

/* WebKit browsers (Chrome, Safari, Edge) */
#messages::-webkit-scrollbar {
  width: 6px; /* Thin scrollbar */
  background-color: transparent; /* Transparent track */
}

#messages::-webkit-scrollbar-track {
  background: transparent; /* Transparent track */
  margin: 4px 0; /* Add some margin for better rounding */
}

#messages::-webkit-scrollbar-thumb {
  background-color: transparent; /* Hidden by default */
  
  /* Smooth transition */
  transition: background-color 0.3s ease;
}

/* Show scrollbar on hover */
/* WebKit glowing color effect */
@keyframes scrollbarGlow {
  0% { background-color: #00ffff; }
  50% { background-color: #ff00ff; }
  100% { background-color: #00ffff; }
}

.chat-box:hover #messages::-webkit-scrollbar-thumb {
  background-color: #00ffff; /* Cyan color on hover */
  animation: scrollbarGlow 3s infinite ease-in-out;
}

/* Hover effect on the thumb itself */
.chat-box:hover #messages::-webkit-scrollbar-thumb:hover {
  background-color: #ff00ff; /* Magenta when hovering directly on the thumb */
  animation: none; /* Stop animation when hovering directly on thumb */
}

/* Firefox color changing effect */
@keyframes firefoxColor {
  0% { scrollbar-color: #00ffff transparent; }
  50% { scrollbar-color: #ff00ff transparent; }
  100% { scrollbar-color: #00ffff transparent; }
}

/* Firefox scrollbar on hover with glowing color effect */
.chat-box:hover #messages {
  scrollbar-color: #00ffff transparent; /* Cyan on transparent */
  animation: firefoxColor 3s infinite ease-in-out;
}

/* Messages list */
#messages {
  /* Standard approach - no absolute positioning */
  display: flex;
  flex-direction: column;
  margin: 0; 
  padding: 0 10px 20px 10px; /* Standard padding */
  width: 100%;
  flex-grow: 1;
  overflow-y: auto; /* Allow messages container to scroll again */
  
  /* Handle true overlay scrollbar */
  padding-right: 20px; /* Add extra padding to compensate for scrollbar */
  margin-right: -10px; /* Pull back to keep alignment consistent */
  
  /* Allow scrolling only for the visible portion */
  max-height: 100%;
  
  box-sizing: border-box;
}


/* Add padding to first message to push it down when chat is empty */
#messages > .msg-list:first-child {
  margin-top: 20px; /* Use smaller margin for first message */
}

/* Add a spacer at the top of the messages container to prevent scrolling too far up */
#messages::before {
  content: "";
  display: block;
  height: 0;
  margin-top: auto; /* This pushes content to the bottom */
  min-height: 0;
  visibility: hidden;
}

/* Loading and no-messages indicators */
.loading-messages, .no-messages, .message-sending-indicator {
  text-align: center;
  padding: 20px;
  font-style: italic;
  color: #888;
  width: 100%;
  margin-top: auto; /* Push to bottom when chat is empty */
  margin-bottom: 10px; /* Add some space above the input area */
}

/* Message sending indicator specific styles */
.message-sending-indicator {
  padding: 10px;
  font-size: 0.9em;
  color: #0066cc;
  animation: pulse 1.5s infinite;
}

/* Error message styles */
.error-message {
  padding: 10px;
  background-color: #ffeeee;
  border: 1px solid #ffcccc;
  border-radius: 5px;
  color: #cc0000;
  font-size: 0.9em;
  margin: 10px 0;
  width: 100%;
  text-align: center;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Reply & Mention preview boxes (top area) */
.reply-preview-box,
.mention-preview-box {
  display: none;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  padding: 8px 15px;
  position: relative;
  animation: fadeIn 0.3s ease-in-out;
}

.reply-info,
.mention-info {
  flex-grow: 1;
  font-size: 13px;
  color: #333;
  display: flex;
  align-items: center;
}

.reply-prefix,
.mention-prefix {
  font-weight: normal;
  margin-right: 5px;
}

.reply-author,
.mention-author {
  font-weight: bold;
  color: #000;
  position: relative;
  margin-right: 5px;
}

/* special icons before author name */
.reply-author::before {
  content: "\f112"; /* FontAwesome reply arrow */
  font-family: FontAwesome;
  display: inline-block;
  margin-right: 5px;
  color: #8a2be2;
  font-size: 12px;
  vertical-align: middle;
}

.mention-author::before {
  content: "\f10e"; /* FontAwesome @ icon */
  font-family: FontAwesome;
  display: inline-block;
  margin-right: 5px;
  color: #0084ff;
  font-size: 12px;
  vertical-align: middle;
}

.reply-excerpt {
  font-style: italic;
  color: #666;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.reply-close,
.mention-close {
  cursor: pointer;
  font-size: 20px;
  color: #333;
  line-height: 1;
  margin-left: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: background 0.2s;
}
.reply-close:hover,
.mention-close:hover {
  background: #eee;
}

/* The in-message "reply bubble" or "mention bubble" */
.reply-bubble {
  background: rgba(255,255,255,0.3);
  border-left: 3px solid #fff;
  padding: 5px 8px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 13px;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.msg-list:not(.sender) .reply-bubble {
  background: rgba(138, 43, 226, 0.08);
  border-left: 3px solid #8a2be2;
  color: #333;
}

.mention-bubble {
  background: rgba(235, 205, 247, 0.3);
  border-left: 3px solid #0084ff;
  padding: 5px 8px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 13px;
  display: inline-block;
}
.mentioned-you {
  background: rgba(209, 234, 255, 0.5);
  border-left-color: #005bb5;
}

/* Chat input area (bottom) */
.chat-input-container {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid #ddd;
  box-shadow: 0 -1px 5px rgba(0,0,0,0.1);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.chat-input-container .chat-input {
  flex-grow: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  height: 40px;
  resize: none;
  word-break: break-word;
  line-height: 1.2;
  z-index: 1000;
}

.chat-input-container .chat-input:focus {
  border-color: #007bff;
  box-shadow: none;
}

.chat-input-container .chat-input-form {
  flex-grow: 1;
  display: flex;
}

/* Buttons in input area */
.chat-input-container .btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease-in-out;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}
.chat-input-container .btn:hover {
  transform: scale(1.1);
}

/* e.g. + button, tip button */
.action-button {
  background: linear-gradient(135deg, #42a5f5, #478ed1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.action-button:hover {
  background: linear-gradient(135deg, #478ed1, #42a5f5);
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.tip-button {
  background: linear-gradient(135deg, #f46b45, #eea849);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.tip-button:hover {
  background: linear-gradient(135deg, #eea849, #f46b45);
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* The list of messages */
.msg-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 20px;
  position: relative;
  animation: slideIn 0.3s ease-in-out;
  margin-top: 5px; /* Add space between messages */
}

.msg-list.sender {
  align-items: flex-end;
}

/* Avatar + username header */
.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  margin-top: 10px; /* Space between messages */
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-right: 10px;
  cursor: pointer;
}
.username {
  font-weight: bold;
  margin: 0;
  align-self: center;
  line-height: 1;
  cursor: pointer;
}
.user-badge {
  vertical-align: middle;
  margin-left: 5px;
  width: 16px;
  height: 16px;
}

.verified-badge, .pro-badge {
  vertical-align: middle;
  margin-left: 5px;
  width: 16px;
  height: 16px;
  display: inline-block;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
}

/* The bubble with text or image/gif */
.messenger-container {
  position: relative;
  overflow: visible;
  margin-left: 50px;
  max-width: 80%;
  border-radius: 0 7.5px 7.5px 7.5px; /* Modified for top-left tail */
  padding: 8px 12px;
  background: #e6e6e6; /* Keep original color */
  color: #333;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  margin-top: -5px;
  min-height: 40px;
  position: relative;
}
/* WhatsApp-style tail - top left */
.messenger-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-right: 10px solid var(--tail-color, #e6e6e6); /* Use variable for dynamic color */
  border-bottom: 10px solid transparent;
}
.msg-list.sender .messenger-container {
  background: #8a2be2; /* Keep original color */
  color: #fff;
  border-radius: 7.5px 7.5px 0 7.5px; /* WhatsApp style for sender */
}
/* WhatsApp-style tail for sender - bottom right */
.msg-list.sender .messenger-container::before {
  top: auto;
  bottom: 0;
  left: auto;
  right: -8px;
  border-right: 0;
  border-left: 10px solid var(--tail-color, #8a2be2); /* Use variable for dynamic color */
  border-top: 10px solid transparent;
  border-bottom: 0;
}
.msg-list.sender .message-header {
  display: none;
}

/* Text messages */
.messenger-container p {
  color: inherit;
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
  word-wrap: break-word;
}

/* Link Preview Styling */
.link-preview-container {
  border-radius: 8px;
  overflow: hidden;
  margin: 5px 0;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: #333;
  max-width: 200px; /* Reduced width to take less space */
  min-height: 40px; /* Reduced minimum height */
}

.link-preview-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.link-preview-image {
  width: 100%;
  height: 80px; /* Reduced height to take less space in chat */
  object-fit: cover;
  object-position: center;
  background-color: #f5f5f5;
  display: block;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom: 1px solid #eee;
  min-height: 40px; /* Reduced minimum height */
}

.link-preview-content {
  padding: 6px; /* Reduced padding */
}

.link-preview-title {
  font-weight: bold;
  font-size: 12px; /* Smaller font size */
  margin: 0 0 3px; /* Reduced margin */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keeping the CSS class for compatibility but we won't be using it */
.link-preview-description {
  display: none; /* Hide the description element */
}

.link-preview-domain {
  font-size: 9px; /* Smaller domain text */
  color: #007bff;
  display: flex;
  align-items: center;
}

.link-preview-domain:before {
  content: "\f0c1"; /* FontAwesome link icon */
  font-family: FontAwesome;
  margin-right: 5px;
  font-size: 10px;
}

/* Special styling for YouTube previews */
.link-preview-youtube .link-preview-domain {
  color: #FF0000; /* YouTube red */
}

.link-preview-youtube .link-preview-domain:before {
  content: "\f167"; /* FontAwesome YouTube icon */
}

/* Special styling for Instagram previews */
.link-preview-instagram .link-preview-domain {
  color: #C13584; /* Instagram gradient start color */
}

.link-preview-instagram .link-preview-domain:before {
  content: "\f16d"; /* FontAwesome Instagram icon */
}

/* Special styling for TikTok previews */
.link-preview-tiktok .link-preview-domain {
  color: #000000; /* TikTok black */
}

.link-preview-tiktok .link-preview-domain:before {
  content: "\f2c0"; /* FontAwesome user icon (closest to TikTok in FontAwesome 4) */
}

/* Special styling for Facebook previews */
.link-preview-facebook .link-preview-domain {
  color: #1877F2; /* Facebook blue */
}

.link-preview-facebook .link-preview-domain:before {
  content: "\f09a"; /* FontAwesome Facebook icon */
}

/* Special styling for Twitter/X previews */
.link-preview-twitter .link-preview-domain {
  color: #1DA1F2; /* Twitter blue */
}

.link-preview-twitter .link-preview-domain:before {
  content: "\f099"; /* FontAwesome Twitter icon */
}

/* System message styling */
.system-message-container {
  text-align: center;
  margin: 8px 0;
  padding: 8px 15px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 15px;
  font-style: italic;
  color: #666;
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-in-out;
}

.system-message-container:hover {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.system-message p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.system-message-time {
  display: block;
  font-size: 10px;
  opacity: 0.7;
  text-align: right;
  margin-top: 2px;
  font-style: normal;
}

/* Edited label */
.edited-label {
  font-size: 12px;
  font-style: italic;
  margin-left: 5px;
  color: #ccc;
}

/* Images / GIF thumbnails in chat */
.messenger-container img.thumbnail {
  max-width: 250px; /* Match link preview width */
  height: auto;
  max-height: 120px; /* Match link preview image height */
  border-radius: 10px;
  margin: 5px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
  object-fit: cover;
}
.messenger-container img.thumbnail:hover {
  transform: scale(1.05);
}

/* Container that scrolls if the image is taller than 300px */
.enlarged-gif-wrapper {
  max-height: 300px;
  overflow-y: auto;
}
/* Match the chat-box scrollbar style */
.enlarged-gif-wrapper::-webkit-scrollbar {
  width: 8px;
}
.enlarged-gif-wrapper::-webkit-scrollbar-track {
  border-radius: 15px;
  background: #f1f1f1;
}
.enlarged-gif-wrapper::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.enlarged-gif-wrapper::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.enlarged-gif {
  width: 100%;
  object-fit: cover;
  transition: transform 0.2s ease-in-out;
  border-radius: 15px;
}

/* Special themed animations for each emoji type */
@keyframes bubble {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0.3;
  }
  20% {
    transform: translateY(-20px) scale(1.2);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-50px) scale(1);
    opacity: 0.8;
  }
  70% {
    transform: translateY(-80px) scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-120px) scale(0.5);
    opacity: 0;
  }
}

@keyframes floatHeart {
  0% {
    transform: translate(0, 0) scale(0.5) rotate(0deg);
    opacity: 0.3;
  }
  15% {
    transform: translate(-20px, -30px) scale(1.2) rotate(-20deg);
    opacity: 0.6;
    filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.6));
  }
  30% {
    transform: translate(25px, -60px) scale(1.4) rotate(15deg);
    opacity: 0.8;
    filter: drop-shadow(0 0 12px rgba(255, 105, 180, 0.7));
  }
  50% {
    transform: translate(-15px, -100px) scale(1.2) rotate(-10deg);
    opacity: 1;
    filter: drop-shadow(0 0 15px rgba(255, 105, 180, 0.8));
  }
  70% {
    transform: translate(20px, -140px) scale(1) rotate(20deg);
    opacity: 0.8;
    filter: drop-shadow(0 0 12px rgba(255, 105, 180, 0.6));
  }
  85% {
    transform: translate(-10px, -180px) scale(0.8) rotate(-15deg);
    opacity: 0.6;
    filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.4));
  }
  100% {
    transform: translate(5px, -220px) scale(0.6) rotate(10deg);
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(255, 105, 180, 0.2));
  }
}

@keyframes smokeRise {
  0% {
    transform: translate(0, 0) scale(0.8) rotate(0deg);
    opacity: 0.3;
    filter: blur(0px);
  }
  30% {
    transform: translate(-10px, -30px) scale(1.1) rotate(5deg);
    opacity: 0.7;
    filter: blur(1px);
  }
  60% {
    transform: translate(15px, -60px) scale(1.3) rotate(-8deg);
    opacity: 0.5;
    filter: blur(2px);
  }
  100% {
    transform: translate(-5px, -90px) scale(1.5) rotate(12deg);
    opacity: 0;
    filter: blur(3px);
  }
}

/* Special mini-elements styling */
.flying-emoji.mini-heart {
  filter: drop-shadow(0 0 8px rgba(255, 0, 128, 0.7));
  z-index: 998;
}

.flying-emoji.foam {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6))
          drop-shadow(0 0 15px rgba(255, 250, 205, 0.4));
  z-index: 998;
}

.flying-emoji.smoke {
  filter: drop-shadow(0 0 5px rgba(200, 200, 200, 0.6));
  opacity: 0.6;
  z-index: 998;
}

/* Link Preview Modal Styles */
.link-preview-wrapper {
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.link-preview-modal-content {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.link-preview-modal-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.link-preview-modal-info {
  padding: 20px;
}

.link-preview-modal-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.link-preview-modal-domain {
  font-size: 14px;
  color: #007bff;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.link-preview-modal-domain:before {
  content: "\f0c1"; /* FontAwesome link icon */
  font-family: FontAwesome;
  margin-right: 5px;
  font-size: 14px;
}

/* Close button for the enlarged gif modal */
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ff4d4d;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 1050;
}
.close-btn:hover {
  background-color: #e60000;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Reaction aggregator (the counts) */
.reaction-counter {
  display: none; /* Hide by default, only show when has reactions */
  gap: 2px;
  margin-top: 2px;
  font-size: 14px;
  align-items: center;
  margin-left: 50px;
  z-index: 999;
  cursor: pointer;
  position: relative;
}
/* Show when it has child elements (reaction displays) */
.reaction-counter:not(:empty) {
  display: inline-flex;
}
/* WhatsApp style reactions */
.reaction-display {
  padding: 2px 4px;
  display: flex;
  align-items: center;
  font-weight: 500;
  background: #fff;
  border-radius: 10px;
  font-size: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  margin-right: 1px;
  border: 1px solid rgba(0,0,0,0.05);
  height: 18px;
}
.reaction-display:hover {
  background: #f8f8f8;
}
.reaction-display img {
  margin-right: 2px;
  width: 14px;
  height: 14px;
}

/* Facebook-style Reaction Bar */
.reaction-bar {
  display: none;
  position: absolute;
  bottom: calc(100% - 15px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0,0,0,0.1);
  padding: 8px 10px;
  border-radius: 40px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 1001;
  animation: reaction-bar-appear 0.3s forwards;
  transform-origin: bottom center;
}

@keyframes reaction-bar-appear {
  0% { 
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(-5px) scale(1.05);
  }
  75% {
    opacity: 1;
    transform: translateY(2px) scale(0.98);
  }
  100% { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.msg-list:not(.sender) .reaction-bar {
  left: 45px;
}
.msg-list.sender .reaction-bar {
  right: 10px;
}

.reaction-bar .emoji-container {
  position: relative;
  display: inline-block;
  margin: 0 5px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  transform-origin: bottom center;
}

.reaction-bar .emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 28px;
  height: 28px;
}

.reaction-bar .emoji img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.reaction-bar .emoji-container:hover {
  transform: scale(1.3) translateY(-5px);
  z-index: 2;
}

/* Tooltip styling */
.reaction-bar .emoji-tooltip {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  z-index: 1002;
  font-weight: bold;
}

.reaction-bar .emoji-container:hover .emoji-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Add custom hover effects for each music emoji */
.reaction-bar .emoji-container:nth-child(1):hover .emoji img { /* Notes */
  filter: drop-shadow(0 0 4px rgba(118, 96, 255, 0.8));
}

.reaction-bar .emoji-container:nth-child(2):hover .emoji img { /* Headphones */
  filter: drop-shadow(0 0 4px rgba(32, 178, 170, 0.8));
}

.reaction-bar .emoji-container:nth-child(3):hover .emoji img { /* Heart */
  filter: drop-shadow(0 0 4px rgba(255, 20, 147, 0.8));
}

.reaction-bar .emoji-container:nth-child(4):hover .emoji img { /* Fire */
  filter: drop-shadow(0 0 4px rgba(255, 69, 0, 0.8));
}

.reaction-bar .emoji-container:nth-child(5):hover .emoji img { /* Microphone */
  filter: drop-shadow(0 0 4px rgba(220, 20, 60, 0.8));
}

.reaction-bar .emoji-container:nth-child(6):hover .emoji img { /* Raised hands */
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.8));
}

.reaction-bar .emoji-container:nth-child(7):hover .emoji img { /* Beers/Cheers */
  filter: drop-shadow(0 0 4px rgba(255, 184, 28, 0.8));
}

.my-reaction-selected .emoji img {
  animation: reaction-selected 0.5s forwards, floating 2s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(255, 100, 100, 0.7)) !important;
}

@keyframes reaction-selected {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  75% { transform: scale(0.8); }
  100% { transform: scale(1); }
}

@keyframes floating {
  0% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(2deg); }
  50% { transform: translateY(0px) rotate(0deg); }
  75% { transform: translateY(2px) rotate(-2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.my-reaction-selected {
  background: rgba(255,100,100,0.1);
  border-radius: 50%;
  position: relative;
  padding: 2px;
  box-shadow: 0 0 0 2px rgba(255,100,100,0.4);
  animation: selected-pulse 1.5s infinite;
}

@keyframes selected-pulse {
  0% {
    box-shadow: 0 0 0 2px rgba(255,100,100,0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(255,100,100,0.6);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 2px rgba(255,100,100,0.4);
    transform: scale(1);
  }
}

/* The message toolbar (reply, reaction, 3-dot) */
.message-toolbar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.msg-list:not(.sender) .message-toolbar {
  left: 100%;
  margin-left: 5px;
  flex-direction: row;
}
.msg-list.sender .message-toolbar {
  right: 100%;
  margin-right: 5px;
  flex-direction: row-reverse;
}
.msg-list .messenger-container:hover .message-toolbar {
  opacity: 1;
}
.message-toolbar span {
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: #555;
  transition: background 0.2s;
}
.message-toolbar span:hover {
  background: #f0f0f0;
  color: #8a2be2;
}

/* 3-dot context menu */
.message-menu {
  position: absolute;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
  display: none;
  color: #333;
  top: 50%;
  transform: translateY(-100%) translateY(-20px);
  overflow: hidden;
}
.msg-list:not(.sender) .message-menu {
  left: 100%;
  margin-left: 5px;
}
.msg-list.sender .message-menu {
  right: 100%;
  margin-right: 5px;
}
.message-menu ul {
  list-style: none;
  margin: 0;
  padding: 5px;
}
.message-menu ul li {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}
.message-menu ul li:hover {
  background: #f0f0f0;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.shake {
  animation: shake 0.3s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* 3D Firework Emoji Animation */
/* Main emoji - the one that shoots up */
.flying-emoji.main {
  position: fixed;
  bottom: 10px;
  left: 50%;
  font-size: 8rem; /* 5x bigger than particles (1.8rem) */
  z-index: 1001; /* Higher than particles to appear in front */
  pointer-events: none;
  transform: translateX(-50%) translateZ(200px); /* Enhanced 3D effect - push further forward */
  animation: shootUp 1s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4)); /* Add glow */
}

/* Particle emojis that explode outward */
.flying-emoji.particle {
  position: fixed;
  top: 50%;
  left: 50%;
  font-size: 1.8rem;
  z-index: 999;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  opacity: 0;
}

/* Theme colors and effects for different reactions */
.flying-emoji.heart {
  filter: drop-shadow(0 0 15px rgba(255, 0, 128, 0.9));
}
.flying-emoji.heart.main {
  animation-name: heartShootUp;
  animation-duration: 1.2s;
  filter: drop-shadow(0 0 20px rgba(255, 0, 128, 1.0))
          drop-shadow(0 0 40px rgba(255, 20, 147, 0.8))
          drop-shadow(0 0 60px rgba(255, 105, 180, 0.6));
  transform: translateX(-50%) translateZ(250px) scale(1.2); /* Extra 3D effect and slightly larger */
}
.flying-emoji.heart.particle {
  filter: drop-shadow(0 0 12px rgba(255, 0, 128, 0.8))
          drop-shadow(0 0 20px rgba(255, 20, 147, 0.6));
}

.flying-emoji.fire {
  filter: drop-shadow(0 0 15px rgba(255, 140, 0, 0.9));
}
.flying-emoji.fire.main {
  animation-name: fireShootUp;
  animation-duration: 1.4s;
}
.flying-emoji.fire.particle {
  filter: drop-shadow(0 0 15px rgba(255, 140, 0, 0.8))
          drop-shadow(0 0 25px rgba(255, 69, 0, 0.7));
}

.flying-emoji.notes {
  filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.9));
}
.flying-emoji.notes.main {
  animation-name: notesShootUp;
  animation-duration: 1.3s;
}
.flying-emoji.notes.particle {
  filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.8))
          drop-shadow(0 0 25px rgba(75, 0, 130, 0.7));
}

.flying-emoji.raised_hands {
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.9));
}
.flying-emoji.raised_hands.main {
  animation-name: handsShootUp;
  animation-duration: 1.5s;
}
.flying-emoji.raised_hands.particle {
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8))
          drop-shadow(0 0 25px rgba(255, 165, 0, 0.7));
}

.flying-emoji.beers {
  filter: drop-shadow(0 0 15px rgba(220, 20, 60, 0.9));
}
.flying-emoji.beers.main {
  animation-name: beersShootUp;
  animation-duration: 1.6s;
}
.flying-emoji.beers.particle {
  filter: drop-shadow(0 0 15px rgba(220, 20, 60, 0.8))
          drop-shadow(0 0 25px rgba(255, 215, 0, 0.7));
}

.flying-emoji.joy {
  filter: drop-shadow(0 0 15px rgba(50, 205, 50, 0.9));
}
.flying-emoji.joy.main {
  animation-name: joyShootUp;
  animation-duration: 1.4s;
}
.flying-emoji.joy.particle {
  filter: drop-shadow(0 0 15px rgba(50, 205, 50, 0.8))
          drop-shadow(0 0 25px rgba(152, 251, 152, 0.7));
}

/* Main emoji shooting up animation (default) */
@keyframes shootUp {
  0% {
    transform: translateX(-50%) translateY(0) scale(1) rotateY(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateX(-50%) translateY(-40vh) scale(1.5) rotateY(180deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(-50vh) scale(0.1) rotateY(360deg);
    opacity: 0;
  }
}

/* HEART ANIMATION - Heartbeat effect */
@keyframes heartShootUp {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 0.7;
  }
  10% {
    transform: translateX(-50%) translateY(-10vh) scale(1.3);
    opacity: 0.8;
  }
  20% {
    transform: translateX(-50%) translateY(-15vh) scale(1.0);
    opacity: 0.9;
  }
  30% {
    transform: translateX(-50%) translateY(-25vh) scale(1.6);
    opacity: 1;
  }
  40% {
    transform: translateX(-50%) translateY(-30vh) scale(1.2);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) translateY(-40vh) scale(1.8);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(-50vh) scale(0.1);
    opacity: 0;
  }
}

/* FIRE ANIMATION - Flame flickering */
@keyframes fireShootUp {
  0% {
    transform: translateX(-50%) translateY(0) scale(1) rotate(-10deg);
    opacity: 0.7;
  }
  15% {
    transform: translateX(-55%) translateY(-15vh) scale(1.2) rotate(10deg);
    opacity: 0.8;
  }
  30% {
    transform: translateX(-48%) translateY(-25vh) scale(1.4) rotate(-5deg);
    opacity: 0.9;
  }
  45% {
    transform: translateX(-52%) translateY(-35vh) scale(1.6) rotate(8deg);
    opacity: 1;
  }
  60% {
    transform: translateX(-50%) translateY(-40vh) scale(1.8) rotate(-12deg);
    opacity: 1;
  }
  75% {
    transform: translateX(-53%) translateY(-45vh) scale(1.6) rotate(5deg);
    opacity: 0.9;
  }
  100% {
    transform: translateX(-50%) translateY(-50vh) scale(0);
    opacity: 0;
  }
}

/* NOTES ANIMATION - Musical bounce */
@keyframes notesShootUp {
  0% {
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    opacity: 0.7;
  }
  20% {
    transform: translateX(-40%) translateY(-20vh) scale(1.2) rotate(15deg);
    opacity: 0.8;
  }
  40% {
    transform: translateX(-60%) translateY(-30vh) scale(1.4) rotate(-15deg);
    opacity: 0.9;
  }
  60% {
    transform: translateX(-45%) translateY(-40vh) scale(1.6) rotate(30deg);
    opacity: 1;
  }
  80% {
    transform: translateX(-55%) translateY(-45vh) scale(1.4) rotate(-30deg);
    opacity: 0.9;
  }
  100% {
    transform: translateX(-50%) translateY(-50vh) scale(0.1) rotate(0deg);
    opacity: 0;
  }
}

/* BEERS ANIMATION - Cheers effect */
@keyframes beersShootUp {
  0% {
    transform: translateX(-60%) translateY(0) scale(1) rotate(-5deg);
    opacity: 0.7;
  }
  10% {
    transform: translateX(-60%) translateY(-5vh) scale(1.1) rotate(-5deg);
    opacity: 0.8;
  }
  25% {
    transform: translateX(-40%) translateY(-15vh) scale(1.2) rotate(15deg);
    opacity: 0.9;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
  }
  /* Clinking moment - pause */
  40% {
    transform: translateX(-40%) translateY(-25vh) scale(1.6) rotate(15deg);
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1.0));
  }
  42% {
    transform: translateX(-40%) translateY(-25vh) scale(1.8) rotate(15deg);
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1.0));
  }
  44% {
    transform: translateX(-40%) translateY(-25vh) scale(1.6) rotate(15deg);
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1.0));
  }
  /* Continue path */
  60% {
    transform: translateX(-50%) translateY(-35vh) scale(1.4) rotate(0deg);
    opacity: 0.9;
  }
  80% {
    transform: translateX(-50%) translateY(-45vh) scale(1.2) rotate(-10deg);
    opacity: 0.8;
  }
  100% {
    transform: translateX(-50%) translateY(-50vh) scale(0.1) rotate(-15deg);
    opacity: 0;
  }
}

/* JOY ANIMATION - Laughing bounce */
@keyframes joyShootUp {
  0% {
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    opacity: 0.7;
  }
  15% {
    transform: translateX(-45%) translateY(-10vh) scale(1.2) rotate(-10deg);
    opacity: 0.8;
  }
  30% {
    transform: translateX(-55%) translateY(-20vh) scale(1.1) rotate(10deg);
    opacity: 0.9;
  }
  45% {
    transform: translateX(-45%) translateY(-30vh) scale(1.3) rotate(-15deg);
    opacity: 1;
  }
  60% {
    transform: translateX(-55%) translateY(-35vh) scale(1.2) rotate(15deg);
    opacity: 1;
  }
  75% {
    transform: translateX(-45%) translateY(-40vh) scale(1.4) rotate(-5deg);
    opacity: 0.9;
  }
  90% {
    transform: translateX(-55%) translateY(-45vh) scale(1.3) rotate(5deg);
    opacity: 0.8;
  }
  100% {
    transform: translateX(-50%) translateY(-50vh) scale(0.1) rotate(0deg);
    opacity: 0;
  }
}

/* RAISED HANDS ANIMATION - Celebration wave */
@keyframes handsShootUp {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 0.7;
  }
  20% {
    transform: translateX(-60%) translateY(-15vh) scale(1.3) rotate(-15deg);
    opacity: 0.8;
  }
  40% {
    transform: translateX(-40%) translateY(-30vh) scale(1.5) rotate(15deg);
    opacity: 0.9;
  }
  60% {
    transform: translateX(-60%) translateY(-40vh) scale(1.7) rotate(-15deg);
    opacity: 1;
  }
  80% {
    transform: translateX(-40%) translateY(-45vh) scale(1.5) rotate(15deg);
    opacity: 0.9;
  }
  100% {
    transform: translateX(-50%) translateY(-50vh) scale(0.1) rotate(0deg);
    opacity: 0;
  }
}

/* Particle animations - 16 directions for the explosion */
/* Heart particles - heart-shaped path */
@keyframes heartParticle1 {
  0% { 
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% { 
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  35% {
    transform: translate(-20vw, -30vh) scale(0.8) rotate(90deg);
    opacity: 0.9;
  }
  60% {
    transform: translate(-30vw, -10vh) scale(0.6) rotate(180deg);
    opacity: 0.7;
  }
  85% {
    transform: translate(-20vw, 0vh) scale(0.4) rotate(270deg);
    opacity: 0.5;
  }
  100% { 
    transform: translate(-10vw, -10vh) scale(0.2) rotate(360deg);
    opacity: 0;
  }
}

/* Fire particles - flame path with flickering */
@keyframes fireParticle1 {
  0% { 
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% { 
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  25% {
    transform: translate(-30vw, -30vh) scale(1.0) rotate(90deg);
    opacity: 0.9;
  }
  50% {
    transform: translate(-25vw, -40vh) scale(0.8) rotate(180deg);
    opacity: 0.7;
  }
  75% {
    transform: translate(-20vw, -50vh) scale(0.6) rotate(270deg);
    opacity: 0.5;
  }
  100% { 
    transform: translate(-15vw, -60vh) scale(0.3) rotate(360deg);
    opacity: 0;
  }
}

/* Beer particles - bubbly path */
@keyframes beerParticle1 {
  0% { 
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% { 
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  30% {
    transform: translate(-45vw, -40vh) scale(0.9) rotate(90deg);
    opacity: 0.9;
  }
  50% {
    transform: translate(-40vw, -30vh) scale(0.7) rotate(180deg);
    opacity: 0.7;
  }
  70% {
    transform: translate(-35vw, -20vh) scale(0.5) rotate(270deg);
    opacity: 0.5;
  }
  90% {
    transform: translate(-30vw, -10vh) scale(0.3) rotate(360deg);
    opacity: 0.3;
  }
  100% { 
    transform: translate(-25vw, 0vh) scale(0.1) rotate(450deg);
    opacity: 0;
  }
}

/* Default particle animation */
@keyframes particle1 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-20vw, -20vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle2 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-15vw, -40vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle3 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(0, -50vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle4 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(15vw, -40vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle5 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(20vw, -20vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle6 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(20vw, 0) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle7 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(15vw, 20vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle8 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(0, 30vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle9 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-15vw, 20vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle10 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-20vw, 0) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle11 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-30vw, -30vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle12 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(10vw, -45vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle13 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(30vw, -30vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle14 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(25vw, 25vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle15 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-10vw, 45vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle16 {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  10% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-25vw, 25vh) scale(0.5) rotate(360deg);
    opacity: 0;
  }
}

/* Reaction details modal: "invisible" style tabs, plus scrollable user-lists */
.nav.reaction-invisible-tabs .nav-link {
  border: none;
  margin-right: 5px;	
  padding: 10px 5px;
  color: #888;
  text-decoration: none;
  font-size: 18px;
  background-color: transparent;
}
.nav.reaction-invisible-tabs .nav-link.active {
  border-bottom: 4px solid #8a2be2;
  color: #333;
}
.nav.reaction-invisible-tabs .nav-link img.emojione {
  width: 24px; 
  height: 24px; 
  vertical-align: middle;
}

.reaction-user-list {
  list-style: none;
  margin-top: 15px;
  padding: 0;
  max-height: 360px; /* Common height moved from media queries */
  overflow-y: auto;
}
.reaction-user-list::-webkit-scrollbar {
  width: 8px;
}
.reaction-user-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.reaction-user-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.reaction-user-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.reaction-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}
.reaction-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}
.reaction-user-name {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

/* Giphy container */
.gif-grid-container {
  height: 50vh;
  overflow-y: auto;
  padding: 10px;
}
.gif-grid-container::-webkit-scrollbar {
  width: 8px;
}
.gif-grid-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.gif-grid-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.gif-grid-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.gif-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.gif-grid img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s ease-in-out;
}
.gif-grid img:hover {
  transform: scale(1.05);
}

/* Sticky search bar inside Giphy modal */
.fixed-top-search {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1000;
  padding-bottom: 10px;
}

/* EmojioneArea reverts */
.emojionearea .emojionearea-editor {
  min-height: 34px;
  max-height: 34px;
  overflow: auto;
  padding-top: 0;
}
.textcomplete-dropdown {
  z-index: 999 !important;
}
.emojionearea .emojionearea-editor[data-placeholder]::before {
  top: 7px;
}
.emojionearea .emojionearea-button {
  right: 15px;
}
.emojionearea-picker {
  z-index: 1000;
}

/* The mention suggestions box below the input */
.mention-suggestions {
  position: absolute;
  bottom: 45px;
  left: 0;
  width: 200px;
  max-height: 150px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  z-index: 2000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 5px;
}
.mention-suggestions::-webkit-scrollbar {
  width: 6px;
}
.mention-suggestions::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.mention-suggestion-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s;
}
.mention-suggestion-item:hover {
  background: #eee;
}
.mention-suggestion-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

/* Extra highlight class for arrow key selection */
.active-suggestion {
  background: #eee; /* same as hover color */
}
/* For the avatar inside the mention bubble */
.mention-bubble-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 5px;
  cursor: pointer;
  vertical-align: middle;
  object-fit: cover; /* optional */
}

.reply-bubble-avatar {
  width: 24px;      /* adjust to your preference */
  height: 24px;
  border-radius: 50%;
  margin-right: 5px;
  object-fit: cover;
  vertical-align: middle;
  cursor: pointer;  /* if you want clickable logic */
}

/* Responsiveness */
@media (max-width: 768px) {
  .chat-input-container .chat-input {
    padding: 8px 10px;
    font-size: 13px;
  }
  .chat-input-container .btn {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 576px) {
  .chat-input-container {
    padding: 8px;
  }
  .chat-input-container .chat-input {
    margin-right: 5px;
  }

  .messenger-container {
    max-width: 70%;
  }
  .reaction-bar {
    margin-bottom: 8px;
  }
}

@media (max-width: 430px) {
  .chat-box {
    height: 300px;
  }
  .reaction-bar {
    margin-bottom: 5px;
  }
  .reaction-user-list {
    max-height: 200px; /* Smaller height on mobile */
  }
}