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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }
.error { color: #ff6b6b; margin-top: 0.5rem; font-size: 0.85rem; }

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #0f0f23;
}

.login-box {
  background: #1a1a2e;
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid #2a2a4a;
  width: 320px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #00e5ff;
  font-size: 1.5rem;
}

.login-box input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 1rem;
}

.login-box input:focus {
  outline: none;
  border-color: #00e5ff;
}

.login-box button {
  width: 100%;
  padding: 0.75rem;
  background: #00e5ff;
  color: #0f0f23;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.login-box button:hover { background: #00b8d4; }

/* Chat Layout */
#chat-screen {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 220px;
  background: #0f0f23;
  border-right: 1px solid #2a2a4a;
  display: flex;
  flex-direction: column;
}

#sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid #2a2a4a;
}

#sidebar-header h2 {
  color: #00e5ff;
  font-size: 1.1rem;
}

#user-list {
  flex: 1;
  padding: 0.75rem;
}

.user-item {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #b0b0b0;
}

#sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid #2a2a4a;
}

#logout-btn {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  color: #888;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

#logout-btn:hover { color: #ff6b6b; border-color: #ff6b6b; }

/* Main Chat */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#chat-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2a2a4a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected { background: #00e676; }
.status-dot.disconnected { background: #ff6b6b; }

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.message {
  max-width: 75%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.self {
  align-self: flex-end;
  background: #1e3a5f;
}

.message.other {
  align-self: flex-start;
  background: #2a2a4a;
}

.message.claude {
  align-self: flex-start;
  background: #1a3a2a;
  border-left: 3px solid #00e676;
  max-width: 85%;
}

.message.system {
  align-self: center;
  background: transparent;
  color: #666;
  font-size: 0.8rem;
  font-style: italic;
}

.message .meta {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 0.15rem;
}

.message .text {
  font-size: 0.95rem;
}

/* Input Bar */
#input-bar {
  padding: 0.75rem 1rem;
  border-top: 1px solid #2a2a4a;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

#message-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  background: #0f0f23;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.95rem;
  resize: none;
  max-height: 120px;
  font-family: inherit;
}

#message-input:focus {
  outline: none;
  border-color: #00e5ff;
}

#send-btn {
  padding: 0.6rem 1rem;
  background: #00e5ff;
  color: #0f0f23;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
}

#send-btn:hover { background: #00b8d4; }

#attach-btn {
  padding: 0.6rem 0.75rem;
  background: transparent;
  color: #888;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
}

#attach-btn:hover { color: #00e5ff; border-color: #00e5ff; }

.file-attachment {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  margin-top: 0.25rem;
}

.file-attachment a {
  color: #00e5ff;
  text-decoration: none;
  font-size: 0.85rem;
  word-break: break-all;
}

.file-attachment a:hover { text-decoration: underline; }

.file-attachment .file-size {
  color: #666;
  font-size: 0.75rem;
  white-space: nowrap;
}

.file-icon { font-size: 1.2rem; }

#messages.drag-over {
  border: 2px dashed #00e5ff;
  background: rgba(0, 229, 255, 0.05);
}

/* Mobile */
@media (max-width: 600px) {
  #sidebar { display: none; }
  .message { max-width: 90%; }
  .message.claude { max-width: 95%; }
}
