/* Shared Twitch moderation menu (mod-menu.js). Loaded by the /chat community view and the channel
   page. Uses the global theme variables (--card, --border, --text, --muted, --accent, --accent-text). */

/* Clickable username affordance for mods. A dedicated class (not the role-colour .msg-name-mod)
   so it applies to any moderatable name without recolouring it. */
.mod-clickable {
  cursor: pointer;
}
.mod-clickable:hover {
  text-decoration: underline dotted;
}

.mod-menu {
  position: fixed;
  z-index: 1000;
  width: 240px;
  max-width: calc(100vw - 16px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}

.mod-menu-header {
  padding: 2px 4px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.mod-menu-name {
  font-weight: 700;
  color: var(--text);
}
.mod-menu-sub {
  font-size: 0.7rem;
  color: var(--muted);
  word-break: break-all;
}
.mod-menu-stats {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 4px 6px;
  line-height: 1.4;
}

/* Ban / timeout badge shown at the top of the info area when the viewer is currently sanctioned. */
.mod-menu-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 4px 6px;
}
.mod-menu-badge-ban {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.mod-menu-badge-timeout {
  background: rgba(240, 173, 78, 0.15);
  color: #f0ad4e;
  border: 1px solid #f0ad4e;
}

/* Account age + follow age line. */
.mod-menu-age {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 4px 6px;
  line-height: 1.4;
}

/* Scrollable list of the viewer's recent chat messages. */
.mod-menu-messages {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 96px;
  overflow-y: auto;
  padding: 0 4px 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.mod-menu-message {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.7rem;
  line-height: 1.3;
}
.mod-menu-message-text {
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mod-menu-message-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.65rem;
}

.mod-menu-timeout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 2px 2px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.mod-menu-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-right: 2px;
}
.mod-menu-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.7rem;
  padding: 2px 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}
.mod-menu-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.mod-menu-item {
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.78rem;
  text-align: left;
  padding: 5px 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}
.mod-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.mod-menu-danger {
  color: #ff6b6b;
}
.mod-menu-danger:hover {
  background: rgba(255, 107, 107, 0.15);
}

/* Feedback toast (bottom-centre), used for action confirmations and errors. */
.mod-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 1001;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 1;
  transition: opacity 0.35s;
}
.mod-toast-error {
  border-left-color: #ff6b6b;
}
.mod-toast-out {
  opacity: 0;
}
