/* Make the video fill the screen, with no extra padding */
body {
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent scrolling */
  height: 100vh;
  font-family: Arial, sans-serif;
  display: grid;
  grid-template-areas:
    "a a"
    "b e"
    "c c"
    "d d";
  justify-items: center;
  align-items: center;
}

body h2 {
  grid-area: a;
}

#video {
  object-fit: cover; /* Makes the video cover the entire screen while maintaining aspect ratio */
  width: 500px;
  height: 375px;
  border: 1px solid black;
  transform: rotateY(180deg);
  z-index: 0;
  display: flex;
  justify-self: center;
  align-self: center;
  grid-area: b;
}
main {
  grid-area: b;
}

#canvas {
  position: absolute;
  top: 78px;
  left: 195px;
  z-index: 1;
  transform: rotateY(180deg);
}

/* Popup background (overlay) */
#popupOverlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  z-index: 1000; /* Ensure it appears above other content */
}

/* Popup container */
#popup {
  background-color: white;
  width: 50vw;
  height: 50vh;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1001;
  text-align: center;
  left: calc(100vw / 5);
  align-self: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}

/* Close button styling */
.closeBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: red;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  cursor: pointer;
}

/* Popup trigger button */
#popupBtn {
  padding: 10px 20px;
  background-color: blue;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  grid-area: c;
}

#expressionDisplay {
  display: flex;
  justify-self: flex-start;
  font-size: 1rem;
  font-family: "Roboto", system-ui;
  font-weight: 400;
  font-style: normal;
  grid-area: d;
  margin: 1rem;
}

#videocap {
  display: none;
}

.emoji {
  border: 1px #fff solid;
  height: 15rem;
  width: 15rem;
  transform: scale(1.5);
  grid-area: e;
  display: flex;
  justify-content: center;
  align-items: center;
}

#capturedImage {
  transform: scaleX(-1);
}
