* {
  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-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b7fc7 0%, #e8e4f0 100%);
}

.auth-container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

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

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

.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: #7a6fb5;
}

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

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

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

.info-text {
  margin-bottom: 16px;
  color: #718096;
  font-size: 13px;
}

/* App Header */
.app-header {
  background: white;
  padding: 16px 24px;
  border-bottom: 1px solid #e8e4f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8e4f0;
}

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

.btn-secondary {
  padding: 8px 16px;
  background: #f7fafc;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #edf2f7;
}

/* Navigation */
.tab-nav {
  background: white;
  padding: 0 24px;
  border-bottom: 1px solid #e8e4f0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

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

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

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

/* Main Content */
.app-main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

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

/* Chat Layout */
.chat-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  height: calc(100vh - 180px);
}

.chat-rooms {
  background: white;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
}

.chat-rooms h3 {
  margin-bottom: 16px;
  font-size: 14px;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.room-btn {
  width: 100%;
  padding: 12px;
  margin-bottom: 8px;
  background: #f7fafc;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.room-btn:hover:not(:disabled) {
  background: #edf2f7;
}

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

.room-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.premium-room::after {
  content: " 🔒";
}

.chat-main {
  background: white;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s;
}

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

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8e4f0;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
}

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

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

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

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

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

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

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

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

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

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

.member-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
  text-align: center;
}

.member-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8e4f0;
  margin-bottom: 12px;
}

.member-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

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

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.status-online {
  background: #c6f6d5;
  color: #22543d;
}

.status-offline {
  background: #fed7d7;
  color: #742a2a;
}

.premium-badge {
  background: #faf089;
  color: #744210;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

/* Profile Card */
.profile-card {
  background: white;
  padding: 32px;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
  max-width: 500px;
  text-align: center;
}

.profile-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.profile-card p {
  color: #718096;
  margin-bottom: 8px;
}

.form-group {
  margin-top: 24px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2d3748;
}

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

.form-group button {
  margin-top: 12px;
  padding: 12px 24px;
  background: #8b7fc7;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.form-group button:hover {
  background: #7a6fb5;
}

/* Premium Card */
.premium-card {
  background: white;
  padding: 32px;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
  max-width: 500px;
}

.premium-card h3 {
  font-size: 24px;
  margin-bottom: 16px;
  color: #8b7fc7;
}

.premium-card ul {
  list-style: none;
  margin: 24px 0;
}

.premium-card li {
  padding: 12px 0;
  border-bottom: 1px solid #e8e4f0;
}

.premium-card li::before {
  content: "✓ ";
  color: #48bb78;
  font-weight: bold;
  margin-right: 8px;
}

.price {
  font-size: 28px;
  font-weight: bold;
  color: #8b7fc7;
  margin: 24px 0;
}

.btn-premium {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #8b7fc7 0%, #7a6fb5 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-premium:hover {
  transform: translateY(-2px);
}

/* AI Chat */
.ai-chat {
  background: white;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
  height: calc(100vh - 250px);
  display: flex;
  flex-direction: column;
}

.ai-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.ai-message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 80%;
}

.ai-message.user {
  background: #8b7fc7;
  color: white;
  margin-left: auto;
}

.ai-message.assistant {
  background: #f7fafc;
  color: #2d3748;
}

/* Weather Widget */
.weather-widget {
  background: white;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
  max-width: 500px;
}

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

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

.weather-widget button:hover {
  background: #7a6fb5;
}

#weather-result {
  margin-top: 24px;
  padding: 24px;
  background: #f7fafc;
  border-radius: 8px;
  text-align: center;
}

.weather-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.weather-temp {
  font-size: 48px;
  font-weight: bold;
  color: #2d3748;
  margin-bottom: 8px;
}

.weather-desc {
  font-size: 18px;
  color: #718096;
  text-transform: capitalize;
}

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

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e8e4f0;
}

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

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

/* Responsive */
@media (max-width: 768px) {
  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .chat-rooms {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  
  .chat-rooms h3 {
    display: none;
  }
  
  .room-btn {
    white-space: nowrap;
  }
  
  .members-grid {
    grid-template-columns: 1fr;
  }
  
  .tab-nav {
    padding: 0 12px;
  }
  
  .app-main {
    padding: 16px;
  }
}