﻿.ctx-menu {
  position: fixed;
  z-index: 60;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-1);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: scale(0.92);
  transition: all 120ms var(--ease-out);
  pointer-events: none;
}
.ctx-menu--visible { opacity:1; transform:scale(1); pointer-events:all; }

.ctx-menu__reactions {
  display: flex;
  gap: 2px;
  padding: var(--sp-1) var(--sp-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-1);
}
.ctx-menu__reaction-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  cursor: pointer; border: none; background: none;
  transition: all var(--t-fast);
}
.ctx-menu__reaction-btn:hover {
  background: var(--bg-glass-hover);
  transform: scale(1.2);
}

.ctx-menu__item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-sm); font-weight: var(--fw-medium);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
  transition: all var(--t-fast);
}
.ctx-menu__item:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.ctx-menu__item svg { width:16px; height:16px; stroke-width:1.75; flex-shrink:0; }
.ctx-menu__item--danger { color: #ef4444; }
.ctx-menu__item--danger:hover { background: rgba(239,68,68,0.1); color: #ef4444; }

.ctx-menu__sep {
  height:1px; background:var(--border); margin: var(--sp-1) 0;
}

.reply-bar {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  margin: 0 var(--sp-5);
  background: var(--bg-input);
  border: 1px solid var(--border-accent);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  animation: slideUp 200ms var(--ease-out);
}
.reply-bar__accent {
  width: 3px; height: 28px;
  background: var(--accent); border-radius: 2px; flex-shrink:0;
}
.reply-bar__content { flex:1; min-width:0; }
.reply-bar__author {
  font-size: var(--font-xs); font-weight: var(--fw-semibold);
  color: var(--accent-light);
}
.reply-bar__text {
  font-size: var(--font-xs); color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reply-bar__close {
  width:28px; height:28px; border-radius: var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
  color: var(--text-muted); cursor:pointer; border:none; background:none;
  transition: all var(--t-fast);
}
.reply-bar__close:hover { background:var(--bg-glass-hover); color:var(--text-primary); }
.reply-bar__close svg { width:14px; height:14px; stroke-width:2; }

.message__reply-quote {
  padding: var(--sp-1) var(--sp-2);
  margin-bottom: var(--sp-1);
  border-left: 2px solid var(--accent-light);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  background: rgba(255,255,255,0.07);
  font-size: var(--font-xs);
}
.message__reply-author {
  font-weight: var(--fw-semibold); color: var(--accent-light);
}
.message__reply-text {
  color: rgba(255,255,255,0.6);
  white-space: nowrap; overflow:hidden; text-overflow:ellipsis;
  max-width: 220px;
}
.message--received .message__reply-quote { background: rgba(255,255,255,0.04); }
.message--received .message__reply-text { color: var(--text-muted); }

.message__edited {
  font-size: 0.6rem; color: var(--text-muted); font-style: italic;
}

.message__forwarded {
  font-size: var(--font-xs); color: var(--accent-light);
  padding-bottom: var(--sp-1); font-style: italic;
  display: flex; align-items: center; gap: var(--sp-1);
}
.message__forwarded svg { width:12px; height:12px; stroke-width:2; }

.message__reactions {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding-top: var(--sp-1);
}
.reaction-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 10px;
  background: var(--bg-glass-hover); border: 1px solid var(--border);
  font-size: 0.8rem; cursor: pointer;
  transition: all var(--t-fast);
}
.reaction-badge:hover { border-color: var(--border-accent); background: var(--accent-muted); }
.reaction-badge__count {
  font-size: var(--font-xs); color: var(--text-muted); font-weight: var(--fw-medium);
}
.reaction-badge--own { border-color: var(--border-accent); background: var(--accent-muted); }

.pinned-bar {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-surface-solid);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.pinned-bar:hover { background: var(--bg-surface-hover); }
.pinned-bar__icon { color: var(--accent-light); flex-shrink:0; }
.pinned-bar__icon svg { width:16px; height:16px; stroke-width:2; }
.pinned-bar__content { flex:1; min-width:0; }
.pinned-bar__label {
  font-size: var(--font-xs); color: var(--accent-light); font-weight: var(--fw-semibold);
}
.pinned-bar__text {
  font-size: var(--font-xs); color: var(--text-muted);
  white-space: nowrap; overflow:hidden; text-overflow:ellipsis;
}
.pinned-bar__close {
  width:24px; height:24px; border-radius: var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-muted); cursor:pointer; border:none; background:none;
}
.pinned-bar__close:hover { color:var(--text-primary); }
.pinned-bar__close svg { width:14px; height:14px; }

.forward-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.55);
  z-index:70; display:flex; align-items:center; justify-content:center;
  opacity:0; transition: opacity var(--t-base);
}
.forward-overlay--visible { opacity:1; }

.forward-modal {
  width: 360px; max-width: 90vw; max-height: 70vh;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9); transition: transform var(--t-base);
}
.forward-overlay--visible .forward-modal { transform:scale(1); }

.forward-modal__header {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.forward-modal__title {
  font-size: var(--font-base); font-weight: var(--fw-semibold); color: var(--text-primary);
}
.forward-modal__close {
  width:32px; height:32px; border-radius: var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-muted); cursor:pointer; border:none; background:none;
}
.forward-modal__close svg { width:18px; height:18px; }

.forward-modal__list {
  flex:1; overflow-y:auto; padding: var(--sp-2);
}
.forward-modal__item {
  display:flex; align-items:center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  cursor:pointer; transition: background var(--t-fast);
}
.forward-modal__item:hover { background: var(--bg-glass-hover); }
.forward-modal__item-name {
  font-size: var(--font-sm); font-weight: var(--fw-medium); color: var(--text-primary);
}

.drop-overlay {
  position:absolute; inset:0; z-index:20;
  background: rgba(139,92,246,0.08);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  display:flex; align-items:center; justify-content:center;
  pointer-events:none;
  opacity:0; transition: opacity var(--t-fast);
}
.drop-overlay--visible { opacity:1; }
.drop-overlay__text {
  font-size:var(--font-lg); font-weight:var(--fw-semibold);
  color:var(--accent-light);
  background: var(--bg-surface-solid);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
}

.unread-separator {
  display:flex; align-items:center; gap: var(--sp-3);
  padding: var(--sp-2) 0;
}
.unread-separator::before,
.unread-separator::after {
  content:''; flex:1; height:1px; background: var(--accent);
}
.unread-separator__text {
  font-size: var(--font-xs); color: var(--accent-light);
  font-weight: var(--fw-semibold); white-space:nowrap;
}

.chat-search {
  display:flex; align-items:center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-surface-solid);
  border-bottom: 1px solid var(--border);
  flex-shrink:0;
  animation: slideUp 200ms var(--ease-out);
}
.chat-search__input {
  flex:1; height:32px;
  padding: 0 var(--sp-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-sm);
  outline:none;
}
.chat-search__input:focus { border-color: var(--border-accent); }
.chat-search__count { font-size:var(--font-xs); color:var(--text-muted); white-space:nowrap; }
.chat-search__nav { display:flex; gap:2px; }
.chat-search__nav button {
  width:28px; height:28px; border-radius:var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-muted); cursor:pointer; border:none; background:none;
}
.chat-search__nav button:hover { background:var(--bg-glass-hover); color:var(--text-primary); }
.chat-search__nav svg { width:14px; height:14px; stroke-width:2; }
.chat-search__close svg { width:16px; height:16px; }

.message--highlight .message__bubble {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-glow);
}

.chat__header-status--typing {
  color: var(--accent-light);
  font-style: italic;
}