/* ═══════════════════════════════════════════════════════
   MamaHive Community Hub - Styles
   Design tokens inherited from landing page
   ═══════════════════════════════════════════════════════ */

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

:root {
  --coral: #E8614D;
  --coral-dark: #D14D3A;
  --coral-light: #F08B7D;
  --cream: #FFF8F2;
  --warm-black: #1A1412;
  --warm-gray: #6B5E57;
  --warm-gray-light: #9B918A;
  --honey: #F4A623;
  --sage: #7BA68D;
  --blush: #FFE4D6;
  --white: #FFFFFF;
  --border: rgba(26, 20, 18, 0.08);
  --shadow-sm: 0 1px 3px rgba(26, 20, 18, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 20, 18, 0.08);
  --shadow-lg: 0 8px 30px rgba(26, 20, 18, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--warm-black);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }

/* ─── Hide all screens by default ────────────────── */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; min-height: 100vh; }

/* ─── Auth Screen ────────────────────────────────── */
.auth-screen {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(180deg, var(--cream) 0%, var(--blush) 100%);
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 0.5rem;
}
.auth-logo span { color: var(--coral); }

.auth-tagline {
  text-align: center;
  color: var(--warm-gray);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.auth-tabs {
  display: flex;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  padding: 0.6rem;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  color: var(--warm-gray);
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--white);
  color: var(--warm-black);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--warm-gray);
  margin-bottom: 0.4rem;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--warm-black);
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--coral);
  background: var(--white);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--coral);
  color: var(--white);
  width: 100%;
}
.btn-primary:hover { background: var(--coral-dark); }
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--cream);
  color: var(--warm-black);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--blush); }
.btn-ghost {
  background: none;
  color: var(--coral);
  padding: 0.5rem;
}
.btn-ghost:hover { background: var(--blush); border-radius: var(--radius-sm); }
.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.auth-error {
  background: #FEE;
  color: var(--coral-dark);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}
.auth-error.visible { display: block; }

/* ─── Onboarding Screen ──────────────────────────── */
.onboarding-screen {
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  padding-top: 3rem;
  background: linear-gradient(180deg, var(--cream) 0%, var(--blush) 100%);
}

.onboarding-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
}

.onboarding-step-indicator {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: all 0.3s;
}
.step-dot.active { background: var(--coral); width: 24px; }
.step-dot.completed { background: var(--sage); }

.onboarding-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}
.onboarding-subtitle {
  text-align: center;
  color: var(--warm-gray);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.emoji-option {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
}
.emoji-option:hover { border-color: var(--coral-light); transform: scale(1.1); }
.emoji-option.selected { border-color: var(--coral); background: var(--blush); transform: scale(1.1); }

.interest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.interest-chip {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
  color: var(--warm-gray);
  user-select: none;
}
.interest-chip:hover { border-color: var(--coral-light); color: var(--warm-black); }
.interest-chip.selected {
  border-color: var(--coral);
  background: var(--blush);
  color: var(--coral-dark);
}

.vibe-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.vibe-option {
  padding: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: var(--white);
}
.vibe-option:hover { border-color: var(--coral-light); }
.vibe-option.selected { border-color: var(--coral); background: var(--blush); }
.vibe-option .vibe-emoji { font-size: 1.5rem; margin-bottom: 0.35rem; }
.vibe-option .vibe-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.vibe-option .vibe-desc {
  font-size: 0.75rem;
  color: var(--warm-gray);
}

.onboarding-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}
.onboarding-nav .btn { flex: 1; }

/* ─── App Shell (Feed Screen) ────────────────────── */
.app-screen {
  min-height: 100vh;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 248, 242, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header-logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
}
.app-header-logo span { color: var(--coral); }

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--blush);
  border: 2px solid var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.user-avatar-btn:hover { transform: scale(1.1); }

/* ─── Bottom Nav (Mobile) ────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 0.5rem 0;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem;
  color: var(--warm-gray-light);
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
}
.nav-item.active { color: var(--coral); }
.nav-item .nav-icon { font-size: 1.25rem; }

/* ─── Feed Area ──────────────────────────────────── */
.app-content {
  padding-top: 60px;
  padding-bottom: 70px;
  min-height: 100vh;
}

.feed-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

/* ─── Compose Box ────────────────────────────────── */
.compose-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.compose-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.compose-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--blush);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.compose-input {
  width: 100%;
  border: none;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  resize: none;
  min-height: 44px;
  max-height: 200px;
  outline: none;
  color: var(--warm-black);
}
.compose-input::placeholder { color: var(--warm-gray-light); }
.compose-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* ─── Post Card ──────────────────────────────────── */
.post-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
  cursor: pointer;
}
.post-card:hover { box-shadow: var(--shadow-md); }

.post-card.conversation-starter {
  border-left: 3px solid var(--honey);
  background: linear-gradient(135deg, var(--white) 0%, #FFFDF5 100%);
}
.post-card.conversation-starter .starter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #FEF3D6;
  color: #B87D0B;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--blush);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.post-author-info {
  display: flex;
  flex-direction: column;
}
.post-author-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
}
.post-time {
  font-size: 0.75rem;
  color: var(--warm-gray-light);
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--warm-gray);
}
.reaction-btn:hover { border-color: var(--coral-light); background: var(--blush); }
.reaction-btn.active {
  border-color: var(--coral);
  background: var(--blush);
  color: var(--coral-dark);
}
.reaction-btn .reaction-emoji { font-size: 0.9rem; }
.reaction-btn .reaction-count { font-weight: 600; font-size: 0.75rem; }

.reply-count-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: none;
  border: none;
  font-size: 0.8rem;
  color: var(--warm-gray);
  cursor: pointer;
  margin-left: auto;
  font-family: 'DM Sans', sans-serif;
}
.reply-count-btn:hover { color: var(--coral); }

/* ─── Post Detail / Reply View ───────────────────── */
.post-detail-screen {
  background: var(--cream);
}

.detail-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 248, 242, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: none;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.back-btn:hover { background: var(--blush); border-color: var(--coral-light); }
.detail-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
}

.detail-content {
  padding-top: 64px;
  padding-bottom: 80px;
  max-width: 600px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.reply-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.reply-card:last-child { border-bottom: none; }
.reply-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--blush);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.reply-body { flex: 1; min-width: 0; }
.reply-author {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
}
.reply-time {
  font-size: 0.7rem;
  color: var(--warm-gray-light);
  margin-left: 0.5rem;
}
.reply-text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 0.25rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Reply compose */
.reply-compose {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}
.reply-compose textarea {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  resize: none;
  max-height: 100px;
  min-height: 40px;
  outline: none;
  background: var(--cream);
  color: var(--warm-black);
}
.reply-compose textarea:focus { border-color: var(--coral); background: var(--white); }
.reply-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--coral);
  border: none;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.reply-send-btn:hover { background: var(--coral-dark); }
.reply-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Members Screen ─────────────────────────────── */
.members-list {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}
.member-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}
.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--blush);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; }
.member-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}
.member-details {
  font-size: 0.8rem;
  color: var(--warm-gray);
  margin-top: 0.15rem;
}
.member-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.member-interest-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--cream);
  border-radius: 10px;
  color: var(--warm-gray);
}

/* ─── Profile Screen ─────────────────────────────── */
.profile-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
.profile-header {
  text-align: center;
  margin-bottom: 2rem;
}
.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--blush);
  border: 3px solid var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 0.75rem;
}
.profile-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
}
.profile-email {
  font-size: 0.8rem;
  color: var(--warm-gray);
}

.profile-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.profile-section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--warm-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}

.logout-btn {
  width: 100%;
  padding: 0.75rem;
  background: none;
  border: 1.5px solid var(--coral);
  border-radius: var(--radius-sm);
  color: var(--coral);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1rem;
}
.logout-btn:hover { background: var(--blush); }

/* ─── Empty State ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--warm-gray);
}
.empty-state .empty-emoji { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--warm-black);
}
.empty-state p { font-size: 0.9rem; max-width: 300px; margin: 0 auto; }

/* ─── Loading ────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--warm-gray);
}
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--blush);
  border-top-color: var(--coral);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--warm-black);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  z-index: 200;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.toast.visible { transform: translateX(-50%) translateY(0); }

/* ─── Responsive ─────────────────────────────────── */
@media (min-width: 768px) {
  .bottom-nav {
    top: 0;
    bottom: unset;
    border-top: none;
    border-bottom: 1px solid var(--border);
    left: unset;
    right: 0;
    width: auto;
    padding: 0;
    background: transparent;
    gap: 0;
  }
  .app-header {
    padding: 0.75rem 2rem;
  }
  .app-content {
    padding-bottom: 1rem;
  }
  .reply-compose {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
  }
}

/* ─── Animations ─────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 0.4s ease; }
