/* ══════════════════════════════════════════════════════════════════
   Garden — Page-Specific Styles
   Base: /assets/css/theme-variables.css + feed.css + nj-mobile.css
   ══════════════════════════════════════════════════════════════════ */

/* ── Font-size overrides (scaled by nj-device.js) ── */
body { font-size: var(--fs-base); }
.post-text         { font-size: var(--fs-base); line-height: 1.65; }
.post-author-name  { font-size: var(--fs-sm); }
.post-meta         { font-size: var(--fs-xs); }
.post-stats        { font-size: var(--fs-xs); }
.post-action-btn   { font-size: var(--fs-sm); }
.sidebar-nav-item  { font-size: var(--fs-base); }
.sidebar-card-title { font-size: var(--fs-md); }
.create-post-input { font-size: var(--fs-base); }
.create-post-action { font-size: var(--fs-sm); }
.guest-prompt-text h3 { font-size: var(--fs-lg); }
.guest-prompt-text p  { font-size: var(--fs-sm); }
.btn-login-prompt  { font-size: var(--fs-sm); }
.header-logo       { font-size: var(--fs-lg); }
.community-footer  { font-size: var(--fs-xs); }

/* ── Grid Layout ── */
.feed-layout { grid-template-columns: 1fr !important; }
.nj-tablet .feed-layout,
.is-tablet .feed-layout { grid-template-columns: 240px 1fr !important; }
.nj-desktop .feed-layout,
.is-desktop .feed-layout { grid-template-columns: 280px 1fr 300px !important; }

.nj-tablet .sidebar-left,
.is-tablet .sidebar-left,
.nj-desktop .sidebar-left,
.is-desktop .sidebar-left {
  display: flex !important;
  position: sticky !important;
  top: calc(var(--header-height, 60px) + var(--space-lg, 16px));
  height: fit-content;
  width: auto;
  transform: none;
  border-right: none;
  z-index: auto;
  padding: 0;
  transition: none;
}

.sidebar-right { display: none; }
.nj-desktop .sidebar-right,
.is-desktop .sidebar-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ── Stats Banner ── */
.stats-banner {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm);
  background: var(--bg-tertiary); border-radius: var(--radius-lg);
  padding: var(--space-md); border: 1px solid var(--border-light);
  margin-bottom: var(--space-md);
}
.stats-banner .stat-item { text-align: center; }
.stats-banner .stat-num { font-size: var(--fs-xl); font-weight: 700; color: var(--theme-primary); line-height: 1.2; }
.stats-banner .stat-lbl { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── Plant Cards Grid ── */
.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}
.plant-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}
.plant-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.plant-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-tertiary);
}
.plant-card-body {
  padding: var(--space-md);
}
.plant-card-name {
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}
.plant-card-species {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.plant-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.plant-stage {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.plant-stage.seed { background: #fef3c7; color: #92400e; }
.plant-stage.sprout { background: #d1fae5; color: #065f46; }
.plant-stage.growing { background: #bbf7d0; color: #166534; }
.plant-stage.mature { background: #a7f3d0; color: #064e3b; }

/* ── Plant Detail Timeline ── */
.plant-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.timeline-item {
  display: flex;
  gap: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: var(--space-md);
}
.timeline-item-img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}
.timeline-item-content {
  flex: 1;
  min-width: 0;
}
.timeline-item-date {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}
.timeline-item-note {
  font-size: var(--fs-base);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}
.timeline-item-ai {
  font-size: var(--fs-sm);
  color: var(--theme-primary);
  background: rgba(var(--theme-primary-rgb), 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--theme-primary);
}

/* ── Plant Hero (detail page) ── */
.plant-hero {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}
.plant-hero-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  background: var(--bg-tertiary);
}
.plant-hero-info {
  padding: var(--space-lg);
}
.plant-hero-name {
  font-size: var(--fs-2xl, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}
.plant-hero-species {
  font-size: var(--fs-md);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}
.plant-hero-stats {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.plant-hero-stat {
  text-align: center;
}
.plant-hero-stat-val {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--theme-primary);
}
.plant-hero-stat-lbl {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ── Register Plant Form ── */
.register-plant-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: var(--space-xl, 24px);
  max-width: 500px;
  margin: var(--space-lg) auto;
}
.register-plant-card h2 {
  text-align: center;
  font-size: var(--fs-xl);
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}
.form-group {
  margin-bottom: var(--space-md);
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.15);
}
.mood-selector {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.mood-btn {
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  cursor: pointer;
  font-size: var(--fs-base);
  transition: all var(--transition-fast);
}
.mood-btn:hover,
.mood-btn.selected {
  border-color: var(--theme-primary);
  background: rgba(var(--theme-primary-rgb), 0.1);
}
.btn-primary {
  width: 100%;
  padding: var(--space-md);
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Upload Box ── */
.upload-box {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl, 24px);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-primary);
}
.upload-box:hover {
  border-color: var(--theme-primary);
  background: rgba(var(--theme-primary-rgb), 0.05);
}
.upload-box-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}
.upload-box-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ── Activity Link Cards (right sidebar) ── */
.activity-links { display: flex; flex-direction: column; gap: var(--space-sm); }
.activity-link {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary); border-radius: var(--radius-md);
  text-decoration: none; color: var(--text-primary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.activity-link:hover {
  background: rgba(var(--theme-primary-rgb), 0.08);
  border-color: var(--theme-primary);
  transform: translateX(4px);
}
.activity-link .al-icon { font-size: 1.5rem; width: 2.25rem; text-align: center; flex-shrink: 0; }
.activity-link .al-info { flex: 1; min-width: 0; }
.activity-link .al-title { font-weight: 600; font-size: var(--fs-sm); }
.activity-link .al-desc { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.activity-link.primary {
  background: var(--gradient-primary); color: white;
  border: none; box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb), 0.3);
}
.activity-link.primary .al-desc { color: rgba(255,255,255,0.8); }
.activity-link.primary:hover { transform: translateX(4px) translateY(-1px); box-shadow: 0 6px 16px rgba(var(--theme-primary-rgb), 0.4); }

/* ── Coming-soon badge ── */
.coming-soon {
  font-size: var(--fs-xs); background: var(--bg-secondary); color: var(--text-muted);
  padding: 1px 6px; border-radius: var(--radius-full); margin-left: auto;
  font-weight: 500;
}

/* ── Community Feed Cards ── */
.community-card {
  display: flex;
  gap: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: var(--space-md);
  transition: transform var(--transition-fast);
  cursor: pointer;
}
.community-card:hover {
  transform: translateY(-2px);
}
.community-card-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}
.community-card-info { flex: 1; min-width: 0; }
.community-card-name {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  margin-bottom: 2px;
}
.community-card-owner {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}
.community-card-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ── Section Title ── */
.section-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Tabs ── */
.tab-bar {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}
.tab-item {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active {
  color: var(--theme-primary);
  border-bottom-color: var(--theme-primary);
  font-weight: 600;
}

/* ── Level Badge ── */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: rgba(var(--theme-primary-rgb), 0.1);
  color: var(--theme-primary);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl, 48px) var(--space-lg);
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}
.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

/* ── Mobile Parity (match stable patterns from other projects) ── */
/* ── Responsive ── */
@media (max-width: 900px) {
  .feed-layout,
  .nj-tablet .feed-layout,
  .is-tablet .feed-layout {
    grid-template-columns: 1fr !important;
  }

  .register-plant-card {
    width: 100%;
    max-width: none;
    margin: var(--space-sm) 0;
  }
}

@media (max-width: 600px) {
  .stats-banner { grid-template-columns: repeat(2, 1fr); }
  .feed-layout { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .plant-grid { grid-template-columns: 1fr; }
  .timeline-item { flex-direction: column; }
  .timeline-item-img { width: 100%; height: 200px; }
  .plant-hero-img { height: 200px; }

  .register-plant-card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }
}

/* Footer */
.community-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: var(--space-lg) var(--space-md);
  margin-top: var(--space-2xl);
  text-align: center;
  font-size: 0.85rem; color: var(--text-muted);
}
.community-footer a { color: var(--text-secondary); text-decoration: none; margin: 0 var(--space-sm); }
.community-footer a:hover { color: var(--theme-primary); }
.footer-links { margin-bottom: var(--space-sm); }
