* {
  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;
}

.view {
  min-height: 100vh;
}

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

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 32px;
  margin-bottom: 8px;
  color: #8b7fc7;
}

.auth-header p {
  color: #718096;
  font-size: 16px;
}

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

.auth-form h2 {
  font-size: 24px;
  margin-bottom: 24px;
  text-align: center;
}

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

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

.auth-form input:disabled {
  background: #f7fafc;
  color: #718096;
}

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

.btn-primary:hover {
  background: #7a6fb5;
}

.btn-primary:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
}

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

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

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
}

.auth-links {
  margin-top: 16px;
  text-align: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.auth-links a {
  color: #8b7fc7;
  text-decoration: none;
  font-size: 14px;
}

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

.form-description {
  color: #718096;
  margin-bottom: 16px;
  font-size: 14px;
}

.error-msg {
  color: #e53e3e;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

.error-msg.show {
  display: block;
}

.success-msg {
  color: #38a169;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

.success-msg.show {
  display: block;
}

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

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

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

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

.avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e8e4f0;
}

.badge {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #744210;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

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

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

.tab:hover {
  color: #2d3748;
}

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

/* Tab Content */
.tab-content {
  padding: 24px;
}

.tab-panel {
  display: none;
}

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

.panel-header {
  margin-bottom: 24px;
}

.panel-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.panel-header p {
  color: #718096;
}

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

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

.room-selector {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid #e8e4f0;
}

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

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

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

.room-btn.premium-only:not(.unlocked) {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.2s ease;
}

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

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

.message-content {
  flex: 1;
}

.message-header {
  display: flex;
  align-items: center;
  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-container {
  padding: 16px;
  border-top: 1px solid #e8e4f0;
  display: flex;
  gap: 8px;
}

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

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

.chat-sidebar {
  background: white;
  border: 1px solid #e8e4f0;
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
}

.chat-sidebar h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: #2d3748;
}

.online-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.online-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.online-user:hover {
  background: #f7fafc;
}

.online-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #48bb78;
}

.online-user span {
  font-size: 14px;
  color: #2d3748;
}

/* Members Grid */
.stats-summary {
  color: #718096;
  font-size: 14px;
}

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

.member-card {
  background: white;
  border: 1px solid #e8e4f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.member-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.member-card img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e8e4f0;
}

.member-card.online img {
  border-color: #48bb78;
}

.member-info {
  flex: 1;
}

.member-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.member-status {
  font-size: 13px;
  color: #718096;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e0;
}

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

/* Profile */
.profile-container {
  background: white;
  border: 1px solid #e8e4f0;
  border-radius: 12px;
  padding: 32px;
  max-width: 800px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
}

.profile-avatar-section {
  text-align: center;
}

.upload-section {
  margin-top: 16px;
}

.hint {
  font-size: 12px;
  color: #a0aec0;
  margin-top: 8px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  font-size: 14px;
  color: #2d3748;
}

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

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

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

.premium-section {
  background: white;
  border: 1px solid #e8e4f0;
  border-radius: 12px;
  padding: 32px;
}

.premium-hero {
  text-align: center;
  margin-bottom: 32px;
}

.premium-hero h3 {
  font-size: 28px;
  margin-bottom: 8px;
}

.premium-hero p {
  color: #718096;
  font-size: 16px;
}

.premium-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.feature {
  text-align: center;
}

.feature-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

.feature h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature p {
  font-size: 14px;
  color: #718096;
}

.premium-price {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid #e8e4f0;
}

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

.premium-success {
  text-align: center;
  padding: 40px;
}

.premium-success h3 {
  font-size: 28px;
  margin-bottom: 16px;
}

.premium-success p {
  font-size: 16px;
  color: #718096;
}

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

.weather-search {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

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

#weather-city:focus {
  outline: none;
  border-color: #8b7fc7;
}

.weather-display {
  background: white;
  border: 1px solid #e8e4f0;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}

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

.weather-temp {
  font-size: 48px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

.weather-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid #e8e4f0;
}

.weather-detail {
  text-align: center;
}

.weather-detail-label {
  font-size: 12px;
  color: #a0aec0;
  margin-bottom: 4px;
}

.weather-detail-value {
  font-size: 16px;
  font-weight: 600;
}

/* AI Moderator */
.ai-container {
  max-width: 800px;
}

.ai-messages {
  background: white;
  border: 1px solid #e8e4f0;
  border-radius: 12px;
  padding: 24px;
  min-height: 400px;
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-message {
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 80%;
  animation: slideIn 0.2s ease;
}

.ai-message.user {
  background: #8b7fc7;
  color: white;
  align-self: flex-end;
}

.ai-message.assistant {
  background: #f7fafc;
  color: #2d3748;
  align-self: flex-start;
  border: 1px solid #e8e4f0;
}

.ai-input-container {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

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

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

.ai-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.ai-suggestion:hover {
  background: #edf2f7;
  border-color: #8b7fc7;
}

/* Stats */
.stats-container {
  max-width: 1000px;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border: 1px solid #e8e4f0;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: #8b7fc7;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #718096;
}

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

.daily-stats h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f7fafc;
  border-radius: 8px;
}

.stat-date {
  font-weight: 600;
}

.stat-counts {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #718096;
}

/* Responsive */
@media (max-width: 768px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
  
  .chat-sidebar {
    display: none;
  }
  
  .profile-container {
    grid-template-columns: 1fr;
  }
  
  .tabs {
    padding: 0 12px;
  }
  
  .tab-content {
    padding: 16px;
  }
}
