/* Right-side Chat Info & Media Archive Drawer */
.chat-drawer {
  width: 320px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.3);
}

.chat-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.drawer-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.drawer-profile-card {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.drawer-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.drawer-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.drawer-handle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.drawer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  margin-top: 10px;
}

.drawer-section {
  margin-bottom: 20px;
}

.drawer-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* Media Grid */
.drawer-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.drawer-media-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: transform 0.15s ease;
}

.drawer-media-thumb:hover {
  transform: scale(1.05);
}

.drawer-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Shared Files List */
.drawer-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.drawer-file-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.drawer-file-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  flex: 1;
}

/* Read receipt ticks */
.msg-ticks {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.msg-ticks.read {
  color: #60a5fa;
}

/* Edited tag */
.msg-edited-tag {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 4px;
  font-style: italic;
}

/* ========================================== */
/* Group Drawer Sections: Announcement & Members */
/* ========================================== */
.drawer-announcement-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
}

.drawer-announcement-text {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.drawer-invite-link {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-invite-link:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.5);
  color: #10b981;
}

.drawer-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: background 0.15s ease;
}

.drawer-member-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.drawer-member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.drawer-member-info {
  flex: 1;
  min-width: 0;
}

.drawer-member-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-member-handle {
  font-size: 11px;
  color: var(--text-dim);
}

.drawer-member-badges {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.member-role-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.member-role-badge.role-owner {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.member-role-badge.role-member {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-remove-member {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 6px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-remove-member:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}
