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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #2d3748;
  background: #fafafa;
  line-height: 1.5;
}

.screen {
  min-height: 100vh;
}

/* Auth Screen */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 48px 24px;
}

.auth-container h1 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 32px;
  color: #8b7fc7;
}

.auth-form {
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-form h2 {
  margin-bottom: 24px;
  font-size: 24px;
  color: #2d3748;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  font-size: 14px;
}

.auth-form input:focus {
  outline: none;
  border-color: #8b7fc7;
}

.auth-form button {
  width: 100%;
  padding: 12px;
  background: #8b7fc7;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-form button:hover {
  background: #7a6eb6;
}

.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
}

.auth-link a {
  color: #8b7fc7;
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

.message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}

.message.success {
  background: #d4edda;
  color: #155724;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
}

/* Navbar */
.navbar {
  background: white;
  padding: 16px 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar h1 {
  font-size: 20px;
  color: #8b7fc7;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-secondary {
  padding: 8px 16px;
  background: white;
  color: #2d3748;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #fafafa;
  border-color: #8b7fc7;
}

/* App Container */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e8e4f0;
  overflow-x: auto;
}

.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: #718096;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  color: #8b7fc7;
}

.tab.active {
  color: #8b7fc7;
  border-bottom-color: #8b7fc7;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tab-content h2 {
  margin-bottom: 24px;
  font-size: 24px;
  color: #2d3748;
}

/* Chat Layout */
.chat-layout {
  display: flex;
  gap: 24px;
}

.chat-main {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid #e8e4f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h2 {
  margin: 0;
  font-size: 18px;
}

.room-selector {
  display: flex;
  gap: 8px;
}

.room-btn {
  padding: 6px 12px;
  background: #fafafa;
  border: 1px solid #e8e4f0;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.room-btn:hover {
  background: #f0f0f0;
}

.room-btn.active {
  background: #8b7fc7;
  color: white;
  border-color: #8b7fc7;
}

.room-btn.premium-room:not(.active) {
  opacity: 0.5;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-item {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8e4f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-content {
  flex: 1;
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.message-author {
  font-weight: 600;
  color: #2d3748;
}

.message-time {
  font-size: 12px;
  color: #a0aec0;
}

.message-text {
  color: #4a5568;
  word-wrap: break-word;
}

.chat-input {
  padding: 16px 24px;
  border-top: 1px solid #e8e4f0;
  display: flex;
  gap: 12px;
}

.chat-input input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  font-size: 14px;
}

.chat-input input:focus {
  outline: none;
  border-color: #8b7fc7;
}

.chat-input button {
  padding: 10px 24px;
  background: #8b7fc7;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-input button:hover {
  background: #7a6eb6;
}

/* Members List */
.members-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.member-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 16px;
}

.member-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e8e4f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
}

.member-status.online {
  background: #48bb78;
}

.member-status.offline {
  background: #cbd5e0;
}

.member-info {
  flex: 1;
}

.member-name {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
}

.member-email {
  font-size: 13px;
  color: #718096;
}

.member-premium {
  margin-top: 4px;
  font-size: 12px;
  color: #8b7fc7;
}

/* Profile */
.profile-container {
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  max-width: 600px;
}

.profile-avatar {
  text-align: center;
  margin-bottom: 32px;
}

.profile-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #e8e4f0;
  object-fit: cover;
  margin-bottom: 16px;
}

#avatar-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#avatar-input {
  font-size: 13px;
}

#avatar-form button {
  padding: 8px 20px;
  background: #8b7fc7;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

#avatar-form button:hover {
  background: #7a6eb6;
}

.profile-info p {
  padding: 12px 0;
  border-bottom: 1px solid #e8e4f0;
}

.profile-info p:last-child {
  border-bottom: none;
}

/* Premium */
.premium-container {
  max-width: 600px;
}

.premium-card {
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
}

.premium-card h3 {
  font-size: 24px;
  margin-bottom: 24px;
  color: #2d3748;
}

.premium-card ul {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
}

.premium-card li {
  padding: 8px 0;
  color: #4a5568;
}

.price {
  font-size: 32px;
  font-weight: 700;
  color: #8b7fc7;
  margin-bottom: 24px;
}

.btn-premium {
  padding: 16px 48px;
  background: #8b7fc7;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-premium:hover {
  background: #7a6eb6;
}

.premium-status {
  margin-top: 24px;
  padding: 16px;
  background: #e8e4f0;
  border-radius: 8px;
  text-align: center;
}

/* AI Moderator */
.ai-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  height: 600px;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s;
}

.ai-message.user {
  flex-direction: row-reverse;
}

.ai-message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8e4f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ai-message.assistant .ai-message-avatar {
  background: #8b7fc7;
  color: white;
}

.ai-message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f7fafc;
  color: #2d3748;
}

.ai-message.user .ai-message-content {
  background: #8b7fc7;
  color: white;
}

.ai-input {
  padding: 16px 24px;
  border-top: 1px solid #e8e4f0;
  display: flex;
  gap: 12px;
}

.ai-input input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  font-size: 14px;
}

.ai-input input:focus {
  outline: none;
  border-color: #8b7fc7;
}

.ai-input button {
  padding: 10px 24px;
  background: #8b7fc7;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.ai-input button:hover {
  background: #7a6eb6;
}

/* Weather */
.weather-container {
  max-width: 600px;
}

.weather-container input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  font-size: 14px;
}

.weather-container button {
  padding: 12px 24px;
  background: #8b7fc7;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.weather-container button:hover {
  background: #7a6eb6;
}

.weather-result {
  margin-top: 24px;
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.weather-result h3 {
  font-size: 24px;
  margin-bottom: 16px;
  color: #2d3748;
}

.weather-result p {
  padding: 8px 0;
  color: #4a5568;
}

/* Stats */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-card h3 {
  font-size: 14px;
  color: #718096;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #8b7fc7;
}

.stat-card .stat-label {
  font-size: 13px;
  color: #a0aec0;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  
  .chat-main {
    height: 500px;
  }
  
  .members-list {
    grid-template-columns: 1fr;
  }
  
  .ai-message-content {
    max-width: 85%;
  }
}