/* Recording Layout — 1920x1080 stage, system fonts only, no external assets. */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 1920px;
  height: 1080px;
  background: #000;
  color: #fff;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#stage {
  position: relative;
  width: 1920px;
  height: 1080px;
  background: #000;
  overflow: hidden;
}

/* ---------- Generic slot ---------- */
.slot {
  position: absolute;
  background: #000;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-in-out,
              transform 300ms ease-in-out,
              top 300ms ease-in-out,
              right 300ms ease-in-out,
              width 300ms ease-in-out,
              height 300ms ease-in-out,
              border-radius 300ms ease-in-out,
              box-shadow 300ms ease-in-out;
}

.slot video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

/* ---------- Screen slot defaults (fullscreen) ---------- */
.slot-screen {
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  border-radius: 0;
}

.slot-screen video {
  object-fit: contain;
}

/* ---------- Camera slot defaults (fullscreen) ---------- */
.slot-camera {
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  border: 0 solid transparent;
  border-radius: 0;
  box-shadow: none;
}

.slot-camera video {
  object-fit: cover;
}

/* ---------- Mode: empty (no tracks) ---------- */
.layout-mode-empty .slot-screen,
.layout-mode-empty .slot-camera {
  opacity: 0;
}

.layout-mode-empty .loading-state {
  opacity: 1;
}

/* ---------- Mode: camera only ---------- */
.layout-mode-camera .slot-camera {
  opacity: 1;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  border-radius: 0;
  border: 0 solid transparent;
  box-shadow: none;
}
.layout-mode-camera .slot-camera video { object-fit: cover; }
.layout-mode-camera .slot-screen { opacity: 0; }

/* ---------- Mode: screen only ---------- */
.layout-mode-screen .slot-screen {
  opacity: 1;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
}
.layout-mode-screen .slot-screen video { object-fit: contain; background: #000; }
.layout-mode-screen .slot-camera { opacity: 0; }

/* ---------- Mode: both (screen fullscreen + camera PIP top-right) ---------- */
.layout-mode-both .slot-screen {
  opacity: 1;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
}
.layout-mode-both .slot-screen video { object-fit: contain; background: #000; }

.layout-mode-both .slot-camera {
  opacity: 1;
  top: 24px;
  left: auto;
  right: 24px;
  width: 320px;
  height: 180px;
  border: 2px solid #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.layout-mode-both .slot-camera video { object-fit: cover; border-radius: 10px; }

/* Right-anchored PIP: override left default smoothly */
.slot-camera {
  /* When in "both" mode we anchor by right; CSS handles transition */
}

/* ---------- Teacher label ---------- */
.teacher-label {
  position: absolute;
  left: 24px;
  bottom: 24px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 500;
  border-radius: 999px;
  letter-spacing: 0.2px;
  max-width: 600px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 300ms ease-in-out;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.teacher-label.visible {
  opacity: 1;
}

/* ---------- Loading / waiting state ---------- */
.loading-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #cccccc;
  opacity: 0;
  transition: opacity 300ms ease-in-out;
  pointer-events: none;
  z-index: 5;
}

.loading-state .loading-text {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
