:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --you: #2563eb;
  --other: #e5e7eb;
}

body.dark {
  --bg: #020617;
  --panel: #020617;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --you: #0284c7;
  --other: #1e293b;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* Screens */
.screen {
  display: none;
  height: 100vh;
  padding: 24px;
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Auth */
input {
  padding: 12px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid var(--other);
}

button {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
}

.error { color: #ef4444; }
.success { color: #22c55e; }
.link {
  color: var(--primary);
  cursor: pointer;
  margin-top: 12px;
}

/* Chat layout */
.chat-layout {
  padding: 0;
}

.chat-header {
  padding: 12px 16px;
  background: var(--panel);
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--other);
}

.chat-body {
  flex: 1;
  display: flex;
  height: calc(100vh - 56px);
}
/* Users List - Updated Look */
/* Users List - Professional Look */
.users {
  width: 220px;
  border-right: 1px solid var(--other);
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border-radius: 0 12px 12px 0;
}

.users button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: var(--other);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  justify-content: space-between;
}

.users button:hover {
  background: var(--primary);
  color: #fff;
}

.users button.active {
  background: var(--primary);
  color: #fff;
}

/* User Avatar & Online Indicator */
.users button::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--muted); /* Placeholder avatar */
}

.users button.online::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e; /* Online green */
  display: inline-block;
  margin-left: 8px;
}

/* Dark Mode Compatibility */
body.dark .users {
  background: var(--panel);
  border-right: 1px solid var(--muted);
}

body.dark .users button {
  background: var(--other);
  color: var(--text);
}

body.dark .users button:hover,
body.dark .users button.active {
  background: var(--primary);
  color: #fff;
}

/* Copy Button - Styled */
.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.message.you .copy-btn,
.message.other .copy-btn {
  background: rgba(255, 255, 255, 0.15);
}

.copy-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Add hover tooltip */
.copy-btn::after {
  content: 'Copy';
  position: absolute;
  bottom: 120%;
  right: 0;
  background: var(--panel);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.copy-btn:hover::after {
  opacity: 1;
}


.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Messages */
.message {
  max-width: 75%;
  padding: 10px 12px;
  border-radius: 14px;
  position: relative;
}

.message.you {
  align-self: flex-end;
  background: var(--you);
  color: #fff;
}

.message.other {
  align-self: flex-start;
  background: var(--other);
}
 

.message:hover .copy-btn {
  display: block;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--other);
}

.chat-input input {
  flex: 1;
}

/* Mobile */
@media (max-width: 768px) {
  .users {
    display: none;
  }

  .message {
    max-width: 90%;
  }
}
