/* Chat Rooms — beryl demo styling */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f8f9fa;
  overflow: hidden;
  height: 100vh;
}

#app {
  display: flex;
  height: 100vh;
}

/* --- Rooms sidebar --- */

#rooms-sidebar {
  width: 200px;
  background: #2b2d31;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

#rooms-sidebar h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #96989d;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

#room-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.room-item {
  padding: 0.4rem 1rem;
  cursor: pointer;
  color: #96989d;
  font-size: 0.9rem;
  border-radius: 4px;
  margin: 1px 0.5rem;
  transition: background 0.15s, color 0.15s;
}

.room-item:hover {
  background: #35373c;
  color: #dbdee1;
}

.room-item.active {
  background: #404249;
  color: #fff;
  font-weight: 500;
}

.room-hash {
  color: #96989d;
  margin-right: 2px;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #3f4147;
}

.powered-by {
  font-size: 0.7rem;
  color: #96989d;
}

.powered-by a {
  color: #7c5cbf;
  text-decoration: none;
}

.powered-by a:hover {
  text-decoration: underline;
}

/* --- Chat area --- */

#chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

#chat-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}

#chat-header h1 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

#chat-header h1::before {
  content: "# ";
  color: #96989d;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.message {
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.message.system {
  color: #96989d;
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.25rem 0;
}

.message.user .msg-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.msg-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.msg-time {
  font-size: 0.7rem;
  color: #96989d;
}

.msg-text {
  font-size: 0.9rem;
  color: #333;
  word-wrap: break-word;
}

.msg-error {
  color: #e74c3c;
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 0.75rem;
}

/* --- Typing indicator --- */

#typing-indicator {
  min-height: 1.25rem;
  padding: 0 1rem;
  font-size: 0.75rem;
  color: #96989d;
  font-style: italic;
}

/* --- Message form --- */

#msg-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}

#msg-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

#msg-input:focus {
  border-color: #7c5cbf;
}

#msg-input:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
}

#send-btn {
  padding: 0.5rem 1rem;
  background: #7c5cbf;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

#send-btn:hover:not(:disabled) {
  background: #6a4dab;
}

#send-btn:disabled {
  background: #c0c0c0;
  cursor: not-allowed;
}

/* --- Users sidebar --- */

#users-sidebar {
  width: 180px;
  background: #f8f9fa;
  border-left: 1px solid #e0e0e0;
  padding: 1rem;
  overflow-y: auto;
}

#users-sidebar h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #96989d;
  margin-bottom: 0.75rem;
}

#user-list {
  list-style: none;
}

#user-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: #333;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-typing {
  font-size: 0.7rem;
  color: #96989d;
  margin-left: auto;
}
