/* General layout */
body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background-color: #1e1e1e;
  color: #f0f0f0;
}

#chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top Panel */
#top-panel {
  display: flex;
  flex-direction: column;
  background-color: #2c2c2c;
  padding: 10px;
  border-bottom: 1px solid #444;
}

#user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

#user-info span {
  font-weight: bold;
  color: #00aaaa;
}

#user-info button {
  background-color: #00aaaa;
  border: none;
  color: #000;
  padding: 6px 10px;
  margin-left: 10px;
  border-radius: 4px;
  cursor: pointer;
}

#user-info button:hover {
  background-color: #008888;
}

#user-info label {
  margin-left: 20px;
  font-size: 0.9em;
}

#buddy-list {
  display: flex;
  justify-content: space-between;
}

#buddy-list h2 {
  font-size: 1em;
  margin: 0 0 5px 0;
}

#buddy-list ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  width: 48%;
  background-color: #1b1b1b;
  border: 1px solid #444;
  border-radius: 4px;
  max-height: 120px;
  overflow-y: auto;
}

#buddy-list li {
  padding: 5px 10px;
  border-bottom: 1px solid #333;
  cursor: pointer;
}

#buddy-list li:hover {
  background-color: #333;
}

#buddy-list li.online {
  color: #00ffaa;
}

#buddy-list li.offline {
  color: #888;
}

/* Center Panel */
#center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;
  background-color: #121212;
}

#chat-header {
  font-weight: bold;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid #333;
  color: #00aaaa;
}

#message-log {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background-color: #181818;
  border: 1px solid #333;
  border-radius: 4px;
}

.message {
  margin-bottom: 10px;
  line-height: 1.4;
}

.message .meta {
  font-size: 0.85em;
  color: #999;
}

.message .sender {
  font-weight: bold;
  color: #00aaaa;
}

.message .content {
  margin-left: 10px;
  color: #f0f0f0;
  word-wrap: break-word;
}

/* Bottom Panel */
#bottom-panel {
  display: flex;
  flex-direction: column;
  padding: 10px;
  background-color: #2c2c2c;
  border-top: 1px solid #444;
}

#typing-indicator {
  height: 18px;
  font-size: 0.85em;
  color: #888;
  margin-bottom: 5px;
}

#message-input {
  width: 100%;
  height: 60px;
  resize: none;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #1e1e1e;
  color: #f0f0f0;
  padding: 8px;
  margin-bottom: 5px;
  font-size: 1em;
}

#send-button {
  align-self: flex-end;
  background-color: #00aaaa;
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

#send-button:hover {
  background-color: #008888;
}

/* Responsive */
@media (max-width: 600px) {
  #buddy-list {
    flex-direction: column;
  }

  #buddy-list ul {
    width: 100%;
    margin-bottom: 10px;
  }

  #user-info {
    flex-direction: column;
    align-items: flex-start;
  }

  #user-info button,
  #user-info label {
    margin-left: 0;
    margin-top: 5px;
  }
}
