/* ---------- STUDENT PLAYER STYLING (aligned to Teacher FINAL) ---------- */
body {
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
}

/* iOS control visibility handling */
video.show-controls::-webkit-media-controls { display: block; }
video.hide-controls::-webkit-media-controls { display: none; }

/* ---------- VIDEO CONTAINER ---------- */
.video-container {
  position: relative;
  width: 80%;
  max-width: 900px;
  margin: 20px auto;
  background-color: #000;
  border-radius: 10px;
  overflow: hidden;
}

.video-js {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}

/* ---------- BIG BUTTON (ONLY CONTROL) ---------- */

/* ---------- AUTO MIC BUTTON ---------- */
#autoMicToggle {
  position: absolute;
  top: 10px;
  left: calc(42% - 130px);
  transform: translateX(-50%);
  padding: 8px 14px;
  background-color: #A8E1FF;
  color: #93278f;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  z-index: 20;
}
#autoMicToggle:hover { background-color: #7ECFFF; }

#button {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background-color: #A8E1FF;
  color: #93278f;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  z-index: 20;
}
#button:hover { background-color: #7ECFFF; }

/* ---------- NATIVE FULLSCREEN (DESKTOP / iPad / Android tablet) ---------- */
.video-container:fullscreen,
.video-container:-webkit-full-screen,
.video-container:-moz-full-screen,
.video-container:-ms-fullscreen {
  width: 100vw;
  height: 100vh;
  background-color: #000;
  border-radius: 0;
}
.video-container:fullscreen video,
.video-container:-webkit-full-screen video,
.video-container:-moz-full-screen video,
.video-container:-ms-fullscreen video {
  max-width: 100vw;
  max-height: 100vh;
}

/* ---------- MOS CHAT PANEL ---------- */
.mos-chat {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 400px;
  height: 300px;
  min-width: 380px;
  min-height: 280px;
  max-width: 90vw;
  max-height: 85vh;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  overflow: auto;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  resize: both;
  user-select: none;
  touch-action: none;
}

.mos-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(180deg,#f7f9fb,#e9f3ff);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  cursor: grab;
}
.mos-chat-header:active { cursor: grabbing; }

.mos-chat-body {
  flex: 1 1 auto;
  padding: 6px;
  min-height: 0;
}

.mos-jitsi-placeholder,
.mos-jitsi-placeholder iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

#mos-reset,
#mos-toggle-size,
#mos-hide {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}

.mos-chat[data-mos-hidden="1"] { display: none !important; }

/* ---------- MOS SHOW BUTTON ---------- */
.mos-show {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 28px;
  background: rgba(168, 225, 255, 0.98);
  color: #93278f;
  font-size: 22px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  z-index: 2147483647 !important;
}
.video-container .mos-show { position: absolute; }

.mos-show:focus,
#mos-hide:focus,
#mos-toggle-size:focus,
#mos-reset:focus,
#button:focus {
  outline: 2px solid rgba(147,39,159,0.6);
  outline-offset: 2px;
}

/* lock scroll in pseudo fullscreen */
body.no-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ---------- PSEUDO FULLSCREEN (iOS + Android phones) ---------- */
#videoContainer.mos-pseudo-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  min-width: 100vw;
  min-height: 100dvh;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0;
  margin: 0 !important;
  background: black !important;
  display: block !important;
  z-index: 2147483646 !important;
}

/* video itself */
#videoContainer.mos-pseudo-fullscreen video,
#videoContainer.mos-pseudo-fullscreen .video-js,
#videoContainer.mos-pseudo-fullscreen .vjs-tech {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: translate(-50%, -50%) !important;
}

/* Show button in pseudo fullscreen */
#videoContainer.mos-pseudo-fullscreen .mos-show {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2147483647 !important;
}

/* keep chat above video */
#videoContainer.mos-pseudo-fullscreen .mos-chat {
  z-index: 2147483646 !important;
}

/* keep big button visible in normal mode */
#videoContainer:not(.mos-pseudo-fullscreen) #button {
  display: block !important;
  z-index: 2147483647 !important;
}

/* Native fullscreen: show button should still be clickable */
.video-container:fullscreen .mos-show,
.video-container:-webkit-full-screen .mos-show {
  position: absolute !important;
  z-index: 2147483647 !important;
}

/* ---------- SYNC STATUS (always outside container) ---------- */
#syncStatus {
  display: block;
  margin: 12px auto;
  padding: 6px 10px;
  font-size: 14px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  border-radius: 6px;
  width: fit-content;
  text-align: center;
}
