:root {
  --primary: #4f46e5;
  --bg-sidebar: #f8fafc;
  --bg-chat: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --msg-user: #4f46e5;
  --msg-other: #f1f5f9;
  --border: #e2e8f0;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text-primary);
  height: 100vh;
  display: flex;
}

#root {
  display: flex;
  width: 100%;
  height: 100%;
}

.app {
  display: flex;
  width: 100%;
  height: 100%;
}

.sidebar {
  width: 300px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.user-profile-sidebar {
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.user-profile-sidebar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info strong {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.user-info span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ask-ai-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.ask-ai-btn:hover {
  opacity: 0.9;
}

.room-list {
  flex: 1;
  overflow-y: auto;
}

.room-item {
  padding: 15px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.room-item:hover, .room-item.active {
  background: #e2e8f0;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
}

.chat-header {
  padding: 15px 25px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.message-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.message-user {
  align-self: flex-end;
  background: #e0f2fe; /* Light sky blue */
  color: #0369a1; /* Deep ocean blue for text */
  border-bottom-right-radius: 2px;
}

.message-other {
  align-self: flex-start;
  background: #f8fafc; /* Very light slate */
  color: #334155; /* Slate dark text */
  border-bottom-left-radius: 2px;
  border: 1px solid #f1f5f9;
}

.message-ai {
  background: #fef2f2; /* Soft red/pink */
  border: 1px solid #fee2e2;
  color: #991b1b;
}

.message-info {
  font-size: 0.7rem;
  margin-bottom: 4px;
  opacity: 0.8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.read-status {
  font-weight: bold;
  margin-left: 5px;
  color: #94a3b8; /* Light slate */
}

.read-status.read {
  color: #0ea5e9; /* Blue for read */
}

.input-area {
  padding: 20px 30px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.input-area input {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 25px;
  outline: none;
}

.input-area button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
}

.login-screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  color: var(--text-primary);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.login-btn {
  background: #db4437;
  color: white;
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  margin-top: 20px;
  font-weight: 600;
}

.typing-indicator {
  font-size: 0.75rem;
  color: #64748b;
  margin: 4px 10px;
  font-style: italic;
  animation: typing-pulse 1.5s infinite;
  align-self: flex-start;
}

@keyframes typing-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}
