/* =============================================
   WildWatch — Nature-Inspired Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Core palette */
  --forest-deep:    #1a2e1a;
  --forest-mid:     #2d4a2d;
  --forest-light:   #3d6b3d;
  --moss:           #5a8a4a;
  --leaf:           #7ab648;
  --sage:           #a8c882;
  --mist:           #d4e8c2;
  --cream:          #f5f0e8;
  --parchment:      #faf7f2;

  --earth-dark:     #3d2b1f;
  --earth-mid:      #6b4c3b;
  --earth-warm:     #a0725a;
  --sand:           #c9a882;
  --linen:          #e8d8c4;

  --sky-dusk:       #2a3f5f;
  --sky-mid:        #4a6fa5;

  --text-primary:   #1a2a1a;
  --text-secondary: #4a5a4a;
  --text-muted:     #7a8a7a;
  --text-inverse:   #f5f0e8;

  --bg-primary:     #faf7f2;
  --bg-secondary:   #f0ebe2;
  --bg-card:        #ffffff;
  --bg-overlay:     rgba(26, 46, 26, 0.85);

  --border-light:   rgba(90, 138, 74, 0.15);
  --border-mid:     rgba(90, 138, 74, 0.3);

  --shadow-sm:      0 2px 8px rgba(26, 46, 26, 0.08);
  --shadow-md:      0 8px 24px rgba(26, 46, 26, 0.12);
  --shadow-lg:      0 20px 60px rgba(26, 46, 26, 0.18);
  --shadow-xl:      0 32px 80px rgba(26, 46, 26, 0.25);

  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --radius-xl:      32px;
  --radius-pill:    100px;

  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-mid:    300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --navbar-height: 68px;
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
  --bg-primary:     #111a11;
  --bg-secondary:   #1a2a1a;
  --bg-card:        #1e2e1e;
  --text-primary:   #e8f0e0;
  --text-secondary: #b0c4a0;
  --text-muted:     #7a9070;
  --border-light:   rgba(122, 182, 72, 0.12);
  --border-mid:     rgba(122, 182, 72, 0.25);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:      0 20px 60px rgba(0,0,0,0.5);
  --cream:          #2a3a2a;
  --parchment:      #1e2e1e;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color var(--transition-mid), color var(--transition-mid);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--text-primary);
}

a { color: var(--moss); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--leaf); }

img { max-width: 100%; height: auto; display: block; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--sage); border-radius: 3px; }

/* ---------- Selection ---------- */
::selection { background: var(--mist); color: var(--forest-deep); }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  height: var(--navbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
  transition: box-shadow var(--transition-mid);
}

[data-theme="dark"] .navbar {
  background: rgba(30, 46, 30, 0.95);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--forest-deep) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
}

[data-theme="dark"] .navbar-brand { color: var(--text-primary) !important; }

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--moss), var(--leaf));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(90, 138, 74, 0.4);
}

.nav-link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary) !important;
  padding: 8px 14px !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--moss) !important;
  background: rgba(90, 138, 74, 0.08);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sage);
}

.nav-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--moss), var(--earth-warm));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid var(--sage);
}

.btn-upload-nav {
  background: linear-gradient(135deg, var(--moss), var(--leaf));
  color: white !important;
  padding: 8px 18px !important;
  border-radius: var(--radius-pill) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  transition: all var(--transition-spring) !important;
  box-shadow: 0 4px 14px rgba(90, 138, 74, 0.35);
}

.btn-upload-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(90, 138, 74, 0.45) !important;
  color: white !important;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  color: var(--moss);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  background: linear-gradient(135deg, var(--forest-light), var(--moss));
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-spring);
  box-shadow: 0 4px 16px rgba(61, 107, 61, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(61, 107, 61, 0.45);
  color: white;
  background: linear-gradient(135deg, var(--moss), var(--leaf));
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  color: var(--moss);
  border: 2px solid var(--moss);
  padding: 10px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-mid);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--moss);
  color: white;
  transform: translateY(-2px);
}

.btn-earth {
  background: linear-gradient(135deg, var(--earth-dark), var(--earth-mid));
  color: var(--cream);
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-spring);
  box-shadow: 0 4px 16px rgba(61, 43, 31, 0.3);
}

.btn-earth:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(61, 43, 31, 0.4);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.82rem;
}

/* =============================================
   MESSAGES / ALERTS
   ============================================= */
.messages-container {
  position: fixed;
  top: calc(var(--navbar-height) + 12px);
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100% - 40px);
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.35s var(--transition-spring);
  box-shadow: var(--shadow-md);
  border: none;
}

.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.alert-error   { background: #fdecea; color: #c62828; border-left: 4px solid #ef5350; }
.alert-info    { background: #e3f2fd; color: #1565c0; border-left: 4px solid #42a5f5; }
.alert-warning { background: #fff8e1; color: #f57f17; border-left: 4px solid #ffca28; }

[data-theme="dark"] .alert-success { background: #1b3a1e; color: #81c784; }
[data-theme="dark"] .alert-error   { background: #3a1b1b; color: #ef9a9a; }
[data-theme="dark"] .alert-info    { background: #1b2d3a; color: #90caf9; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =============================================
   POST CARDS
   ============================================= */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-mid);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-mid);
}

.post-card-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-secondary);
}

.post-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card-image-wrap img {
  transform: scale(1.04);
}

.post-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.category-cleanup  { background: rgba(255,193,7,0.85);  color: #5d4037; }
.category-scenic   { background: rgba(90,138,74,0.85);  color: white; }
.category-wildlife { background: rgba(74,111,165,0.85); color: white; }

.post-card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-mid);
  flex-shrink: 0;
}

.author-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--moss), var(--earth-warm));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--border-mid);
}

.author-info .author-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.author-info .post-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-caption {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-spring);
  user-select: none;
}

.like-btn:hover {
  border-color: #e91e63;
  color: #e91e63;
  background: rgba(233,30,99,0.06);
}

.like-btn.liked {
  border-color: #e91e63;
  color: #e91e63;
  background: rgba(233,30,99,0.08);
}

.like-btn.liked .like-icon { animation: heartPop 0.4s var(--transition-spring); }

.like-icon { font-size: 1rem; transition: transform var(--transition-spring); }

@keyframes heartPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  70%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}

.comment-btn, .view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.comment-btn:hover { border-color: var(--moss); color: var(--moss); background: rgba(90,138,74,0.06); }
.view-btn:hover    { border-color: var(--sky-mid); color: var(--sky-mid); background: rgba(74,111,165,0.06); }

/* =============================================
   COMMENT SECTION (inline on feed)
   ============================================= */
.comment-section {
  display: none;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  animation: fadeSlideDown 0.25s ease;
}

.comment-section.open { display: block; }

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.comment-bubble {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  flex: 1;
  box-shadow: var(--shadow-sm);
}

.comment-bubble .comment-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--moss);
  margin-bottom: 3px;
}

.comment-bubble .comment-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.comment-bubble .comment-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.comment-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.comment-input {
  flex: 1;
  padding: 9px 16px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.comment-input:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(90,138,74,0.12); }

.comment-submit-btn {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--moss), var(--leaf));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition-spring);
  flex-shrink: 0;
}

.comment-submit-btn:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(90,138,74,0.4); }

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--forest-deep) 0%, var(--forest-mid) 50%, var(--earth-dark) 100%);
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: radial-gradient(circle at 20% 30%, var(--leaf) 0%, transparent 50%),
                    radial-gradient(circle at 80% 70%, var(--sand) 0%, transparent 50%),
                    radial-gradient(circle at 50% 50%, var(--sage) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--sage);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--sage);
}

.hero-description {
  font-size: 1.05rem;
  color: rgba(213, 232, 194, 0.8);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 520px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(213, 232, 194, 0.15);
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--sage);
  line-height: 1;
  margin-bottom: 4px;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: rgba(213, 232, 194, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* =============================================
   FEED PAGE
   ============================================= */
.feed-header {
  background: linear-gradient(135deg, var(--forest-deep), var(--forest-mid));
  padding: 48px 0 32px;
  color: var(--cream);
  margin-bottom: 0;
}

.feed-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--cream);
}

.feed-subtitle {
  color: var(--sage);
  font-size: 0.95rem;
  margin-top: 6px;
}

.filter-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
  position: sticky;
  top: var(--navbar-height);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.filter-pill {
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.83rem;
  font-weight: 500;
  border: 1.5px solid var(--border-mid);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-pill:hover, .filter-pill.active {
  background: var(--moss);
  color: white;
  border-color: var(--moss);
}

.search-input {
  padding: 9px 18px 9px 42px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  width: 240px;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(90,138,74,0.1);
  width: 280px;
  background: var(--bg-card);
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

/* =============================================
   FORMS
   ============================================= */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-body);
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 4px rgba(90,138,74,0.1);
  background: var(--bg-card);
}

.form-control.is-invalid { border-color: #ef5350; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(239,83,80,0.1); }

.invalid-feedback {
  color: #ef5350;
  font-size: 0.8rem;
  margin-top: 5px;
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a8a4a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* Image preview */
.image-preview-wrap {
  border: 2px dashed var(--border-mid);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  transition: border-color var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.image-preview-wrap:hover { border-color: var(--moss); }

.image-preview-wrap img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.image-preview-placeholder {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.image-preview-placeholder .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard-header {
  background: linear-gradient(135deg, var(--forest-deep), var(--forest-mid));
  padding: 48px 0;
  color: var(--cream);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-mid);
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon-green { background: rgba(90,138,74,0.12); }
.stat-icon-red   { background: rgba(233,30,99,0.1); }
.stat-icon-blue  { background: rgba(74,111,165,0.1); }
.stat-icon-amber { background: rgba(255,193,7,0.15); }

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* =============================================
   PROFILE PAGE
   ============================================= */
.profile-header {
  background: linear-gradient(160deg, var(--forest-deep), var(--earth-dark));
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}

.profile-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-primary);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.profile-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--sage);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.profile-avatar-placeholder-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--moss), var(--earth-warm));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  font-weight: 700;
  border: 4px solid var(--sage);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.profile-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img { transform: scale(1.06); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-mid);
  color: white;
  font-size: 0.85rem;
  gap: 16px;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

/* =============================================
   ABOUT PAGE
   ============================================= */
.about-hero {
  background: linear-gradient(160deg, var(--forest-deep), var(--forest-mid));
  padding: 80px 0;
  text-align: center;
  color: var(--cream);
}

.mission-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 36px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-mid);
  text-align: center;
}

.mission-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-mid);
}

.mission-icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
  display: block;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--forest-deep);
  color: var(--sage);
  padding: 48px 0 24px;
  margin-top: 80px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--cream);
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  display: block;
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--sage); }

.footer-divider {
  border: none;
  border-top: 1px solid rgba(90,138,74,0.15);
  margin: 32px 0 24px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--moss);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 12px;
}

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--forest-deep) 0%, var(--earth-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-xl);
  animation: fadeSlideUp 0.5s var(--transition-spring);
}

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

.auth-logo {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--moss), var(--leaf));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(90,138,74,0.4);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.auth-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 20px 0;
  position: relative;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 30px);
  height: 1px;
  background: var(--border-mid);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* =============================================
   EMPTY STATES
   ============================================= */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.4;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* =============================================
   TRENDING BADGE
   ============================================= */
.trending-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #ff6b35, #f7c59f);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* =============================================
   PAGE TRANSITIONS
   ============================================= */
.page-enter {
  animation: pageEnter 0.4s ease;
}

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

/* =============================================
   UTILITIES
   ============================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }

.text-muted   { color: var(--text-muted) !important; }
.text-moss    { color: var(--moss); }
.text-earth   { color: var(--earth-warm); }
.text-forest  { color: var(--forest-light); }

.bg-forest { background-color: var(--forest-deep); }
.bg-card   { background-color: var(--bg-card); }

.mt-xs { margin-top: 8px;  }
.mt-sm { margin-top: 16px; }
.mt-md { margin-top: 32px; }
.mt-lg { margin-top: 60px; }
.mt-xl { margin-top: 80px; }

.mb-xs { margin-bottom: 8px;  }
.mb-sm { margin-bottom: 16px; }
.mb-md { margin-bottom: 32px; }
.mb-lg { margin-bottom: 60px; }

.py-sm { padding-top: 24px; padding-bottom: 24px; }
.py-md { padding-top: 48px; padding-bottom: 48px; }
.py-lg { padding-top: 80px; padding-bottom: 80px; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-sm  { gap: 8px; }
.flex-gap-md  { gap: 16px; }
.flex-wrap    { flex-wrap: wrap; }

.rounded-full { border-radius: 50%; }
.rounded-pill { border-radius: var(--radius-pill); }
.rounded-lg   { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.overflow-hidden { overflow: hidden; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 992px) {
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
  .hero h1 { font-size: 2.6rem; }
  .hero-stats { gap: 24px; }
}

@media (max-width: 768px) {
  .posts-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-card { padding: 28px 20px; }
  .auth-card { padding: 32px 24px; }
  .hero { padding: 48px 0; min-height: auto; }
  .hero h1 { font-size: 2.2rem; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .dashboard-header { padding: 32px 0; }
  .profile-gallery { grid-template-columns: repeat(2, 1fr); }
  .filter-bar .container { overflow-x: auto; }
  .filter-bar .flex { flex-wrap: nowrap; width: max-content; padding-bottom: 4px; }
  .search-input { width: 180px; }
  .search-input:focus { width: 200px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.9rem; }
  .stat-value { font-size: 1.6rem; }
  .profile-gallery { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================
   MOBILE NAVBAR FIX
   ============================================= */

/* The collapsed menu needs a solid background so it's visible over hero */
.mobile-menu-inner {
  display: contents; /* transparent pass-through on desktop */
}

@media (max-width: 991px) {
  .mobile-menu-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
  }

  [data-theme="dark"] .mobile-menu-inner {
    background: #1e2e1e;
    border-color: var(--border-mid);
  }

  .navbar-nav {
    margin: 0 !important;
    gap: 4px !important;
  }

  .navbar-nav .nav-link {
    color: var(--text-primary) !important;
    padding: 10px 14px !important;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    background: rgba(90, 138, 74, 0.1);
    color: var(--moss) !important;
  }

  .navbar-right-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }

  .btn-upload-nav {
    text-align: center;
    justify-content: center;
    margin: 4px 0;
  }
}

@media (min-width: 992px) {
  .navbar-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-user-links { display: none !important; }
}

/* Mobile user section */
.mobile-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0;
}

.mobile-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}

.mobile-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(90, 138, 74, 0.12);
  color: var(--moss);
  font-weight: 600;
}

/* =============================================
   POINTS & BADGES
   ============================================= */

.points-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.08));
  color: #d97706;
  border: 1px solid rgba(245,158,11,0.25);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  color: var(--cream);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
}

.upload-points-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(90, 138, 74, 0.1);
  color: var(--moss);
  border: 1px solid var(--border-mid);
  margin-top: 6px;
}

/* Leaderboard */
.leaderboard-row {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-mid);
}

.leaderboard-row:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-mid);
}

.leaderboard-row.rank-1 { border-color: #f59e0b; box-shadow: 0 4px 20px rgba(245,158,11,0.15); }
.leaderboard-row.rank-2 { border-color: #9ca3af; }
.leaderboard-row.rank-3 { border-color: #cd7c2f; }

.leaderboard-points {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--moss);
  margin-left: auto;
  flex-shrink: 0;
}

.points-card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 4px;
}

/* =============================================
   GOOGLE SIGN IN BUTTON
   ============================================= */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  margin-bottom: 16px;
}

.google-btn:hover {
  border-color: #4285F4;
  background: rgba(66, 133, 244, 0.04);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* =============================================
   BOOKMARK BUTTON
   ============================================= */
.bookmark-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.bookmark-btn:hover { border-color: #f59e0b; background: rgba(245,158,11,0.06); }
.bookmark-btn.bookmarked { border-color: #f59e0b; background: rgba(245,158,11,0.1); }

/* =============================================
   FOLLOW BUTTON
   ============================================= */
.follow-btn {
  padding: 9px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-spring);
  border: 2px solid var(--moss);
  font-family: var(--font-body);
}

.follow-btn.not-following {
  background: linear-gradient(135deg, var(--forest-light), var(--moss));
  color: white;
  box-shadow: 0 4px 14px rgba(90,138,74,0.3);
}

.follow-btn.not-following:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(90,138,74,0.4); }

.follow-btn.following {
  background: transparent;
  color: var(--moss);
}

.follow-btn.following:hover {
  background: rgba(239,68,68,0.08);
  border-color: #ef4444;
  color: #ef4444;
}
