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

/* 1) Re-add the overall font + dark background */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  height: 100vh;
  flex-direction: column;
  overflow: hidden;

  font-family: sans-serif;   /* Restores your original font choice */
  color: #E0E0E0;            /* Light text on dark background */
  background: #2D2D30;       /* Dark grey background overall */
}

/* 2) #appContainer => dark grey, plus the transform origin */
#appContainer {
  width: 1857px;
  height: 658px;
  transform-origin: top left;
  background: #2D2D30; /* Keep same dark grey behind everything */

}

button {
  all: unset;
  cursor: pointer;
}
button:disabled,
button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===============================
   1) LANDING (Login) Page
   =============================== */
   .landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* This will center it vertically */
    
    width: 100%;
    height: 75%; /* Make sure it takes full screen height */
    
    background: #3A3A3F;
    border: 1px solid #000000;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    
    max-width: 400px;
    margin: auto; /* Ensures horizontal & vertical centering */
  /* Reset padding so content is not pushed down */
    
    position: absolute; /* Make it absolute so it centers properly */
    top: 50%; /* Move it down by 50% of the viewport height */
    left: 50%; /* Move it to the center */
    transform: translate(-50%, -50%); /* Perfect centering */
    
    text-align: center;
    gap: 15px; /* Adds spacing between elements */
}
.landingLogo img {
  width: 240px; /* Originally 80px, now 3x */
  height: auto;
  padding: 20px;
  margin-bottom: 20px; /* More spacing */
}
.landingForm {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center; /* Ensure inputs are centered */
  gap: 10px;
}
.landingForm input {
  width: 80%; /* Make all inputs the same width */
  padding: 6px;
  font-size: 1rem;
  text-align: center;
  background: #57575C;
  color: #FFF;
  border: 1px solid #000000;
  border-radius: 4px;
}
.landingForm label {
  font-weight: bold;
  text-align: center;
}
.colorSquares {
  display: flex;
  justify-content: center;
  gap: 4px;
}

/* Ensure color squares are aligned */
.colorSquare {
  width: 30px; 
  height: 30px;
  border: 1px solid #000000;
  border-radius: 4px;
  cursor: pointer;
}
.colorSquare.disabled {
  opacity: 0.3;
  pointer-events: none;
}
#joinBtn {
  width: 80%; /* Matches input field width */
  background: #CCC;
  color: #000;
  padding: 6px;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.2s, transform 0.2s;
  text-align: center;
  border: 1px solid #000000;
  border-radius: 4px;
}
#joinBtn:hover {
  background: #BBB;
  transform: scale(1.03);
}
#joinError {
  margin-top: 6px;
  color: red;
  font-weight: bold;
}

/* ===============================
   2) MAIN APP LAYOUT
   =============================== */
#mainApp {
  display: none; /* flex after login - none to hide */
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

/* HEADER BAR */
#headerBar {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px;

  background: #2D2D30;
  width: fit-content;
  margin: 6px auto;
}
.headerPanel {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #3A3A3F;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px;
}
.headerBtn {
  width: 150px;
  height: 35px;
  background: #CCC;
  color: #000;
  border: 1px solid #000000;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s, transform 0.2s;
}
.headerBtn:hover {
  background: #BBB;
  transform: scale(1.03);
}
.headerBtn.off {
  background: #ff6666 !important;
  border-color: #ff3333 !important;
  color: #000;
}
.headerBtn::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
}

/* LOGOUT MODAL */
#logoutModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #3A3A3F;
  border: 1px solid #000000;
  border-radius: 6px;
  padding: 10px;
  display: none;
  z-index: 9999;
}
#logoutModal h3 {
  margin-bottom: 8px;
  text-align: center;
  font-size: 1.1rem;
}
#logoutModal button {
  background: #CCC;
  color: #000;
  padding: 6px 12px;
  margin: 0 4px;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.2s, transform 0.2s;
}
#logoutModal button:hover {
  background: #BBB;
  transform: scale(1.03);
}
#videoWrapper {
  height: 658px; /* Match default grid height */
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background: #3A3A3F;
  overflow: hidden;
}

#videosGrid {
  width: 100%;
  height: 100%;
  display: block; /* We'll override to "grid" in JS */
  background: #2D2D30;
  position: relative; /* not strictly necessary */
}



.layout1 {
  display: grid;
  /* 2 columns, 2 rows */
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;

  /* occupant #1 => covers entire 2×2 */
  grid-template-areas:
    "slot1 slot1"
    "slot1 slot1";
}

/* layout2 => occupant #1 is left, occupant #2 is right (2×2, but #1 spans top+bottom left, #2 spans top+bottom right) */
.layout2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;

  grid-template-areas:
    "slot1 slot2"
    "slot1 slot2";
}

/* layout3 => occupant #1 top-left, occupant #2 top-right, occupant #3 bottom-left, bottom-right is empty */
.layout3 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;

  /* The bottom-right is a "." to show empty space */
  grid-template-areas:
    "slot1 slot2"
    "slot3 .";
}

/* layout4 => a normal 2×2 grid for 4 occupants */
.layout4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;

  grid-template-areas:
    "slot1 slot2"
    "slot3 slot4";
}

/* layout5 => a 3×2 for 5 occupants (last cell can be empty or repeated) */
.layout5 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;

  /* Example: slot1,2,3 on top row, slot4,5 on bottom row, with a "." for the 6th cell */
  grid-template-areas:
    "slot1 slot2 slot3"
    "slot4 slot5 .";
}

/* layout6 => a 3×2 for 6 occupants (slots 1..6) */
.layout6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;

  grid-template-areas:
    "slot1 slot2 slot3"
    "slot4 slot5 slot6";
}


/* Named areas for seat1..seat6 */
#slot1VideoFrame { grid-area: slot1; }
#slot2VideoFrame { grid-area: slot2; }
#slot3VideoFrame { grid-area: slot3; }
#slot4VideoFrame { grid-area: slot4; }
#slot5VideoFrame { grid-area: slot5; }
#slot6VideoFrame { grid-area: slot6; }

/* By default, we can hide everything or let JS do the hiding. */
.videoFrame {
  position: relative;
  background: #2D2D30 url("images/site/ACwallpaper.png") center center / cover no-repeat;
  border: 1px solid #000;
  border-radius: 6px;
  width: 100%;
  height: 100%;
  display: none; /* hide by default, JS shows seats in use */
}

.videoFrame video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Mute badges => top-right corner */
.muteBadgeGroup {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 120px;
  height: 28px;
}
.muteBadge {
  position: absolute;
  width: 28px;
  height: 28px;
  background: #ff6666;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.muteBadge::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 28px;
}
/* Offsets for Cam=84, Mic=56, Spk=28, Sfx=0 from right */
#badgeCamOffSeat1, #badgeCamOffSeat2, #badgeCamOffSeat3,
#badgeCamOffSeat4, #badgeCamOffSeat5, #badgeCamOffSeat6 {
  right: 84px;
}
#badgeMicOffSeat1, #badgeMicOffSeat2, #badgeMicOffSeat3,
#badgeMicOffSeat4, #badgeMicOffSeat5, #badgeMicOffSeat6 {
  right: 56px;
}
#badgeSpkOffSeat1, #badgeSpkOffSeat2, #badgeSpkOffSeat3,
#badgeSpkOffSeat4, #badgeSpkOffSeat5, #badgeSpkOffSeat6 {
  right: 28px;
}
#badgeSfxOffSeat1, #badgeSfxOffSeat2, #badgeSfxOffSeat3,
#badgeSfxOffSeat4, #badgeSfxOffSeat5, #badgeSfxOffSeat6 {
  right: 0;
}

/* seatNameOverlay => top-left */
.seatNameOverlay {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #CCC;
  color: #000;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.9rem;
  font-weight: bold;
  display: none;
  z-index: 5;
  display: flex; 
  align-items: center;
  gap: 4px;
}
.seatNameOverlay::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background: url("images/icons/user.svg") no-repeat center/contain;
}
.seatNameOverlay.raised::before {
  background: url("images/icons/hand.svg") no-repeat center/contain;
}

.seatEffectOverlay {
  position: absolute;
  overflow: hidden;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: flex-end; 
  justify-content: flex-end;
  pointer-events: none;
  z-index: 10;
  padding: 4px;
}
#controlPanelWrapper {
  flex: 0 0 auto; /* Ensures it does not overlap the videoWrapper */
  width: 100%;
  background: #2D2D30;
  border-top: 2px solid #444;
  padding: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===============================
   5) CONTROL PANELS & BUTTONS
   =============================== */
   #videoControlsRow {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    padding: 2px;
    width: 100%;
  }
/* Adjust control panels to fit in two rows */
.controlsPanel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1px; /* Less spacing */
  padding: 1px; /* Reduce padding */
}

.controlsPanel .iconBtn {
  width: 100px;
  height: 50px;
  background: #CCC;
  color: #000;
  border: 1px solid #000000;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.controlsPanel .grid1x2 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  padding: 2px;
  border: 2px solid #3A3A3F;
}



.controlsPanel .grid3x2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  padding: 2px;
  border: 2px solid #3A3A3F;
}

.controlsPanel .grid4x2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  padding: 2px;
  border: 2px solid #3A3A3F;
}

.controlsPanel .grid2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  padding: 2px;
  border: 2px solid #3A3A3F;
}

/* .iconBtn => reduce from 70×70 => 50×50 */

.iconBtn:hover {
  background: #BBB;
  transform: scale(1.05);
}
.iconBtn.off {
  background: #ff6666 !important;
  border-color: #ff3333 !important;
  color: #000;
}
.iconBtn::before {
  content: "";
  display: block;
  width: 20px; /* keep icons ~20px */
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  margin-right: 4px; /* Add spacing between icon and text */
}

/* seatBtn => bigger font, black text, user icon => can be disabled if seat not used */
.seatBtn {
  font-size: 12px;
  color: #000;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seatBtn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Sound/effect popups, etc. */
.seatEffectCard {
  display: flex;
  color: #000;    
  flex-direction: column;
  align-items: center;
  background: #CCC;
  border-radius: 4px;
  width: 100%;
  padding: 6px;
  box-sizing: border-box;
}
.seatEffectCard img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.seatEffectTitleBar {
  width: 100%;
  display: flex;
  font-weight: bold;
  align-items: center;
  justify-content: space-between;
  background: #CCC;
  margin-bottom: 4px;
}
.seatSoundCard {
  width: 140px;
  background: #888;
  color: #000;
  border-radius: 4px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  font-size: 12px;
  font-weight: bold;
  text-align: left;
}
.seatSoundOuter {
  width: 160px;
  min-height: 30px;
  color: #000;
  border-radius: 4px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  background: #888;
}
.seatSoundTitleBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #CCC;
  font-weight: bold;
  color: #000;
  height: 32px;
  padding: 2px 6px;
}
.seatEffectOuter {
  width: 260px;
  max-height: 200px; 
  min-height: 160px;
  color: #000;
  border-radius: 4px;
  padding: 6px;
  pointer-events: auto;
}

/* PiP overlay => bottom-right (unused) */
#pipOverlay {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 320px;
  height: 180px;
  border: 2px solid #000000;
  border-radius: 4px;
  background: #000;
  display: none;
  z-index: 999;
}
#pipOverlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===============================
   6) CHAT / HELP Modals
   =============================== */
.modalPanel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  background: #3A3A3F;
  border: 2px solid #000000;
  border-radius: 6px;
  padding: 6px;
  z-index: 9999;
}
.modalContent {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
.modalCloseBtn {
  margin-left: auto;
  background: #CCC;
  color: #000;
  border: 1px solid #000000;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
}
.modalCloseBtn:hover {
  background: #BBB;
}
#adminModal {
  width: 600px;
  height: 600px;
  display: none;
}
#adminModal .modalContent {
  flex: 1;
}
#chatPanel {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
#chatBox {
  flex: 1;
  background: #1F1F23;
  border: 1px solid #000000;
  border-radius: 4px;
  padding: 6px;
  color: #000;
  overflow-y: auto;
}
#chatInputRow {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#chatTitleBtn {
  width: 180px;
  font-size: 1rem;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===============================
   7) ICON REFERENCES
   =============================== */
.icon-portal::before   { background-image: url("images/site/ac-logo.png"); background-size: contain; }
.icon-cam-on::before   { background-image: url("images/icons/video-on.svg"); }
.icon-cam-off::before  { background-image: url("images/icons/video-off.svg"); }
.icon-mic-on::before   { background-image: url("images/icons/mic.svg"); }
.icon-mic-off::before  { background-image: url("images/icons/mic-off.svg"); }
.icon-spk-on::before   { background-image: url("images/icons/volume-on.svg"); }
.icon-spk-off::before  { background-image: url("images/icons/volume-off.svg"); }
.icon-sfx-on::before   { background-image: url("images/icons/sfx-on.svg"); }
.icon-sfx-off::before  { background-image: url("images/icons/sfx-off.svg"); }
.icon-timer::before    { background-image: url("images/icons/timer.svg"); }
.icon-za::before       { background-image: url("images/icons/za.svg"); }
.icon-us::before       { background-image: url("images/icons/us.svg"); }
.icon-date::before     { background-image: url("images/icons/calendar-days.svg"); }
.icon-raise::before    { background-image: url("images/icons/hand.svg"); }
.icon-user::before     { background-image: url("images/icons/user.svg"); }
.icon-logout::before   { background-image: url("images/icons/log-out.svg"); }
.icon-layout::before   { background-image: url("images/icons/layout.svg"); }
.icon-grid::before     { background-image: url("images/icons/layout-grid.svg"); }
.icon-pip::before      { background-image: url("images/icons/pip.svg"); }
.icon-vfx::before      { background-image: url("images/icons/video-effect.svg"); }
.icon-roll::before     { background-image: url("images/icons/dices.svg"); }
.icon-ping::before     { background-image: url("images/icons/message-circle-warning.svg"); }
.icon-help::before     { background-image: url("images/icons/circle-help.svg"); }
.icon-chat::before     { background-image: url("images/icons/message-square-text.svg"); }
.icon-plus::before     { background-image: url("images/icons/square-plus.svg"); }
.icon-minus::before    { background-image: url("images/icons/square-minus.svg"); }
.icon-play::before     { background-image: url("images/icons/square-play.svg"); }
.icon-x::before        { background-image: url("images/icons/square-x.svg"); }

/* Hand-raise blinking animation */
@keyframes blink-bg {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
.blinkSeat {
  animation: blink-bg 1s infinite;
}
.soundIcon {
  width: 28px;
  height: 28px;
  display: inline-block;
}
