/* Global Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(45deg, #b5ead7 0%, #c7ceff 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

/* Header Styles */
#Top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 90%;
  padding: 15px 25px;
  background-color: #40a798;
  border-radius: 15px;
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

#Top h1 {
  flex-grow: 1;
  text-align: center;
  margin: 0;
  color: white;
}

#Top p {
  margin: 0;
  padding-right: 30px;
  color: rgba(255, 255, 255, 0.9);
}

#Top #disconnectButton {
  background: rgb(236, 48, 48);
  color: white;
  border-radius: 15%;
  padding: 10px;
  font-weight: bold;
  font-size: 20px;
}

#Top #disconnectButton:hover {
  background-color: rgb(255, 0, 0);
}

#room-id {
  font-weight: bold;
  color: #f5faf8;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Chat Container */
#chat {
  width: 100%;
  max-width: 90%;
  height: calc(100vh - 300px);
  min-height: 400px;
  border: none;
  border-radius: 15px;
  overflow-y: auto;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Custom Scrollbar */
#chat::-webkit-scrollbar {
  width: 8px;
}

#chat::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

#chat::-webkit-scrollbar-thumb {
  background: #40a798;
  border-radius: 4px;
}

/* Message Bubbles */
.sent, .received {
  padding: 12px 18px;
  border-radius: 20px;
  margin: 8px 0;
  max-width: 75%;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

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

.sent {
  align-self: flex-end;
  background-color: #40a798;
  color: white;
}

.received {
  align-self: flex-start;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.system {
  align-self: center;
  font-size: 0.85em;
  color: #666;
  margin: 8px 0;
  font-style: italic;
  background: rgba(0, 0, 0, 0.05);
  padding: 5px 15px;
  border-radius: 15px;
}

/* Input Container */
#input-container {
  width: 100%;
  max-width: 90%;
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#messageInput {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 25px;
  font-size: 1em;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#messageInput:focus {
  outline: none;
  box-shadow: 0 2px 15px rgba(64, 167, 152, 0.2);
}

#sendButton, #fileButton {
  padding: 12px 25px;
  border: none;
  background-color: #40a798;
  color: white;
  font-size: 1em;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#fileButton {
  padding: 12px 20px;
  font-size: 1.2em;
}

/* Video Container */
#video-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

video {
  width: 48%;
  border-radius: 15px;
  background-color: #000;
}

/* Call Buttons */
#call-buttons, #Video-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 90%;
  margin: 10px 0;
}

#startCallButton, #endCallButton, #shareScreenButton, #endScreenShareButton {
  padding: 12px 25px;
  border: none;
  background-color: #40a798;
  color: white;
  font-size: 1em;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#endCallButton, #endScreenShareButton {
  background-color: #ff3b3b;
}

/* File Attachments */
.sent-file, .received-file {
  max-width: 70%;
  max-height: 200px;
  border-radius: 10px;
  margin-top: 5px;
  object-fit: contain;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.by-text {
  font-size: 12px;
  font-style: italic;
  color: gray; 
  margin-top: -10px;
  display: block; 
}
