/* VCN shared room chrome — matches landing tokens */
:root {
  --bg0: #0c1020;
  --bg1: #161b2e;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f3f5fb;
  --muted: #a7b0c5;
  --accent: #3dd6c6;
  --accent-2: #6ea8fe;
  --danger: #ff7b72;
  --warn: #ffd166;
  --radius: 16px;
  --topbar-h: 56px;
  --rail-w: 280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 214, 198, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(110, 168, 254, 0.1), transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---- App shell ---- */
.vcn-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.vcn-topbar {
  flex: 0 0 var(--topbar-h);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: rgba(8, 12, 24, 0.92);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.vcn-topbar .brand-link {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-right: 4px;
}

.vcn-topbar .room-title {
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}

.vcn-topbar .spacer { flex: 1; }

.vcn-topbar .nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vcn-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--warn);
  color: #1a1400;
}

.vcn-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.vcn-switch input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

/* Bootstrap navbar overrides inside topbar */
.vcn-topbar.navbar {
  padding: 0 14px;
  background: rgba(8, 12, 24, 0.92) !important;
  border-bottom: 1px solid var(--panel-border);
}

.vcn-topbar .navbar-brand {
  color: var(--text) !important;
  font-weight: 600;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vcn-topbar .nav-link {
  color: var(--muted) !important;
}

.vcn-topbar .nav-link:hover {
  color: var(--text) !important;
}

.vcn-topbar .dropdown-menu {
  background: #151b2c;
  border: 1px solid var(--panel-border);
}

.vcn-topbar .dropdown-item {
  color: var(--text);
}

.vcn-topbar .dropdown-item:hover,
.vcn-topbar .dropdown-item.active {
  background: rgba(61, 214, 198, 0.15);
  color: var(--text);
}

/* ---- Director strip ---- */
.vcn-director {
  flex: 0 0 auto;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--panel-border);
  color: var(--text);
}

.vcn-director strong {
  color: var(--accent);
}

.vcn-director .hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: 8px;
}

.vcn-director-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.vcn-rtmp {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
}

.vcn-rtmp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.vcn-rtmp-ingest,
.vcn-rtmp-key {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.vcn-rtmp-ingest {
  flex: 0 0 auto;
  min-width: 150px;
  max-width: 200px;
}

.vcn-rtmp-key {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 420px;
}

.vcn-rtmp-status {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.vcn-rtmp-status.is-live {
  color: #3dcea8;
}

.vcn-rtmp-status.is-error {
  color: #f07178;
}

.vcn-rtmp-status.is-reconnect {
  color: #e6b450;
}

.director-roster-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
}

.director-roster-row .btn,
.vcn-btn {
  border: 0;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.vcn-btn-primary,
.director-roster-row .btn-outline-light {
  background: linear-gradient(135deg, var(--accent), #2bb3a6);
  color: #062821 !important;
  border: 0 !important;
}

.vcn-btn-warn,
.director-roster-row .btn-outline-warning {
  background: rgba(255, 209, 102, 0.15);
  color: var(--warn) !important;
  border: 1px solid rgba(255, 209, 102, 0.35) !important;
}

/* ---- Main stage + rail ---- */
.vcn-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  gap: 0;
}

.vcn-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vcn-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  padding: 0;
  margin: 0;
  max-height: none;
}

.vcn-stage-label {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 7;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--panel-border);
  font-size: 0.9rem;
  pointer-events: none;
}

.vcn-pip {
  position: absolute;
  top: 14px;
  left: 14px;
  width: min(180px, 32vw);
  z-index: 8;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.vcn-pip video {
  width: 100%;
  height: auto;
  max-height: 14vh;
  display: block;
  object-fit: cover;
}

.vcn-rail {
  min-height: 0;
  overflow-y: auto;
  background: rgba(10, 14, 26, 0.95);
  border-left: 1px solid var(--panel-border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vcn-rail .tile,
.vcn-rail .videoOuterDiv,
.vcn-rail .remoteVideo {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: #000;
  float: none;
  max-height: none;
}

.vcn-rail video {
  width: 100%;
  display: block;
  max-height: 22vh;
  object-fit: cover;
  background: #000;
  padding: 0;
}

.videoNameOverlay {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 2;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  font-size: 0.8rem;
  pointer-events: none;
}

.vcn-rail .videoOuterDiv.is-featured,
.vcn-rail .tile.is-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(61, 206, 168, 0.45);
}

.vcn-tile-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: calc(100% - 16px);
}

.vcn-tile-actions .vcn-btn {
  padding: 4px 8px;
  font-size: 0.7rem;
  line-height: 1.2;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.vcn-btn-feature.is-active {
  background: linear-gradient(135deg, #3dcea8, #2bb3a6);
  color: #041510;
}

.vcn-btn-mute {
  background: #c45c26;
  color: #fff;
}

.vcn-btn-unmute {
  background: #3d7ea6;
  color: #fff;
}

.vcn-muted-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(196, 92, 38, 0.92);
  color: #fff;
  font-size: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.vcn-rail .videoOuterDiv.is-audio-muted .vcn-muted-badge,
.vcn-rail .tile.is-audio-muted .vcn-muted-badge {
  display: inline-flex;
}

#videoContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Control dock ---- */
.vcn-dock,
.float-buttons {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 20;
}

.vcn-dock-btn,
.video-mute-float,
.audio-mute-float {
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.vcn-dock-btn:hover,
.video-mute-float:hover,
.audio-mute-float:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #fff;
}

.video-mute-float {
  background: linear-gradient(135deg, #3b5bdb, #364fc7);
}

.audio-mute-float {
  background: linear-gradient(135deg, var(--accent), #2bb3a6);
}

.queue-leave-wrap,
.queue-admin-actions {
  margin-top: 14px;
}

.vcn-queue-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: center;
}

.vcn-queue-btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #e03131, #c92a2a);
}

.vcn-queue-btn-danger:hover {
  filter: brightness(1.05);
}

.vcn-queue-btn-warn {
  color: #1a1400;
  background: linear-gradient(135deg, #ffd166, #f59f00);
}

.vcn-queue-btn-warn:hover {
  filter: brightness(1.05);
}

.vcn-queue-btn:disabled {
  background: #5c5f66;
  color: #ccc;
  cursor: not-allowed;
  filter: none;
}

/* legacy ids — keep full-width with shared button style */
#adminSkipNextButton {
  width: 100%;
}

.video-mute-float.is-muted,
.audio-mute-float.is-muted {
  background: linear-gradient(135deg, #e03131, #c92a2a) !important;
}

.video-mute-float-icon,
.audio-mute-float-icon {
  margin: 0;
  font-size: 1.1rem;
}

/* ---- Queue rail ---- */
#queueColumn {
  color: var(--text);
  text-align: center;
  width: 100%;
}

#queueColumnTitle {
  padding: 14px 12px 10px;
  background: rgba(61, 214, 198, 0.12);
  border: 1px solid var(--panel-border);
  border-radius: 12px 12px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
}

#queueColumnTitle p { margin: 0; }

#queueColumnSubTitle {
  background: rgba(110, 168, 254, 0.18);
  border-left: 1px solid var(--panel-border);
  border-right: 1px solid var(--panel-border);
  padding: 8px;
  font-size: 0.9rem;
}

#bigQueueInfo {
  font-size: 2.6rem;
  font-weight: 700;
  padding: 18px 8px;
  border: 1px solid var(--panel-border);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: rgba(0, 0, 0, 0.25);
}

#adminOnlyTag {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---- Modals ---- */
.modal-content {
  background: #151b2c;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
}

.modal-header {
  border-bottom: 1px solid var(--panel-border);
}

.modal-header .btn-close {
  filter: invert(1);
}

.modal-body .form-control {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 12px;
  min-height: 44px;
}

.modal-body .form-control:focus {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(61, 214, 198, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.15);
  color: var(--text);
}

.modal-body .form-label,
.modal-body .form-text {
  color: var(--muted);
}

.modal-body .btn-primary {
  background: linear-gradient(135deg, var(--accent), #2bb3a6);
  border: 0;
  color: #062821;
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 16px;
}

#joinErrorMsg,
#initModalErrorText {
  color: var(--danger);
}

/* ---- Queue entry splash (legacy path still present) ---- */
#queueEntry {
  /* visibility controlled by queue/index.html + JS */
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .vcn-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(45vh, 1fr) minmax(220px, 38vh);
  }

  .vcn-rail {
    border-left: 0;
    border-top: 1px solid var(--panel-border);
  }

  .vcn-topbar .room-title,
  .vcn-topbar .navbar-brand {
    max-width: 28vw;
  }

  .vcn-stage-label {
    bottom: 88px;
  }
}

@media (max-width: 520px) {
  .vcn-topbar .nav-tools .form-check-label {
    display: none;
  }
}
