/*
 * Sections in the topic list of an advanced group chat and the kind mark before a topic's name
 * (owner, 2026-11-27, «вариант Б»). Code: assets/advanced-chats.js (renderTopicsList, buildTopicKindGlyph).
 */

/* ---------- The kind of a topic: # text, megaphone announcements, microphone voice ---------- */
.col-dialogs--gc-topics .topic-item__kind {
  display: inline-flex;
  align-items: center;
  vertical-align: -2px;
  margin-right: 5px;
  flex: none;
}

.col-dialogs--gc-topics .topic-item__kind svg {
  display: block;
  width: 14px;
  height: 14px;
}

.col-dialogs--gc-topics .topic-item__kind--text {
  color: #9fb3d9;
}

.col-dialogs--gc-topics .topic-item__kind--announce {
  color: #ffb44a;
}

.col-dialogs--gc-topics .topic-item__kind--voice {
  color: #4fe0b5;
}

.col-dialogs--gc-topics .topic-item__subtitle--announce {
  display: flex !important;
  align-items: center;
  gap: 4px;
}

.col-dialogs--gc-topics .topic-item__subtitle--announce svg {
  display: block;
  flex: none;
}

/* ---------- Section headings the owner made ---------- */
.col-dialogs--gc-topics .gc-topics-section-title--custom {
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  padding: 3px 2px;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.col-dialogs--gc-topics .gc-topics-section-title--custom::before {
  display: none !important;
}

.col-dialogs--gc-topics .gc-topics-section-title--custom:focus-visible {
  outline: 1px solid rgba(120, 160, 255, 0.6);
}

.col-dialogs--gc-topics .gc-topics-section-chev {
  flex: none;
  transition: transform 0.15s ease;
}

.col-dialogs--gc-topics .gc-topics-section.is-collapsed .gc-topics-section-chev {
  transform: rotate(-90deg);
}

.col-dialogs--gc-topics .gc-topics-section-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-dialogs--gc-topics .gc-topics-section.is-collapsed .gc-topics-section-title {
  margin-bottom: 0 !important;
}

/* A folded section with something unread inside. */
.col-dialogs--gc-topics .gc-topics-section-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5b8cff;
  box-shadow: 0 0 6px rgba(91, 140, 255, 0.8);
}

/* «⋯» and «+» on the right of a heading: always on touch screens, on hover with a mouse. */
.col-dialogs--gc-topics .gc-topics-section-act {
  all: unset;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: rgba(180, 193, 214, 0.7);
  cursor: pointer;
}

.col-dialogs--gc-topics .gc-topics-section-act--more {
  margin-left: auto;
}

.col-dialogs--gc-topics .gc-topics-section-act:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

@media (hover: hover) {
  .col-dialogs--gc-topics .gc-topics-section-act--more {
    opacity: 0;
  }

  .col-dialogs--gc-topics .gc-topics-section-title--custom:hover .gc-topics-section-act--more,
  .col-dialogs--gc-topics .gc-topics-section-act--more:focus-visible {
    opacity: 1;
  }
}

/* ---------- Dragging topics between sections ---------- */
.col-dialogs--gc-topics .topic-item.is-dragging {
  opacity: 0.45 !important;
}

.col-dialogs--gc-topics .topic-item.is-drop-before {
  box-shadow: 0 -2px 0 0 #5b8cff !important;
}

.col-dialogs--gc-topics .topic-item.is-drop-after {
  box-shadow: 0 2px 0 0 #5b8cff !important;
}

.col-dialogs--gc-topics .gc-topics-section-title--custom.is-drop-into {
  background: rgba(91, 140, 255, 0.16);
  color: #fff !important;
}

/* ---------- «+ Новая тема» and «+ Раздел» side by side ---------- */
.col-dialogs--gc-topics .gc-topics-add-row {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.col-dialogs--gc-topics .gc-topics-add-row .gc-topics-add-btn {
  width: auto !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

/* The section menu uses the voice member menu look; it is placed by the script. */
.gc-topic-section-menu {
  width: min(252px, calc(100vw - 24px)) !important;
}

/* Same glass look as the member menu in chat settings: icon, bold label, a line before «Удалить». */
.gc-voice-member-menu.gc-topic-section-menu {
  border: 1px solid rgba(132, 170, 224, 0.22) !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(89, 144, 255, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(20, 38, 65, 0.98), rgba(10, 24, 45, 0.98)) !important;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 14px !important;
}

.gc-topic-section-menu .gc-voice-member-menu__item.gc-topic-section-menu__item {
  width: 100%;
  min-height: 38px !important;
  padding: 0 10px !important;
  gap: 11px;
  border: 0;
  background: transparent;
  color: #ecf4ff;
  text-align: left;
  font: 800 13px/16px Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.gc-topic-section-menu .gc-topic-section-menu__item:hover,
.gc-topic-section-menu .gc-topic-section-menu__item:focus-visible {
  background: rgba(132, 170, 224, 0.1);
  outline: none;
}

.gc-topic-section-menu .gc-topic-section-menu__item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: rgba(216, 228, 248, 0.92);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gc-topic-section-menu .gc-topic-section-menu__item.gc-voice-member-menu__item--danger {
  color: #ffecef;
}

.gc-topic-section-menu .gc-topic-section-menu__item.gc-voice-member-menu__item--danger svg {
  stroke: #ff6674;
}

.gc-topic-section-menu .gc-topic-section-menu__item.gc-voice-member-menu__item--danger:hover {
  background: rgba(255, 93, 108, 0.105);
}

.gc-topic-section-menu__divider {
  height: 1px;
  margin: 5px 2px;
  background: rgba(132, 170, 224, 0.15);
}

/* The new topic window has three kinds now. */
#gcTopicCreateModal .gc-topic-type-grid {
  grid-template-columns: 1fr !important;
}

/* While a topic is dragged, nothing gets selected and the cursor shows the move. */
body.gc-topic-dragging,
body.gc-topic-dragging * {
  user-select: none !important;
  cursor: grabbing !important;
}

/* Three kinds in one column: each card is one row (picture, text, mark), so the window stays short. */
#gcTopicCreateModal .gc-topic-type-card {
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 40px 12px 14px !important;
  min-height: 0 !important;
}

#gcTopicCreateModal .gc-topic-type-card__icon {
  flex: none !important;
  margin: 0 !important;
}

/* «Здесь пишут только админы» under an announcements topic: the lock sits on the text line. */
#gcSlowModeBanner .topic-item__lock-mini {
  display: inline-block;
  vertical-align: -1px;
  margin-right: 2px;
}
