/*
 * Prompt #119 — Lantern Power Scroller (canonical management list).
 * Compact searchable/sortable rows; actions live in expanded detail.
 * Phase 1: Teacher Tools → Moderation. Reuse for Staff/Feed later.
 */

.lanternPowerList {
  --lpl-ink: var(--ink, #eaf0ff);
  --lpl-muted: var(--muted, #b9c6ea);
  --lpl-line: var(--line, rgba(255, 255, 255, 0.12));
  --lpl-accent: var(--accent, #5aa7ff);
  --lpl-panel: #132038;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.lanternPowerListToolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 0 12px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel, var(--lpl-panel));
  border-bottom: 1px solid var(--lpl-line);
}

.lanternPowerListSearch {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 420px;
  height: 44px;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 700;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--lpl-line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--lpl-ink);
}

.lanternPowerListFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lanternPowerListFilter {
  height: 44px;
  min-width: 120px;
  font-size: 16px;
  font-weight: 800;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--lpl-line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--lpl-ink);
}

.lanternPowerListMeta {
  margin-left: auto;
  font-size: 16px;
  font-weight: 800;
  color: var(--lpl-muted);
}

.lanternPowerListColHd {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--lpl-muted);
  border-bottom: 1px solid var(--lpl-line);
  position: sticky;
  top: 64px;
  z-index: 2;
  background: var(--lpl-panel);
}

.lanternPowerListColHdBtn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.lanternPowerListColHdBtn:hover {
  color: var(--lpl-ink);
}

.lanternPowerListColHdBtn:focus-visible {
  outline: 2px solid var(--lpl-accent);
  outline-offset: 2px;
}

.lanternPowerListSortMark {
  font-size: 12px;
  opacity: 0.85;
  flex-shrink: 0;
}

.lanternPowerListBody {
  display: block;
  min-width: 0;
  /* Natural page scroll — do NOT nest a tiny overflow:auto scroller here. */
  overflow: visible;
  max-height: none;
}

.lanternPowerListEmpty {
  padding: 18px 12px;
  color: var(--lpl-muted);
  font-size: 18px;
  font-weight: 700;
}

.lanternPowerListRow {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.lanternPowerListRow:last-child {
  border-bottom: none;
}

.lanternPowerListRow > summary.lanternPowerListRowHd {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: grid;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--lpl-ink);
}

.lanternPowerListRow > summary.lanternPowerListRowHd::-webkit-details-marker {
  display: none;
}

.lanternPowerListRow:not([open]) > *:not(summary) {
  display: none !important;
}

.lanternPowerListRow > summary.lanternPowerListRowHd:hover {
  background: rgba(255, 255, 255, 0.04);
}

.lanternPowerListRow > summary.lanternPowerListRowHd:focus-visible {
  outline: 2px solid var(--lpl-accent);
  outline-offset: 2px;
}

.lanternPowerListCell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lanternPowerListCell--muted {
  color: var(--lpl-muted);
  font-weight: 700;
  font-size: 16px;
}

.lanternPowerListChev {
  justify-self: end;
  color: var(--lpl-muted);
  font-weight: 900;
  line-height: 1;
}

.lanternPowerListChev::before {
  content: '▸';
}

.lanternPowerListRow[open] > summary .lanternPowerListChev::before {
  content: '▾';
}

.lanternPowerListStatus {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--lpl-line);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lanternPowerListStatus--live {
  color: #7dcea0;
  border-color: rgba(125, 206, 160, 0.45);
  background: rgba(125, 206, 160, 0.12);
}

.lanternPowerListStatus--hidden {
  color: var(--lpl-muted);
  background: rgba(255, 255, 255, 0.06);
}

.lanternPowerListStatus--reported {
  color: #f0c674;
  border-color: rgba(240, 198, 116, 0.5);
  background: rgba(240, 198, 116, 0.14);
}

.lanternPowerListStatus--quarantine {
  color: #ffb4a8;
  border-color: rgba(255, 180, 168, 0.55);
  background: rgba(255, 100, 80, 0.16);
}

.lanternPowerListDetail {
  padding: 10px 12px 14px;
  border-top: 1px dashed var(--lpl-line);
  background: rgba(0, 0, 0, 0.14);
}

.lanternPowerListDetailPreview {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: none;
}

.lanternPowerListDetailMeta {
  margin: 0 0 10px;
  color: var(--lpl-muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.lanternPowerListActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lanternPowerListActions .btn {
  margin: 0;
}

/* Moderation column template: chevron | Type | Title | Author | Date | Status */
.lanternPowerList--moderation .lanternPowerListColHd,
.lanternPowerList--moderation .lanternPowerListRowHd {
  grid-template-columns:
    22px
    minmax(72px, 0.7fr)
    minmax(0, 1.6fr)
    minmax(80px, 1fr)
    minmax(64px, 0.7fr)
    minmax(88px, 1fr);
}

/* Prompt #121 — Staff roster: chevron | Name | Username | Role | Behavior Logger | Status */
.lanternPowerList--staff .lanternPowerListColHd,
.lanternPowerList--staff .lanternPowerListRowHd {
  grid-template-columns:
    22px
    minmax(0, 1.4fr)
    minmax(88px, 1fr)
    minmax(64px, 0.7fr)
    minmax(110px, 1.2fr)
    minmax(88px, 0.9fr);
}

/* Prompt #137 — Marquee Feed inspector: chevron | Type | Public Text | Time | Status */
.lanternPowerList--marquee .lanternPowerListColHd,
.lanternPowerList--marquee .lanternPowerListRowHd {
  grid-template-columns:
    22px
    minmax(108px, 0.85fr)
    minmax(0, 1.8fr)
    minmax(96px, 0.7fr)
    minmax(72px, 0.55fr);
}

.lanternPowerListToolbar .btn {
  height: 44px;
  flex: 0 0 auto;
}

.lanternPowerList--individualAccess .lanternPowerListColHd,
.lanternPowerList--individualAccess .lanternPowerListRowHd {
  grid-template-columns:
    22px
    minmax(0, 1.4fr)
    minmax(96px, 0.7fr)
    minmax(0, 1.1fr)
    minmax(88px, 0.7fr);
}

.lanternIndividualAccessGrant {
  min-width: 0;
  max-width: 100%;
}

.lanternIndividualAccessResults {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-width: 520px;
}

.lanternIndividualAccessResultBtn {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 20px;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--lpl-line, var(--line));
  background: rgba(0, 0, 0, 0.22);
  color: var(--lpl-ink, var(--ink));
  cursor: pointer;
}

.lanternIndividualAccessResultBtn:hover,
.lanternIndividualAccessResultBtn:focus-visible {
  border-color: var(--lpl-accent, var(--accent));
}

.lanternPowerListDetail .staffBlLinkPanel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--lpl-line);
}

.lanternPowerListDetail .staffBlLinkPanel select {
  width: 100%;
  max-width: 480px;
  display: block;
  margin-top: 6px;
}

@media (max-width: 720px) {
  .lanternPowerListColHd {
    display: none;
  }

  .lanternPowerListToolbar {
    position: static;
  }

  .lanternPowerList--moderation .lanternPowerListRowHd,
  .lanternPowerList--staff .lanternPowerListRowHd,
  .lanternPowerList--marquee .lanternPowerListRowHd,
  .lanternPowerList--individualAccess .lanternPowerListRowHd {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    grid-template-columns: none;
    align-items: baseline;
  }

  .lanternPowerList--moderation .lanternPowerListCell--type {
    font-size: 15px;
    color: var(--lpl-muted);
  }

  .lanternPowerList--moderation .lanternPowerListCell--title,
  .lanternPowerList--staff .lanternPowerListCell--name,
  .lanternPowerList--marquee .lanternPowerListCell--text,
  .lanternPowerList--individualAccess .lanternPowerListCell--student {
    flex: 1 1 100%;
    order: -1;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .lanternPowerList--staff .lanternPowerListCell--role,
  .lanternPowerList--staff .lanternPowerListCell--bl {
    display: none;
  }

  .lanternPowerListChev {
    margin-left: auto;
  }

  .lanternPowerListStatus {
    font-size: 12px;
    max-width: 46vw;
  }

  .lanternPowerList--individualAccess,
  .lanternIndividualAccessGrant {
    max-width: 100%;
    overflow-x: hidden;
  }
}
