/* premium-chat.css - Shared styles for Chat Bubbles and Emoji Picker */

:root {
  --chat-bg: #f4f7f9;
  --bubble-me: linear-gradient(135deg, #2563eb, #3b82f6);
  --bubble-other: #ffffff;
  --text-me: #ffffff;
  --text-other: #1e293b;
  --meta-color: #94a3b8;
}

/* Chat Row Layout */
.chat-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  max-width: 85%;
  position: relative;
}

.chat-row.me {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-row.other {
  align-self: flex-end;
  align-items: flex-end;
}

/* Bubble Styling */
.chat-bubble {
  padding: 14px 18px;
  border-radius: 22px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  word-wrap: break-word;
  max-width: 100%;
}

.chat-row.me .chat-bubble {
  background: var(--bubble-me);
  color: var(--text-me);
  border-bottom-right-radius: 4px;
}

.chat-row.other .chat-bubble {
  background: var(--bubble-other);
  color: var(--text-other);
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* Metadata (Time, Status) - Outside Bubble */
.chat-meta {
  font-size: 10px;
  color: var(--meta-color);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}

.chat-row.me .chat-meta {
  margin-right: 5px;
}

.chat-row.other .chat-meta {
  margin-left: 5px;
  flex-direction: row-reverse;
}

/* Emoji Picker Container */
.emoji-picker-container {
  position: absolute;
  bottom: 80px;
  right: 20px;
  width: 340px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: none;
  flex-direction: column;
  z-index: 1000;
  border: 1px solid rgba(226, 232, 240, 0.8);
  overflow: hidden;
  animation: slideUpEmoji 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.emoji-header {
  padding: 15px 20px;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fcfdfe;
  color: #1e293b;
  flex-direction: row-reverse; /* X on left, Text on right */
}

.emoji-header i {
  color: #64748b;
  font-size: 14px;
  transition: color 0.2s;
}

.emoji-header i:hover {
  color: #ef4444;
}

/* Scrollbar styling for Emoji Grid and Chat Area */
.emoji-grid::-webkit-scrollbar, .ticket-chat-area::-webkit-scrollbar {
  width: 6px;
}
.emoji-grid::-webkit-scrollbar-track, .ticket-chat-area::-webkit-scrollbar-track {
  background: transparent;
}
.emoji-grid::-webkit-scrollbar-thumb, .ticket-chat-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* HIDE SCROLLBAR FROM TEXTAREA */
textarea#t-reply-box, textarea#client-chat-input {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}
textarea#t-reply-box::-webkit-scrollbar, textarea#client-chat-input::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 10px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

.emoji-category-title {
  grid-column: span 8;
  padding: 10px 5px 5px;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emoji-item {
  font-size: 20px;
  cursor: pointer;
  padding: 8px 0;
  border-radius: 10px;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-item:hover {
  background: #f1f5f9;
  transform: scale(1.2);
}

/* Image Attachment Styling */
.chat-img-attach {
  max-width: 250px;
  border-radius: 12px;
  display: block;
  margin-top: 5px;
  cursor: pointer;
  transition: transform 0.3s;
}
.chat-img-attach:hover {
  transform: scale(1.02);
}

.chat-link-attach {
  color: inherit;
  text-decoration: underline;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Input Area Fixes */
.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #fff;
  padding: 10px 15px;
  border-radius: 25px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  position: relative;
}

.chat-input-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 5px;
}

.chat-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.chat-action-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: translateY(-2px);
}
