/* Join Modal Styles - Inline on page */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.join-modal-container {
  display: none;
  position: absolute;
  top: 0;
  z-index: 100;
  flex-direction: column;
  gap: 1rem;
}

.join-modal-container.active {
  display: flex;
  animation: fadeInUp 0.3s ease-out;
  position: relative;
  overflow: visible;
}

/* Кнопка закрытия модалки */
.join-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3), 0 1rem 2rem rgba(0, 0, 0, 0.2);
  z-index: 1000;
  padding: 0;
  margin: 0;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.join-modal-close:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
  transform: translateY(-0.1rem);
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.3), 0 1.5rem 3rem rgba(0, 0, 0, 0.25);
}

.join-modal-close:active {
  transform: translateY(0);
}

.close-icon {
  display: block;
  font-weight: 300;
  line-height: 1;
  font-size: 1.5rem;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.join-modal-block {
  display: flex;
  flex-direction: column;
}

.join-modal-block-1 {
  width: 500px;
  max-width: 100%;
  height: fit-content;
  box-sizing: border-box;
}

.join-modal-block-1 .join-modal-content {
  padding: 0;
}

.join-modal-block-1 .join-modal-body {
  padding: 0;
  gap: 0;
  height: auto;
}

.join-modal-block-2 {
  width: 500px;
  max-width: 100%;
  box-sizing: border-box;
}

.join-modal-content {
  width: 100%;
  max-width: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3), 0 1rem 2rem rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.join-modal-block-2 .join-modal-content {
  padding: 0.5rem;
}

.join-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.join-modal-block-2 .join-modal-body {
  gap: 1.25rem;
}

.join-modal-block-2 .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0;
}

.join-modal-block-2 .form-group label {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  display: block;
}

.join-modal-block-2 .form-group input {
  width: 100%;
  padding: 0.6rem 0.875rem;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.join-modal-block-2 .form-group input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.join-modal-block-2 .form-group input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.join-modal-body label {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
  display: block;
}


.join-modal-body input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 0.5rem;
  color: rgba(255, 215, 0, 0.9);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.join-modal-body input:focus {
  border-color: rgba(255, 215, 0, 0.6);
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.join-modal-body input::placeholder {
  color: rgba(255, 215, 0, 0.6);
}


.device-settings-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(255, 215, 0, 0.9);
  text-align: center;
  margin: 1rem 0 0.5rem 0;
}

.video-preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 400px;
}

.join-modal-block-1 .video-preview-container {
  border-radius: 0.75rem;
  height: auto;
  min-height: auto;
  aspect-ratio: 16 / 9;
}

#preview-video {
  width: 100%;
  height: auto;
  min-height: auto;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.8);
  display: block;
}

.video-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 10;
}

.video-control-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.video-control-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.video-control-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.video-control-btn.muted {
  background: rgba(220, 53, 69, 0.8);
  border-color: rgba(220, 53, 69, 0.6);
}

.control-icon {
  display: block;
}

.device-settings-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.device-settings-title {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 1rem 0;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.join-modal-block-2 .device-settings-title {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.device-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
}

.device-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.device-select:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
}

.device-select:focus {
  outline: none;
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.device-select option {
  background: rgba(0, 0, 0, 0.95);
  color: rgba(255, 255, 255, 0.9);
}

.join-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.join-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-0.05rem);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.join-btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .hero__grid {
    flex-direction: column;
  }

  .join-modal-container {
    flex-direction: column;
    width: calc(100% - 2rem) !important;
    max-width: calc(100% - 2rem) !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    margin: 1rem !important;
    margin-bottom: 1.5rem !important;
    order: -1;
    box-sizing: border-box !important;
  }

  .join-modal-container.active {
    display: flex !important;
    position: relative !important;
    order: -1;
  }

  /* Все кнопки идут после модалки */
  .login-container,
  .hero-card--primary,
  .hero__side {
    order: 1;
  }

  .join-modal-block-1,
  .join-modal-block-2 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .join-modal-content {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .video-control-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .join-modal-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .close-icon {
    font-size: 1.3rem;
  }
}

@media (max-width: 600px) {
  .join-modal-container {
    width: calc(100% - 1.5rem) !important;
    max-width: calc(100% - 1.5rem) !important;
    margin: 0.75rem !important;
    margin-bottom: 1rem !important;
    box-sizing: border-box !important;
  }

  .join-modal-block-1 {
    width: 100%;
  }

  .join-modal-block-1 .video-preview-container {
    height: 300px;
    min-height: 300px;
  }

  #preview-video {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .join-modal-container {
    width: calc(100% - 1rem) !important;
    max-width: calc(100% - 1rem) !important;
    margin: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    box-sizing: border-box !important;
  }

  .join-modal-block-1 .video-preview-container {
    height: 250px;
    min-height: 250px;
  }

  #preview-video {
    min-height: 250px;
  }
}

