/* GLOBAL */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #050509;          /* almost black */
  font-family: system-ui, sans-serif;
  color: #f4f4f5;               /* soft white */
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  width: 100vw;
  height: 100vh;
  background: #050509;
}

/* SIDEBAR */

.sidebar {
  background: #0b0b10;          /* deep grey-black */
  border-right: 1px solid #15151c;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  background: #18181b;          /* neutral dark */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e4e4e7;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
}

.self-username {
  font-size: 0.85rem;
  color: #a1a1aa;
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #71717a;
  margin-top: 10px;
}

.add-friend {
  display: flex;
  gap: 8px;
}

.add-friend input {
  flex: 1;
  background: #0b0b10;
  border: 1px solid #18181f;
  border-radius: 6px;
  padding: 8px 10px;
  color: #f4f4f5;
  font-size: 0.85rem;
}

.request-list,
.friend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.request-item,
.friend-item {
  padding: 8px 10px;
  border-radius: 6px;
  background: #0f0f14;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a1a1aa;
  font-size: 0.85rem;
}

.friend-item {
  cursor: pointer;
}

.friend-item:hover {
  background: #18181b;
}

.request-actions button {
  margin-left: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
}

/* CHAT AREA */

.chat {
  display: flex;
  flex-direction: column;
  background: #050509;
}

/* HEADER */

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid #15151c;
  background: #050509;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
}

.chat-title {
  font-size: 1rem;
  font-weight: 600;
  color: #e4e4e7;
}

.chat-subtitle {
  font-size: 0.8rem;
  color: #71717a;
}

/* MESSAGES */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: flex;
  gap: 10px;
}

.message.self {
  flex-direction: row-reverse;
}

.avatar.small {
  width: 32px;
  height: 32px;
  background: #18181b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e4e4e7;
}

.message-body {
  background: #0f0f14;          /* dark grey */
  border: 1px solid #18181f;
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 70%;
}

.message.self .message-body {
  background: #14141b;
}

.message-meta {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: #71717a;
  margin-bottom: 4px;
}

.message-text {
  font-size: 0.9rem;
  color: #e4e4e7;
}

/* INPUT BAR */

.chat-input {
  padding: 12px 16px;
  border-top: 1px solid #15151c;
  background: #050509;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input input {
  flex: 1;
  background: #0b0b10;
  border: 1px solid #18181f;
  border-radius: 8px;
  padding: 10px 12px;
  color: #f4f4f5;
  font-size: 0.9rem;
}

.chat-input input::placeholder {
  color: #52525b;
}

.chat-input input:focus {
  border-color: #3f3f46;        /* subtle grey accent */
  background: #0f0f14;
}

/* BUTTONS */

.icon-btn {
  background: #0b0b10;
  border: 1px solid #18181f;
  color: #a1a1aa;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.8rem;
}

.icon-btn:hover {
  background: #14141b;
}

.send-btn {
  background: #18181f;          /* dark neutral, not blue */
  border: 1px solid #27272f;
  color: #f4f4f5;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.send-btn:hover {
  background: #20202a;
}

/* AUTH OVERLAY */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: #000000cc;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.auth-card {
  background: #0b0b10;
  padding: 30px;
  border-radius: 12px;
  width: 320px;
  text-align: center;
  border: 1px solid #18181f;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-tabs button {
  flex: 1;
  padding: 10px;
  background: #18181f;
  border: none;
  color: #f4f4f5;
  border-radius: 6px;
  cursor: pointer;
}

.auth-tabs .active {
  background: #27272f;
}

.auth-form input {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  background: #0b0b10;
  border: 1px solid #18181f;
  border-radius: 6px;
  color: #f4f4f5;
}

.auth-form button {
  width: 100%;
  padding: 10px;
  background: #18181f;
  border: 1px solid #27272f;
  color: #f4f4f5;
  border-radius: 6px;
  cursor: pointer;
}
