* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0f1115;
  color: #eaeaea;
}

header {
  padding: 20px;
  text-align: center;
  background: #151922;
  font-size: 24px;
  font-weight: bold;
  position: relative;
}

/* ===== CHAT PAGE ===== */

.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 25px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
  height: calc(100vh - 140px);
}

/* SIDEBAR */

.chat-sidebar {
  background: linear-gradient(145deg, #1c2230, #171c26);
  border-radius: 18px;
  padding: 18px;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(0,0,0,0.4);
}

.chat-user {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.chat-user:hover {
  background: #232a3b;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.chat-user.active {
  background: #232a3b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a3245, #222838);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  letter-spacing: 1px;
}

.chat-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chat-name {
  font-size: 14px;
}

.chat-last {
  font-size: 12px;
  opacity: 0.5;
}

/* CONTENT */

.chat-content {
  background: linear-gradient(145deg, #1c2230, #171c26);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.chat-header {
  padding: 18px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

/* MESSAGES */

.msg {
  max-width: 65%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  transition: transform 0.2s ease;
}

.msg.left {
  background: #232a3b;
  align-self: flex-start;
}

.msg.right {
  background: #2a3245;
  align-self: flex-end;
}

.msg:hover {
  transform: translateY(-2px);
}

/* INPUT */

.chat-input {
  display: flex;
  gap: 12px;
  padding: 18px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,0.04);
}

.chat-input input {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: #232a3b;
  color: #eaeaea;
  outline: none;
}

.chat-input button {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: #2a3245;
  color: #eaeaea;
  opacity: 0.6;
  cursor: not-allowed;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
}
footer {
  text-align: center;
  padding: 15px;
  font-size: 12px;
  opacity: 0.6;
}