/* Basic reset */
* {
  box-sizing: border-box;
}
body {
  margin: 0; 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #121212;
  color: #cfd8dc;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

/* Screens */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  padding: 20px;
  animation: fadeIn 0.5s ease forwards;
}
.active {
  display: flex;
}

/* Buttons */
.glow-button {
  background: #0d47a1;
  border: none;
  color: white;
  padding: 12px 25px;
  margin: 15px 5px 0 0;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 8px #0d47a1, 0 0 20px #1976d2;
  transition: all 0.3s ease;
  user-select: none;
}
.glow-button:hover {
  box-shadow: 0 0 15px #42a5f5, 0 0 30px #90caf9;
  transform: scale(1.05);
}
.small-btn {
  padding: 8px 15px;
  font-size: 14px;
}

/* Inputs */
input {
  background: #212121;
  border: 2px solid #0d47a1;
  color: #cfd8dc;
  padding: 12px 15px;
  margin: 10px 0;
  border-radius: 8px;
  font-size: 16px;
  width: 260px;
  transition: border-color 0.3s ease;
}
input:focus {
  outline: none;
  border-color: #42a5f5;
  box-shadow: 0 0 8px #42a5f5;
}

/* Error Text */
.error-text {
  color: #ef5350;
  font-weight: bold;
  margin-top: 5px;
}

/* Chat Layout */
#chat-container {
  display: flex;
  width: 100%;
  gap: 20px;
  margin-bottom: 15px;
  height: 70vh;
}
.chat-panel {
  flex: 1;
  background: #1e1e1e;
  border-radius: 12px;
  padding: 15px;
  max-height: 100%;
  overflow-y: auto;
  box-shadow: 0 0 10px #0d47a1;
  display: flex;
  flex-direction: column;
}
.chat-panel h2 {
  margin-top: 0;
  color: #42a5f5;
  user-select: none;
  margin-bottom: 10px;
}

/* Messages */
#dm-messages, #group-messages {
  font-size: 14px;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 5px;
}
#dm-messages div, #group-messages div {
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #263238;
  border-radius: 12px;
  user-select: text;
  transition: background 0.3s ease;
  max-width: 85%;
  word-wrap: break-word;
}
#dm-messages div:hover, #group-messages div:hover {
  background: #37474f;
}

/* Members list */
#members {
  flex-grow: 1;
  overflow-y: auto;
}
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #263238;
  border-radius: 12px;
  cursor: default;
  user-select: none;
  transition: background 0.3s ease;
}
.member:hover {
  background: #37474f;
}
.member .pen-badge {
  width: 40px;
  height: 40px;
  background: #42a5f5;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  text-transform: uppercase;
  box-shadow: 0 0 8px #0d47a1;
}

/* Pen Name text next to badge */
.member .pen-name {
  font-weight: 600;
  font-size: 16px;
  color: #cfd8dc;
}

/* Message box */
#message-box, #group-message-box {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 1100px;
  margin-top: 10px;
}
#messageInput, #groupMessageInput {
  flex: 1;
  border-radius: 8px;
  border: 2px solid #0d47a1;
  padding: 10px 15px;
  font-size: 16px;
  background: #212121;
  color: #cfd8dc;
  transition: border-color 0.3s ease;
}
#messageInput:focus, #groupMessageInput:focus {
  border-color: #42a5f5;
  box-shadow: 0 0 8px #42a5f5;
}

/* Animations */
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}
