/* ===== DESIGN SYSTEM ===== */
:root {
  --coral: #FF6B5A;
  --coral-light: #FF8A7D;
  --coral-bg: #FFF0EE;
  --warm-white: #FFF9F5;
  --dark: #1A1A2E;
  --dark-soft: #2D2D44;
  --sage: #7EC8A0;
  --sage-bg: #F0F9F4;
  --lavender: #B8A9E8;
  --lavender-bg: #F3F0FF;
  --gold: #FFD166;
  --gold-bg: #FFF8E7;
  --text: #3A3A52;
  --text-light: #6B6B82;
  --border: rgba(26, 26, 46, 0.08);
  --card-shadow: 0 2px 12px rgba(26, 26, 46, 0.06);
  --card-shadow-hover: 0 8px 32px rgba(26, 26, 46, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 100px;
  --nav-height: 60px;
  --bottom-nav-height: 72px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--warm-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== TOP NAV ===== */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 249, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--coral); }

.nav-center {
  font-size: 0.8rem;
  color: var(--text-light);
  background: rgba(255, 107, 90, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}
.nav-avatar:hover { transform: scale(1.1); }

.nav-auth-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  background: var(--coral);
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s;
}
.nav-auth-btn:hover { background: var(--coral-light); }

/* ===== MAIN CONTENT ===== */
.app-content {
  padding-top: calc(var(--nav-height) + 12px);
  padding-bottom: calc(var(--bottom-nav-height) + 24px);
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(255, 249, 245, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.65rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 12px;
  transition: all 0.2s;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active {
  color: var(--coral);
}
.bottom-nav-item.active svg {
  stroke: var(--coral);
}

/* ===== FEED TABS ===== */
.feed-tabs {
  display: flex;
  gap: 4px;
  background: white;
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.feed-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.feed-tab.active {
  background: var(--coral);
  color: white;
}

/* ===== FAVOR CARDS ===== */
.favor-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}
.favor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}
.favor-card:active {
  transform: scale(0.98);
}

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.avatar-coral { background: var(--coral); }
.avatar-sage { background: var(--sage); }
.avatar-lavender { background: var(--lavender); }
.avatar-gold { background: var(--gold); }

.favor-meta {
  flex: 1;
  min-width: 0;
}

.favor-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
  display: block;
}

.favor-time {
  font-size: 0.75rem;
  color: var(--text-light);
}

.favor-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.favor-type-badge.request {
  background: var(--coral-bg);
  color: var(--coral);
}
.favor-type-badge.offer {
  background: var(--sage-bg);
  color: #4A9B6E;
}

.favor-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.3;
}

.favor-desc {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.favor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.tag-now { background: var(--coral-bg); color: var(--coral); }
.tag-today { background: var(--sage-bg); color: #4A9B6E; }
.tag-this_week { background: var(--lavender-bg); color: #7B6BC4; }
.tag-category { background: rgba(26,26,46,0.04); color: var(--text); }
.tag-location { background: rgba(26,26,46,0.04); color: var(--text-light); }

.favor-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

/* ===== STORY CARDS ===== */
.story-card {
  background: var(--dark);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  color: white;
  position: relative;
  overflow: hidden;
}
.story-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255,107,90,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.story-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--coral-light);
  margin-bottom: 12px;
}

.story-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
  margin-bottom: 10px;
}
.story-headline strong {
  color: var(--coral-light);
}

.story-content {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
  margin-bottom: 14px;
  font-style: italic;
}

.story-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.story-reactions {
  display: flex;
  gap: 6px;
}

.reaction-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.reaction-btn:hover {
  background: rgba(255,255,255,0.15);
}
.reaction-btn.active {
  background: rgba(255,107,90,0.2);
  border-color: rgba(255,107,90,0.3);
}

.story-meta {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
}

/* ===== BUTTONS ===== */
.btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--coral);
  color: white;
}
.btn-primary:hover { background: #e85a4a; }

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--warm-white); }

.btn-sage {
  background: var(--sage);
  color: white;
}
.btn-sage:hover { background: #5BA87E; }

.btn-small {
  font-size: 0.78rem;
  padding: 8px 16px;
}

.btn-full {
  width: 100%;
}

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

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  display: block;
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  background: white;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--coral);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: #B0B0C0;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Toggle group */
.toggle-group {
  display: flex;
  gap: 4px;
  background: white;
  border-radius: var(--radius);
  padding: 4px;
  border: 1.5px solid var(--border);
}

.toggle-option {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.toggle-option.active {
  color: white;
}
.toggle-option.active.request {
  background: var(--coral);
}
.toggle-option.active.offer {
  background: var(--sage);
}

/* Urgency pills */
.urgency-group {
  display: flex;
  gap: 8px;
}

.urgency-pill {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.urgency-pill.active.now {
  border-color: var(--coral);
  background: var(--coral-bg);
  color: var(--coral);
}
.urgency-pill.active.today {
  border-color: var(--sage);
  background: var(--sage-bg);
  color: #4A9B6E;
}
.urgency-pill.active.this_week {
  border-color: var(--lavender);
  background: var(--lavender-bg);
  color: #7B6BC4;
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.category-pill {
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.category-pill.active {
  border-color: var(--coral);
  background: var(--coral-bg);
  color: var(--coral);
}

/* ===== PROFILE ===== */
.profile-header {
  text-align: center;
  padding: 24px 0;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  margin: 0 auto 14px;
}

.profile-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.profile-neighborhood {
  font-size: 0.88rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.profile-bio {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-top: 12px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--coral);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 2px;
}

.vibe-tags-section {
  margin: 20px 0;
}

.section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 12px;
}

.vibe-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vibe-tag {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: white;
  color: var(--text);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
}
.vibe-tag .count {
  font-weight: 700;
  color: var(--coral);
  margin-left: 4px;
}

/* ===== AUTH ===== */
.auth-container {
  max-width: 400px;
  margin: 40px auto;
  padding: 0 16px;
}

.auth-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--card-shadow);
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
  text-align: center;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--warm-white);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: white;
  color: var(--dark);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.auth-switch a {
  color: var(--coral);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* ===== FAVOR DETAIL ===== */
.favor-detail {
  padding: 8px 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 16px;
  font-family: 'DM Sans', sans-serif;
}
.back-btn:hover { color: var(--dark); }

.detail-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.detail-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}
.status-open { background: var(--sage-bg); color: #4A9B6E; }
.status-claimed { background: var(--gold-bg); color: #C49520; }
.status-completed { background: var(--lavender-bg); color: #7B6BC4; }

.detail-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.detail-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-poster {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--warm-white);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  cursor: pointer;
}
.detail-poster:hover { background: #FFF0ED; }

.poster-info {
  flex: 1;
}
.poster-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
}
.poster-hood {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* Complete modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(26,26,46,0.2);
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.5;
}

.vibe-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.vibe-option {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-light);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}
.vibe-option.active {
  border-color: var(--coral);
  background: var(--coral-bg);
  color: var(--coral);
}

/* ===== LOADING ===== */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--dark);
  color: white;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
  max-width: 300px;
  margin: 0 auto;
}

/* ===== MISC ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.text-center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Sign out button */
.signout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.82rem;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  margin-top: 20px;
}
.signout-btn:hover { background: white; }

/* ===== RESPONSIVE ===== */
@media (min-width: 769px) {
  .app-content {
    padding-left: 24px;
    padding-right: 24px;
  }
  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    gap: 6px;
  }
  .stat-card {
    padding: 12px 6px;
  }
  .stat-number {
    font-size: 1.2rem;
  }
}
