body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-image: url('./assets/background-1.15.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #333;
}



/* Screens */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.screen.active {
  display: flex;
}

/* Landing Screen */
#landingScreen .logo {
  display: none;
}

#landingScreen p {
  color: #fff;
  font-size: 26px;
  text-align: center;
  font-weight: bold;
  font-family: 'Segoe UI', sans-serif;
  display: none;
}

#landingScreen h1 {
  display: none;
}

/* Home Screen */
#homeScreen {
  justify-content: center;
  align-items: center;
  height: 100vh;
}


.home-container {
  background-color: rgba(255, 255, 255, 0.5); /* translucent white */
  padding: 40px 32px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 1 / 1;
  margin: auto;
  text-align: center;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#homeScreen.active .home-container {
  opacity: 1;
  transform: translateY(0);
}


#homeScreen .logo {
  display: none;
}

#homeScreen h1 {
  display: none;
}

#homeScreen .form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  gap: 12px;
}

.form-group input {
  padding: 12px 16px;
  text-align: center;
  width: 240px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: border 0.2s ease;
}

.form-group input:focus {
  border-color: #8860d0;
  outline: none;
}

/* Button Group */
#landingScreen .button-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 100px;
  margin-left: -25px;
}

#homeScreen .button-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 40px;
}

.button-group button {
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 600;
  background-color: #8860d0;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.button-group button:hover {
  background-color: #a390e2;
}


/* Layout for video + chat */
/* Main layout container */
.main-content {
  display: flex;
  height: 100vh;
  width: 100%;
  position: relative;
}

/* Video container */
.video-container {
  position: relative;
  flex: 2;
  background-color: black;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Remote video default: primary view */
#remoteVideo {
  width: 80%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  z-index: 2;
  transition: all 0.3s ease;
}

/* Remote video becomes corner preview */
#remoteVideo.minimized {
  position: absolute !important;
  bottom: 20px;
  left: 20px;
  width: 160px;
  height: 120px;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1;
  opacity: 0.7;
  aspect-ratio: unset;
}

/* Local video wrapper default: corner preview */
.local-wrapper {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 160px;
  height: 120px;
  z-index: 5;
  cursor: move;
  border: 2px solid #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

/* Local video becomes primary view */
.local-wrapper.fullscreen {
  position: static !important;
  width: 80%;
  aspect-ratio: 1 / 1;
  height: auto;
  z-index: 2;
  border: none;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Local video inside wrapper */
.local-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 20px;
  padding: 5px 10px;
  cursor: pointer;
  z-index: 5;
}

/* Button pair container for bottom-right alignment */
.button-pair {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.end-btn {
  bottom: 20px;
  right: 20px;
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background 0.3s ease, transform 0.2s ease;
}

.end-btn:hover {
  background: #c0392b;
  transform: scale(1.05);
}

.video-controls {
  display: flex;         /* Aligns buttons horizontally */
  gap: 10px;             /* Adds 10px space between each button */
  margin-top: 10px;      /* Adds space above the button group */
}

#summaryScreen {
  display: none;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #f8f6f0;
}

#summaryScreen.active {
  display: flex;
}

.summary-container {
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#returnHomeBtn {
  background: #2ecc71;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#returnHomeBtn:hover {
  background: #27ae60;
}

.local-wrapper.sharing-active {
  border: 3px solid #f39c12;
  box-shadow: 0 0 12px rgba(243, 156, 18, 0.6);
  transition: box-shadow 0.3s ease;
}

.sharing-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #f39c12;
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: none;
}

.sharing-badge.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chat beside video */
.chat {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background-color: #f8f6f0;
  border-left: 1px solid #8860d0;
  height: 65vh;
  width: 300px;
  box-shadow: 0 1px 6px rgba(136, 96, 208, 0.06);
  border-radius: 14px 0 0 14px;
  margin: auto 0 16px auto;
  transition: all 0.3s ease;
}

#chatBox {
  opacity: 0.65;
}

.chat-messages {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  font-size: 0.95em;
  line-height: 1.4;
  font-weight: bold;
}

.chat-input {
  display: flex;
  padding: 8px;
  border-top: 1px solid #ece6ff;
  background: #fcfbff;
  border-radius: 0 0 0 14px;
}

.chat-input input {
  flex: 1;
  padding: 8px;
  font-size: 0.95em;
  border: 1px solid #dac4f7;
  border-radius: 5px;
  background: #f4f1fa;
  outline: none;
  transition: border 0.2s;
}

.chat-input input:focus {
  border: 1.5px solid #b39ddb;
}

.chat-input button {
  padding: 8px 14px;
  background-color: #8860d0;
  color: white;
  border: none;
  border-radius: 5px;
  margin-left: 8px;
  cursor: pointer;
  font-size: 0.95em;
  transition: background 0.2s;
}

.chat-input button:hover {
  background-color: #a390e2;
}

.message {
  margin-bottom: 8px;
  padding: 6px 10px;
  background-color: #e5e1fa;
  border-radius: 10px;
  max-width: 85%;
  word-wrap: break-word;
  font-size: 0.95em;
  color: #393939;
  box-shadow: 0 1px 3px rgba(136, 96, 208, 0.03);
  border: 1px solid #ede7fa;
}

.chat-toggle-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background-color: #fff;
  border: none;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.chat.collapsed {
  display: none;
}

.pose-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}


@media (max-width: 600px) {
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background: url('./assets/background-1.15.png') center/cover no-repeat;
  }

  .screen,
  .main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    padding: 0;
    box-sizing: border-box;
    flex: 1;
    text-align: center;
  }

  .screen {
    display: none;
  }

  .screen.active {
    display: flex;
  }

  .logo {
    max-width: 80%;
    height: auto;
    margin-bottom: 20px;
    display: none;
  }

  .form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
  }

  .form-group input {
    width: 90%;
    max-width: 300px;
    padding: 10px;
    font-size: 1em;
    box-sizing: border-box;
    text-align: center;
  }

  .button-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .button-group button {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    font-size: 1em;
    touch-action: manipulation;
  }

  .video-container {
    width: 100%;
    position: relative;
    padding-top: 0;
    height: 100vh;
    padding: 0;
    margin: 0;
  }

  #remoteVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
  }

    /* Fullscreen-safe wrapper for local video on mobile */
  #localVideoWrapper {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 100px;
    z-index: 10;
    border: 2px solid white;
    border-radius: 10px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
  }

  #localVideo {
    position: static; /* override absolute from desktop */
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    pointer-events: none;
  }

  .fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2em;
    padding: 8px;
    z-index: 5;
  }

  .chat {
    width: 100%;
    background-color: #f8f6f0;
    border: 1px solid #8860d0;
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 20px;
  }

  .chat-messages {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
  }

  .chat-input {
    display: flex;
    flex-direction: row;
    gap: 10px;
  }

  .chat-input input {
    flex: 1;
    padding: 10px;
    font-size: 1em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-input button {
    padding: 10px;
    font-size: 1em;
    touch-action: manipulation;
  }


  .chat {
    display: none !important;
  }
}