:root {
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  color: #0f172a;
  background: #f1f5f9;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #f1f5f9;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.hidden {
  display: none !important;
}

#landing {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 40px 0;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  align-items: center;
}

.hero-text h1 {
  font-size: 40px;
  margin-bottom: 12px;
}

.hero-text p {
  color: #475569;
  line-height: 1.6;
  margin-bottom: 20px;
}

.tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 14px;
  margin-bottom: 12px;
}

.cta {
  display: flex;
  gap: 12px;
}

.hero-illustration {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-illustration .bubble {
  background: #fff;
  border-radius: 20px;
  padding: 18px 26px;
  box-shadow: 0 30px 40px rgba(37, 99, 235, 0.15);
  font-weight: 600;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.feature-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.feature-card h3 {
  margin: 0 0 8px;
}

.feature-card p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 600;
}

.ghost {
  background: transparent;
  color: #2563eb;
  border: 1px solid #cbd5f5;
  padding: 10px 24px;
  border-radius: 999px;
}

#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.auth-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  width: min(420px, 90%);
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.25);
}

#close-auth {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-tabs button {
  flex: 1;
  padding: 10px 0;
  border-radius: 12px;
  border: 1px solid #cbd5f5;
  background: transparent;
  cursor: pointer;
}

.auth-tabs button.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border-color: transparent;
}

.auth-panel form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-panel button {
  margin-top: 6px;
}

.card {
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input,
textarea,
select,
button {
  font: inherit;
  padding: 10px;
  border: 1px solid #cbd5f5;
  border-radius: 8px;
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border: none;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.9;
}

#main-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 40px;
}

header {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.user-info img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e0e7ff;
}

nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

nav button {
  background: #fff;
  color: #334155;
}

nav button.active {
  background: #2563eb;
  color: #fff;
}

.tab-panel {
  display: none;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  min-height: 400px;
}

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

.split {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#conversation-list,
#friend-list,
#group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#conversation-list li,
#friend-list li,
#group-list li {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#conversation-list li.active {
  border-color: #2563eb;
  background: #eff6ff;
}

#chat-history {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  height: 380px;
  overflow-y: auto;
  background: #f8fafc;
}

.msg {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 70%;
  line-height: 1.4;
}

.msg.me {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  margin-left: auto;
}

.msg.other {
  background: #fff;
  border: 1px solid #e2e8f0;
}

.meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

#chat-composer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer-actions {
  display: flex;
  gap: 8px;
}

#moments-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.moment-card {
  border: 1px solid #e5e7eb;
  padding: 12px;
  border-radius: 12px;
}

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

.moment-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.moment-media img {
  max-width: 100%;
  border-radius: 12px;
  margin-top: 6px;
}

#moments-feed .actions {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-text h1 {
    font-size: 32px;
  }

  .cta {
    flex-direction: column;
  }
}
