/* ---------- TEACHER PLAYER STYLING ---------- */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

/* IMPORTANT: your JS adds this class */
body.no-scroll {
  overflow: hidden !important;
  touch-action: none;
}
/* 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; }

/* ---------- TIMELINE (CUSTOM, shown only in Fullscreen / Pseudo Fullscreen) ---------- */
.mos-timeline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 2%;
  width: 92%;
  height: 26px;
  z-index: 16;
  display: none;
  touch-action: pan-x;
}

#videoContainer.mos-pseudo-fullscreen .mos-timeline,
#videoContainer.mos-native-fullscreen .mos-timeline {
  display: block;
  bottom: 2%;
  width: 94%;
}

#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;
}

#voiceToggle {
    position: absolute;
    top: 10px;
    left: calc(57% + 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;
}

/* ---------- FULLSCREEN BUTTON ---------- */
#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;
}

/* ---------- OVERLAY CONTROLS ---------- */
.overlay-controls {
    position: absolute;
    bottom: 4.25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    opacity: 0.75;
    transition: opacity 0.3s ease;
}
.overlay-controls:hover {
    opacity: 1;
}
.overlay-controls button {
    padding: 8px 12px;
    background-color: rgba(168, 225, 255, 0.9);
    color: #93278f;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

/* ---------- NATIVE FULLSCREEN (DESKTOP / iPad) ---------- */
.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; 
}

/* ---------- MOS SHOW BUTTON VISIBILITY (mutual exclusivity) ---------- */
#mos-show{
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
#mos-chat[data-mos-hidden="1"] + #mos-show,
#mos-chat[data-mos-hidden="1"] ~ #mos-show{
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.video-container .mos-show {
    position: absolute;
}

.mos-show:focus,
#mos-hide:focus,
#mos-toggle-size:focus,
#mos-reset:focus {
    outline: 2px solid rgba(147,39,159,0.6);
    outline-offset: 2px;
}

/* ---------- PSEUDO FULLSCREEN (iOS + Android) ---------- */
#videoContainer.mos-pseudo-fullscreen {
    position: fixed !important;
		inset: 0 !important; /* replaces top/left/width/height */
		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;
}
/* ALWAYS allow Show button in pseudo fullscreen */
#videoContainer.mos-pseudo-fullscreen .mos-show {
    position: absolute;
    top: 10px;
    right: 10px;
		z-index: 2147483647 !important;
}


/* ---------- OVERLAY CONTROLS: RESPONSIVE ---------- */
#videoContainer.mos-pseudo-fullscreen .overlay-controls {
    position: absolute;
    bottom: 10.75%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;          /* default: allow wrapping (portrait / narrow) */
    gap: 4px;
    justify-content: center;
    z-index: 2147483647;
}

/* Landscape / wider screens → single row */
@media (orientation: landscape) { 
  #videoContainer.mos-pseudo-fullscreen .overlay-controls {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
		max-width: 100vw;
		-webkit-overflow-scrolling: touch;
  }

    /* Optional: hide scrollbar for clean look */
    #videoContainer.mos-pseudo-fullscreen .overlay-controls::-webkit-scrollbar {
        display: none;
    }
		
		/* ---------- BUTTON STYLE ---------- */
		#videoContainer.mos-pseudo-fullscreen .overlay-controls button {
    		padding: 8px 12px;
    		background-color: rgba(168, 225, 255, 0.9);
    		color: #93278f;
    		border: none;
    		border-radius: 3px;
    		cursor: pointer;
    		font-size: 14px;
    		font-weight: bold;
   			flex-shrink: 0; /* prevent buttons from shrinking too much */
		}
	}
		#videoContainer.mos-native-fullscreen .overlay-controls {
				position: absolute;
  			bottom: 10.75%;
  			left: 50%;
  			transform: translateX(-50%);
  			display: flex;
  			flex-wrap: wrap;
  			gap: 4px;
  			justify-content: center;
  			z-index: 2147483647;
		}
				@media (orientation: landscape) {
  			#videoContainer.mos-native-fullscreen .overlay-controls {
    		flex-wrap: nowrap;
    		overflow-x: auto;
    		white-space: nowrap;
				max-width: 100vw;
    		-webkit-overflow-scrolling: touch;
  	}
	
				#videoContainer.mos-native-fullscreen .overlay-controls::-webkit-scrollbar { 
	display: none; }

  			#videoContainer.mos-native-fullscreen .overlay-controls button {
   flex-shrink: 0;
  }
 }
				#videoContainer.mos-pseudo-fullscreen .mos-chat {
    z-index: 2147483646 !important;
}

/* ---------- CURSOR CONTROL ---------- */
.video-js.hide-controls,
#videoContainer.mos-pseudo-fullscreen .video-js.hide-controls {
    cursor: none;
}

#videoContainer:not(.mos-pseudo-fullscreen) #button {
    display: block !important;
		z-index: 2147483647 !important;
}

/* Native fullscreen support */
.video-container:fullscreen .mos-show,
.video-container:-webkit-full-screen .mos-show {
    position: absolute !important;
    z-index: 2147483647 !important;
}
#syncStatus {
    display: block; /* always visible in normal mode */
    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;
}

/* ---------- VOICE NOTICE TIP (shown when voice is not available) ---------- */
.mos-voice-note {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}
.mos-voice-note__box {
  max-width: 520px;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.mos-voice-note__title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #222;
}
.mos-voice-note__text {
  font-size: 14px;
  line-height: 1.35;
  color: #333;
}
.mos-voice-note__btn {
  margin-top: 12px;
  padding: 10px 16px;
  background-color: #A8E1FF;
  color: #93278f;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}
.mos-voice-note__btn:hover { background-color: #7ECFFF; }
/* ---------- SHOW BUTTON VISIBILITY (JS-first, CSS fallback) ----------
   Teacher Main JS v6 toggles showBtn.style.visibility/opacity/pointerEvents.
   These rules are deliberately NOT !important, so JS can always override.
*/
#mos-show{
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
#mos-chat[data-mos-hidden="1"] + #mos-show,
#mos-chat[data-mos-hidden="1"] ~ #mos-show{
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
