/*
 * WP Joinly Global Styles
 * Version: 2025.07.17-01
 * Updated: 2025-07-17
 * Author: Rabin, September and Pro Webmaster Team
 * Notes: Chat input always bottom, sidebar styling, code clean-up
 */

:root {
  --wpj_white: #ffffff;
  --wpj_background: #222222;
  --wpj_body: #525969;
  --wpj_sec3: #f9f3e7;
  --wpj_black: #000000;
  --wpj_primary: #007afd;
  --wpj_allert: #ef2525;
  --wpj_container-width: 1100px;
  --wpj_container-padding: 24px;
}
 
body.has-wpjoinly-lobby {
  color: var(--wpj_black);
}

.wpjoinly-lobby-container {
  max-width: 1200px;
  width: 100%;
  padding: 2rem;
  margin: 0 auto;
}

.wpjoinly-video-container {
  background-color: var(--wpj_black);
  border-radius: 8px;
  height: 400px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.wpjoinly-control-buttons {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.wpjoinly-control-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

.wpjoinly-control-button svg {
  width: 36px;
  height: 36px;
}

.wpjoinly-control-button.muted {
  background-color: #ff4d4d !important;
}

.wpjoinly-device-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  max-width: 100%;
  border-top: 1px solid #333;
  padding-top: 10px;
  margin-top: 10px;
}

.wpjoinly-device-dropdown {
  flex: 1;
  min-width: 30%;
  position: relative;
  width: 100%;
}

.wpjoinly-device-option {
  background-color: #2a2a2a;
  border: 1px solid #444;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px 12px;
  width: 100%;
  text-align: left;
  border-radius: 4px;
}

.wpjoinly-device-option span {
  flex-grow: 1;
  text-align: left;
  font-size: 12px;
}

.wpjoinly-device-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
}

.wpjoinly-device-dropdown.show .wpjoinly-device-dropdown-content {
  display: block;
}

.wpjoinly-device-dropdown-content button {
  width: 100%;
  font-size: 10px;
  text-align: left;
  background: none;
  border: none;
  color: white;
  padding: 8px;
  cursor: pointer;
}

.wpjoinly-device-dropdown-content button:hover {
  background-color: #444;
}

/*
* =============== Meeting Room ===============
*/
.wpjoinly-meeting-container {
  background-color: #111;
  color: white;
  height: 70vh;
  display: flex;
  flex-direction: column;
}

.wpjoinly-meeting-header {
  background-color: #1d1d1d;
  padding: 10px 15px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #333;
}

.wpjoinly-meeting-controls button {
  color: white;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-left: 10px;
}

.wpjoinly-meeting-content {
  display: flex;
  flex-grow: 1;
  position: relative;
}

.wpjoinly-video-section {
  display: flex;
  width: 100%;
  height: 100%;
}

.wpjoinly-main-video {
  background-color: black;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wpjoinly-user-video-container {
  display: none;
  flex-direction: column;
  width: 0;
  background-color: #1a1a1a;
}

.wpjoinly-user-video-container > div {
  width: 100%;
  background-color: #000;
}

.wpjoinly-video-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1d1d1d;
  background-image: linear-gradient(to right, #1d1d1d, #2d2d2d);
}

.wpjoinly-meeting-footer {
  padding: 15px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.wpjoinly-meeting-footer button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #333;
  color: white !important;
  border: none;
  background-color: #333 !important;
}

.wpjoinly-meeting-footer button#leave-meeting {
  background-color: #e32929 !important;
}

.wpjoinly-meeting-footer button:hover {
  background-color: #fac4bc !important;
}

.wpjoinly-meeting-footer button.off {
  background-color: #e32929 !important;
}

.wpjoinly-meeting-footer button.muted {
  background-color: #e32929 !important;
  color: white;
}

.wpjoinly-meeting-footer button.sharing {
  background-color: #007afd !important;
}

.wpjoinly-sidebar {
  width: 250px;
  background-color: white;
  color: #333;
  display: none;
  flex-direction: column;
  transition: transform 0.3s ease-in-out;
  transform: translateX(100%);
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.wpjoinly-sidebar.show {
  transform: translateX(0);
}

.wpjoinly-sidebar-header {
  padding: 15px;
  background-color: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eaeaea;
  font-weight: bold;
}

.wpjoinly-sidebar-header button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #333;
}

.wpjoinly-user-list {
  padding: 10px 15px;
  flex-grow: 1;
  overflow-y: auto;
}

.user-item {
  padding: 10px 0;
  border-bottom: 1px solid #eaeaea;
}

.wpjoinly-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1f1f1f;
  color: #fff;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.4s ease-out;
  z-index: 9999;
  margin-top: 10px;
}
.wpjoinly-toast-actions button {
  margin-left: 10px;
  font-size: 16px;
}
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.wpjoinly-username {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 12px;
  padding: 2px 4px;
}

.speaking {
  outline: 3px solid #00d084;
}

/* Responsive layout */
.wpjoinly-user-video-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.wpjoinly-user-video-box {
  position: relative;
  flex: 1 1 45%;
  max-width: 45%;
  aspect-ratio: 16 / 9;
}
@media screen and (max-width: 768px) {
  .wpjoinly-user-video-box {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

.video-paused::after {
  content: "Video paused";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

#wpjoinly-uname {
  border: solid 2px var(--wpj_body);
}