/* ===================================================
   LionTribe App CSS
   Extends theme.css — same design tokens, app-specific layouts.
   =================================================== */

/* ---- App shell ---- */
.app-body {
  background: var(--bg);
  min-height: 100vh;
}

/* ---- App Nav ---- */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(245, 230, 211, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  transition: background 0.15s ease;
}

.nav-link:hover { background: var(--bg-section); }
.nav-link.active { background: var(--bg-section); color: var(--accent); font-weight: 600; }

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- Nav buttons ---- */
.btn-ghost-sm, .btn-outline-sm, .btn-primary-sm {
  padding: 7px 16px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s ease;
}

.btn-ghost-sm {
  background: transparent;
  color: var(--muted);
}
.btn-ghost-sm:hover { color: var(--fg); }

.btn-outline-sm {
  background: transparent;
  color: var(--fg);
  border: 1.5px solid var(--border);
}
.btn-outline-sm:hover { border-color: var(--fg); }

.btn-primary-sm {
  background: var(--accent);
  color: #fff;
}
.btn-primary-sm:hover { background: var(--accent-warm); }

/* ---- Mobile nav ---- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  gap: 4px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a, .mobile-menu button {
  padding: 10px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

/* ---- Main content area ---- */
.app-main {
  padding-top: 70px;
  min-height: 100vh;
}

/* ---- Landing page nav additions ---- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-text-link {
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  border-radius: 40px;
  transition: background 0.15s ease;
}
.nav-text-link:hover { background: var(--bg-section); }

.nav-cta {
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}
.nav-cta:hover { background: var(--accent-warm); }

/* ---- Hero CTA buttons ---- */
.hero-cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn-hero-primary {
  display: inline-block;
  padding: 16px 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-hero-primary:hover { background: var(--accent-warm); transform: translateY(-2px); }

.btn-hero-secondary {
  display: inline-block;
  padding: 16px 36px;
  background: transparent;
  color: var(--fg);
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--border);
  transition: border-color 0.15s ease;
}
.btn-hero-secondary:hover { border-color: var(--muted); }

/* ---- Common buttons ---- */
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--accent-warm); }

.btn-block { width: 100%; text-align: center; }

.btn-outline {
  display: inline-block;
  padding: 10px 22px;
  border: 1.5px solid var(--border);
  color: var(--fg);
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.15s ease;
}
.btn-outline:hover { border-color: var(--fg); }

.btn-ghost {
  display: inline-block;
  padding: 10px 22px;
  color: var(--muted);
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--fg); }

.btn-follow, .btn-follow-lg {
  padding: 7px 18px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-follow:hover, .btn-follow-lg:hover {
  background: var(--accent);
  color: #fff;
}

.btn-follow-lg {
  padding: 10px 24px;
  font-size: 14px;
}

.btn-follow-lg.following {
  background: var(--bg-section);
  color: var(--muted);
  border-color: var(--border);
}

.btn-delete {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.btn-delete:hover { color: #c0392b; background: rgba(192, 57, 43, 0.08); }

.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Feed layout ---- */
.feed-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  gap: 24px;
  align-items: start;
}

/* ---- Sidebars ---- */
.feed-sidebar-left, .feed-sidebar-right {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-profile-card {
  background: var(--bg-section);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.profile-avatar-sm {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
}

.sidebar-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  display: block;
}
.sidebar-name:hover { color: var(--accent); }

.sidebar-location {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-section);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  transition: background 0.15s ease;
}
.sidebar-link:hover, .sidebar-link.active { background: var(--bg); color: var(--accent); }

/* ---- Suggestions ---- */
.suggestions-card {
  background: var(--bg-section);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
}

.suggestions-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.suggestions-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: none; }

.suggestion-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.suggestion-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-name:hover { color: var(--accent); }

.suggestion-location {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-stats {
  background: var(--bg-dark);
  border-radius: 16px;
  padding: 20px;
}

.sidebar-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.sidebar-stat-text {
  font-size: 13px;
  color: rgba(245, 230, 211, 0.75);
  line-height: 1.6;
}

/* ---- Post composer ---- */
.post-composer {
  display: flex;
  gap: 12px;
  background: var(--bg-section);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 20px;
}

.composer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.composer-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

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

.composer-textarea {
  width: 100%;
  border: none;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
  resize: none;
  outline: none;
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease;
}

.composer-textarea:focus {
  border-color: var(--accent);
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.tag-input {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  outline: none;
  max-width: 160px;
  transition: border-color 0.15s ease;
}

.tag-input:focus { border-color: var(--accent); }

/* ---- Posts ---- */
.feed-main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-card {
  background: var(--bg-section);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s ease;
}

.post-card:hover {
  box-shadow: 0 4px 20px rgba(26, 14, 7, 0.06);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.post-author-link {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.post-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.post-author-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  display: block;
}

.post-author-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.post-time {
  font-size: 12px;
  color: var(--muted);
}

.post-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg);
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-image {
  width: 100%;
  border-radius: 12px;
  max-height: 400px;
  object-fit: cover;
  margin-bottom: 12px;
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.post-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 20px;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

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

.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.like-btn:hover { background: var(--bg); }
.like-btn.liked { color: var(--accent); }

.like-static {
  font-size: 14px;
  color: var(--muted);
  padding: 6px 0;
}

.post-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---- Feed empty state ---- */
.feed-empty {
  background: var(--bg-section);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 60px 40px;
  text-align: center;
}

.feed-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.feed-empty h3 {
  font-size: 22px;
  margin-bottom: 10px;
}

.feed-empty p {
  color: var(--muted);
  font-size: 15px;
}

.feed-empty a { color: var(--accent); }

/* ---- Role badges ---- */
.role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.role-ranger { background: rgba(122, 158, 126, 0.15); color: #5a7a5e; }
.role-researcher { background: rgba(26, 14, 7, 0.08); color: #6b4f2e; }
.role-donor { background: rgba(232, 93, 4, 0.1); color: var(--accent-warm); }
.role-enthusiast { background: rgba(139, 115, 85, 0.12); color: var(--muted); }
.role-badge-lg { font-size: 13px; padding: 5px 14px; }

/* ---- Explore page ---- */
.explore-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
}

.explore-header {
  text-align: center;
  margin-bottom: 40px;
}

.explore-title {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 12px;
}

.explore-sub {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 20px;
}

.explore-feed {
  display: flex;
  flex-direction: column;
}

/* ---- Auth pages ---- */
.auth-page {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--bg-section);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
}

.auth-card-wide { max-width: 560px; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 28px;
}

.auth-brand .brand-icon { font-size: 28px; }

.auth-title {
  font-size: 28px;
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 28px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.label-hint {
  font-weight: 400;
  color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}

.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(192, 57, 43, 0.08);
  color: #c0392b;
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.alert-success {
  background: rgba(122, 158, 126, 0.12);
  color: #4a7a4e;
  border: 1px solid rgba(122, 158, 126, 0.25);
}

/* ---- Profile page ---- */
.profile-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.profile-header-card {
  background: var(--bg-section);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 28px;
}

.profile-cover {
  height: 100px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #2d1a0e 50%, #1a0e07 100%);
}

.profile-info-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 0 28px 20px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-section);
  margin-top: -40px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  border: 4px solid var(--bg-section);
  margin-top: -40px;
}

.profile-meta {
  flex: 1;
  padding-top: 8px;
  min-width: 0;
}

.profile-name {
  font-size: 24px;
  margin-bottom: 4px;
}

.profile-username {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.profile-actions {
  padding-top: 8px;
}

.profile-stats-row {
  display: flex;
  gap: 0;
  padding: 0 28px 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.profile-stat {
  flex: 1;
  text-align: center;
}

.profile-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  display: block;
}

.profile-stat-label {
  font-size: 12px;
  color: var(--muted);
}

.profile-bio {
  padding: 0 28px 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
}

.profile-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 28px 20px;
}

.profile-detail {
  font-size: 13px;
  color: var(--muted);
}

.profile-detail a { color: var(--accent); text-decoration: none; }

.profile-posts-title {
  font-size: 18px;
  margin-bottom: 16px;
}

/* ---- Error pages ---- */
.error-page {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
}

.error-icon { font-size: 64px; }

.error-title {
  font-size: 32px;
}

.error-body {
  color: var(--muted);
  font-size: 16px;
}

/* ---- Mobile responsive ---- */
@media (max-width: 900px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar-left { position: static; }
  .feed-sidebar-right { position: static; }

  .sidebar-nav { display: none; }
}

@media (max-width: 768px) {
  .app-nav-links {
    display: none;
  }

  .nav-hamburger { display: flex; }

  .auth-card { padding: 32px 24px; }

  .profile-info-row { flex-direction: column; }

  .profile-stats-row { gap: 0; }

  .feed-layout { padding: 16px; gap: 16px; }

  .composer-footer { flex-direction: column; align-items: stretch; }

  .composer-tags { justify-content: stretch; }

  .tag-input { max-width: 100%; flex: 1; }
}

@media (max-width: 480px) {
  .hero-cta-row { flex-direction: column; align-items: stretch; }

  .btn-hero-primary, .btn-hero-secondary { text-align: center; }

  .auth-card { padding: 28px 20px; }
}
