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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #1a1a1a;
  min-height: 100vh;
  color: #e8e8e8;
}

.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.welcome-card {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid #a8d8ea;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.welcome-header {
  margin-bottom: 2rem;
}

.welcome-icon {
  font-size: 3rem;
  color: #a8d8ea;
  margin-bottom: 1rem;
}

.welcome-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #e8e8e8;
}

.welcome-header p {
  color: #b8b8b8;
  font-size: 1rem;
}

.welcome-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group i {
  position: absolute;
  left: 1rem;
  color: #a8d8ea;
  z-index: 1;
}

.input-group input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #4a4a4a;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #333;
  color: #e8e8e8;
}

.input-group input:focus {
  outline: none;
  border-color: #a8d8ea;
  box-shadow: 0 0 0 2px rgba(168, 216, 234, 0.2);
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  opacity: 0.9;
}

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

.btn-primary {
  background: #a8d8ea;
  color: #1a1a1a;
  flex: 1;
}

.btn-secondary {
  background: #333;
  color: #a8d8ea;
  border: 2px solid #a8d8ea;
  flex: 1;
}

.btn-chat:hover {
  background: #a8d8ea;
  color: #1a1a1a;
}

.btn-chat {
  border: solid 2px #a8d8ea;
  background: #0000;
  color: #a8d8ea;
  flex: 1;
}

.btn-icon {
  padding: 0.75rem;
  border-radius: 50%;
  background: #4a4a4a;
  color: #e8e8e8;
  width: 35px;
  height: 35px;
}

.btn-small {
  padding: 0.5rem;
  font-size: 0.8rem;
}

.btn-control {
  padding: 1rem;
  border-radius: 50%;
  background: #4a4a4a;
  color: #e8e8e8;
  border: 2px solid #6a6a6a;
  font-size: 1.2rem;
  width: 60px;
  height: 60px;
}

.btn-control.active {
  background: #ffb3ba;
  border-color: #ffb3ba;
  color: #1a1a1a;
}

.video-interface {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  background: #1a1a1a;
  z-index: 100;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #2a2a2a;
  border-bottom: 1px solid #4a4a4a;
}

.room-info {
  color: #e8e8e8;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: #fff3;
}

.top-controls {
  display: flex;
  gap: 1rem;
}

.video-layout {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.local-video-container {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 300px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 2px solid #a8d8ea;
  z-index: 10;
  transition: all 0.3s ease;
}

.local-video-container.minimized {
  width: 150px;
  height: 100px;
  top: 1rem;
  right: 1rem;
}

.local-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.local-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.local-video-container:hover .local-video-overlay {
  opacity: 1;
}

.local-label {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.remote-videos-grid {
  flex: 1;
  display: grid;
  gap: 1rem;
  padding: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-auto-rows: minmax(200px, 1fr);
  align-content: center;
}

.videoContainer {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid #4a4a4a;
  transition: all 0.3s ease;
}

.videoContainer:hover {
  border-color: #a8d8ea;
}

.videoContainer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.videoContainer > div {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 1rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.control-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: #2a2a2a;
  border-top: 1px solid #4a4a4a;
}

.control-group {
  display: flex;
  gap: 1rem;
}

.chat {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.chat-container {
  background: #2a2a2a80;
  width: 100%;
  max-width: 500px;
  height: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid #4a4a4a;
  backdrop-filter: blur(50px);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  color: #1a1a1a;
}

.chat-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.message-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  opacity: 100%;;
}

.message-container::-webkit-scrollbar {
  width: 6px;
}

.message-container::-webkit-scrollbar-track {
  background: #4a4a4a;
}

.message-container::-webkit-scrollbar-thumb {
  background: #a8d8ea;
  border-radius: 3px;
}

.local .message {
  background: #516870;
  border: solid 1px #a8d8ea;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 12px 12px 4px 12px;
  margin: 0.5rem 0;
  margin-left: 2rem;
  text-align: right;
  word-wrap: break-word;
}

.remote {
  margin: 1rem 0;
}

.remote .username {
  font-weight: 600;
  color: #a8d8ea;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.remote .message {
  background: #4a4a4a;
  color: #e8e8e8;
  border: 1px solid #6a6a6a;
  padding: 0.75rem 1rem;
  border-radius: 12px 12px 12px 4px;
  margin-right: 2rem;
  word-wrap: break-word;
}

.input-area {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: #2a2a2a;
  border-top: 1px solid #4a4a4a;
}

.text-input {
  flex-grow: 3;
  padding: 0.75rem 1rem;
  border: 2px solid #4a4a4a;
  border-radius: 20px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #333;
  color: #e8e8e8;
}

.text-input:focus {
  outline: none;
  border-color: #a8d8ea;
  box-shadow: 0 0 0 2px rgba(168, 216, 234, 0.2);
}

.error-pop-up {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.error-message {
  background: #2a2a2a;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 2px solid #ffb3ba;
}

.error-icon {
  font-size: 3rem;
  color: #ffb3ba;
  margin-bottom: 1rem;
}

.error-message #error {
  margin: 1rem 0 2rem 0;
  font-size: 1.1rem;
  color: #e8e8e8;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .welcome-card {
    margin: 1rem;
    padding: 1.5rem;
  }

  .button-group {
    flex-direction: column;
  }

  .local-video-container {
    width: 200px;
    height: 150px;
    top: 1rem;
    right: 1rem;
  }

  .local-video-container.minimized {
    width: 120px;
    height: 80px;
  }

  .remote-videos-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .top-bar {
    padding: 1rem;
  }

  .control-bar {
    padding: 1rem;
  }

  .chat-container {
    margin: 1rem;
    height: calc(100vh - 2rem);
  }
}

@media (max-width: 480px) {
  .welcome-card {
    padding: 1rem;
  }

  .welcome-header h1 {
    font-size: 1.5rem;
  }

  .local-video-container {
    width: 150px;
    height: 100px;
  }

  .local-video-container.minimized {
    width: 100px;
    height: 70px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}
