/* XeHello - Group Features (Gallery, Mentions, Admin Settings) Stylesheet */

/* Gallery Modal & Tabs */
.xe-gallery-card {
  max-width: 600px;
  height: 80vh;
}
.xe-gallery-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-surface, #fff);
  padding: 0 16px;
}
.xe-gallery-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary, #666);
  cursor: pointer;
  transition: all 0.2s;
}
.xe-gallery-tab:hover {
  color: var(--primary, #0088cc);
}
.xe-gallery-tab.active {
  color: var(--primary, #0088cc);
  border-bottom-color: var(--primary, #0088cc);
}

.xe-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.xe-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #222;
  cursor: pointer;
}
.xe-gallery-item img,
.xe-gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.xe-gallery-item:hover img,
.xe-gallery-item:hover video {
  transform: scale(1.05);
}
.xe-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 20px;
  background: rgba(0, 0, 0, 0.5);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xe-gallery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.xe-gallery-doc-row,
.xe-gallery-link-row,
.xe-gallery-audio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color, #eee);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.xe-gallery-doc-row:hover,
.xe-gallery-link-row:hover,
.xe-gallery-audio-row:hover {
  background: rgba(0, 0, 0, 0.05);
}
.xe-doc-icon,
.xe-link-icon,
.xe-audio-icon {
  font-size: 24px;
}
.xe-doc-info,
.xe-link-info,
.xe-audio-info {
  flex: 1;
  min-width: 0;
}
.xe-doc-name,
.xe-link-url,
.xe-audio-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xe-doc-sub,
.xe-link-sub,
.xe-audio-sub {
  font-size: 12px;
  color: var(--text-muted, #777);
}
.xe-btn-download {
  background: none;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.xe-gallery-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #888);
  font-size: 14px;
}

/* Mentions Floating Suggestions Popup */
.xe-mentions-popup {
  position: fixed;
  background: var(--wa-modal-bg, #202c33);
  color: var(--wa-text-primary, #fff);
  border: 1px solid var(--wa-border, #2a3942);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  max-height: 220px;
  width: 280px;
  overflow-y: auto;
  z-index: 10005;
  display: none;
}
.xe-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.xe-mention-item:hover,
.xe-mention-item.active {
  background: var(--wa-hover-bg, rgba(255, 255, 255, 0.08));
}
.xe-mention-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary, #0088cc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.xe-mention-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.xe-mention-info {
  flex: 1;
  min-width: 0;
}
.xe-mention-name {
  font-size: 13px;
  font-weight: 600;
}
.xe-mention-sub {
  font-size: 11px;
  color: var(--text-muted, #888);
}
.xe-mention-pill {
  color: #00a884;
  font-weight: 600;
  background: rgba(0, 168, 132, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
}

/* Admin Settings */
.xe-admin-settings-card {
  max-width: 480px;
}
.xe-setting-group-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color, #eee);
  border-radius: 12px;
  padding: 14px;
}
.xe-setting-header-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary, #666);
  margin-bottom: 10px;
}
.xe-setting-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
}
.xe-setting-switch-row:last-child {
  border-bottom: none;
}
.xe-setting-title {
  font-size: 14px;
  font-weight: 600;
}
.xe-setting-desc {
  font-size: 12px;
  color: var(--text-muted, #777);
  margin-top: 2px;
}

/* Floating Emoji Reaction Picker */
.xe-reaction-picker {
  position: fixed;
  background: var(--wa-modal-bg, #202c33);
  border: 1px solid var(--wa-border, #2a3942);
  border-radius: 24px;
  padding: 4px 8px;
  display: none;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 10010;
  animation: xePopIn 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes xePopIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.xe-reaction-emoji {
  font-size: 22px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition:
    transform 0.15s,
    background 0.15s;
  user-select: none;
}
.xe-reaction-emoji:hover {
  transform: scale(1.3);
  background: rgba(255, 255, 255, 0.1);
}

/* Reaction Chips under Message Bubbles */
.xe-msg-reactions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.xe-reaction-chip {
  background: var(--wa-modal-bg, #202c33);
  border: 1px solid var(--wa-border, #2a3942);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s;
}
.xe-reaction-chip:hover {
  transform: scale(1.05);
}
.xe-reaction-count {
  font-weight: 600;
  font-size: 11px;
  color: var(--wa-text-secondary, #8696a0);
}

/* Top Pinned Messages Banner */
.xe-pinned-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--wa-card-bg, #182229);
  border-bottom: 1px solid var(--wa-border, #222d34);
  position: sticky;
  top: 0;
  z-index: 99;
  cursor: pointer;
}
.xe-pinned-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.xe-pinned-icon {
  font-size: 16px;
}
.xe-pinned-info {
  flex: 1;
  min-width: 0;
}
.xe-pinned-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--wa-accent, #00a884);
}
.xe-pinned-text {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--wa-text-primary, #e9edef);
}
.xe-pinned-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.xe-pinned-next-btn,
.xe-pinned-close-btn {
  background: none;
  border: none;
  color: var(--wa-text-secondary, #8696a0);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}
.xe-pinned-next-btn:hover,
.xe-pinned-close-btn:hover {
  color: var(--wa-text-primary, #e9edef);
  background: rgba(255, 255, 255, 0.06);
}

/* Flash Highlight when jumping to pinned/quoted message */
.xe-msg-highlight-flash {
  animation: xeFlashHighlight 2s ease-out;
}
@keyframes xeFlashHighlight {
  0% {
    box-shadow: 0 0 0 4px #00a884;
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 0 6px #00a884;
    transform: scale(1.02);
  }
  100% {
    box-shadow: none;
    transform: scale(1);
  }
}

/* Audit Log Items */
.xe-audit-log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.xe-audit-icon {
  font-size: 20px;
  margin-top: 2px;
}
.xe-audit-info {
  flex: 1;
}
.xe-audit-text {
  font-size: 13px;
  color: var(--wa-text-primary, #e9edef);
  line-height: 1.4;
}
.xe-audit-text b {
  color: var(--wa-accent, #00a884);
}
.xe-audit-date {
  font-size: 11px;
  color: var(--wa-text-secondary, #8696a0);
  margin-top: 2px;
}
