/* ======================================================================
   FutiaSpace · components.css
   Reusable UI: buttons, badges, modals, toasts, lists, cards, search,
   notifications, friends, groups, settings, admin, seller dashboard.

   Imports the page-specific stylesheets so the existing 3 <link> tags
   in index.html load every section.
   ====================================================================== */

@import url("./feed.css");
@import url("./chat.css");
@import url("./marketplace.css");
@import url("./profile.css");

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn [data-lucide],
.btn svg.lucide { width: 16px; height: 16px; }

.btn-sm  { padding: 7px 12px; font-size: var(--fs-xs); }
.btn-lg  { padding: 14px 22px; font-size: var(--fs-md); width: 100%; }

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.32);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-input);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.25);
}
.btn-danger:hover:not(:disabled) {
  background: var(--color-danger);
  color: #fff;
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-pill);
}

/* WhatsApp button accent */
.whatsapp-btn {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.32) !important;
}

/* =====================================================================
   Badges
   ===================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.badge.new-badge {
  background: var(--gradient-brand);
  color: #fff;
}
.badge.verified   { background: var(--color-success-soft); color: var(--color-success); }
.badge.unverified { background: var(--bg-elevated); color: var(--text-muted); }
.badge.unread-badge {
  background: var(--color-danger);
  color: #fff;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  justify-content: center;
}

.friend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-success-soft);
  color: var(--color-success);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.friend-badge [data-lucide],
.friend-badge svg.lucide { width: 14px; height: 14px; }

/* Avatar inline placeholder */
.avatar-placeholder {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Active dot */
.active-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-success);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

/* =====================================================================
   Section box (used across home & sub-sections)
   ===================================================================== */
.section-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 12px 12px 16px;
  box-shadow: var(--shadow-xs);
}

/* =====================================================================
   Online banner
   ===================================================================== */
.online-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  margin: 8px 12px 0;
  background: var(--color-success-soft);
  color: var(--color-success);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.online-banner [data-lucide],
.online-banner svg.lucide { color: var(--color-success); }

/* =====================================================================
   Vertical list (used in home, groups, admin, etc.)
   ===================================================================== */
.vertical-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  transition: background-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.list-item:hover { background: var(--bg-elevated); }
.list-item.clickable:active { transform: scale(0.99); }

.list-item img,
.list-item .avatar-placeholder {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.list-item strong {
  display: block;
  font-size: var(--fs-base);
  color: var(--text-primary);
  font-weight: 600;
}
.list-item span,
.list-item div {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.list-item p { font-size: var(--fs-sm); color: var(--text-secondary); }

/* Activity avatars (campus activity) */
.activity-avatar,
.activity-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gradient-brand);
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}
.activity-avatars {
  display: inline-flex;
}
.activity-avatars > * + * { margin-left: -10px; border: 2px solid var(--bg-surface); }

.activity-product-img,
.activity-product-placeholder,
.product-list-img {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-elevated);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* =====================================================================
   People discovery / People you may know
   ===================================================================== */
.horizontal-people-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.horizontal-people-carousel::-webkit-scrollbar { display: none; }

.people-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.people-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.people-card img,
.people-card .avatar-placeholder {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.people-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.people-dept {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* =====================================================================
   Modals (generic + compose overlay)
   ===================================================================== */
.modal-overlay,
.compose-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}
.modal-overlay { opacity: 1; }
.compose-overlay.visible { opacity: 1; }

.modal-box,
.product-form-container,
.crop-container {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp var(--t-base) var(--ease);
}
.modal-box { padding: 24px; }
.crop-container { padding: 20px; }

.product-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.product-form-header h3 {
  font-size: var(--fs-lg);
  margin: 0;
}
.compose-cancel-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
}
.compose-cancel-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }

.product-form-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}
.product-form-actions .btn { flex: 1; }

#productForm,
.product-form-container form {
  padding: 16px 20px;
}

/* =====================================================================
   Toast notifications
   ===================================================================== */
.toast,
.toast-container > div {
  position: fixed;
  bottom: calc(var(--nav-h) + 24px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  animation: slideUp var(--t-base) var(--ease);
}
.toast.success { border-color: var(--color-success); color: var(--color-success); }
.toast.error   { border-color: var(--color-danger);  color: var(--color-danger); }
.toast.info    { border-color: var(--violet-400);    color: var(--violet-300); }
body.light-mode .toast.info { color: var(--violet-700); }

/* =====================================================================
   Search page
   ===================================================================== */
.search-page { padding: 12px; }
.search-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.search-input-wrapper {
  position: relative;
  flex: 1;
}
.search-page-input {
  width: 100%;
  padding: 12px 38px 12px 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.search-page-input:focus {
  border-color: var(--violet-500);
  box-shadow: var(--shadow-glow);
}
.search-clear-btn {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--border-strong);
  color: var(--text-primary);
  display: inline-flex; align-items: center; justify-content: center;
}

.search-section {
  margin-bottom: 16px;
  animation: fadeIn var(--t-base) var(--ease);
}
.search-section h4 {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recent-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.recent-item {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
.recent-item:hover { background: var(--bg-input); }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
.search-result-item:hover { background: var(--bg-elevated); }
.search-result-item img,
.search-result-item .avatar-placeholder {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.search-result-item .search-product-img {
  border-radius: var(--radius-sm);
}
.search-result-item strong {
  display: block;
  font-size: var(--fs-base);
  color: var(--text-primary);
}
.search-result-item span {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* =====================================================================
   Notifications page
   ===================================================================== */
.notifications-page { padding-bottom: 16px; }
.notifications-page h2 { font-size: var(--fs-xl); }

#notificationsList { padding: 8px; }

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
  position: relative;
}
.notification-item:hover { background: var(--bg-elevated); }
.notification-item:active { transform: scale(0.99); }

.notification-item.unread {
  background: var(--color-primary-soft);
}
.notification-item.unread::before {
  content: "";
  position: absolute;
  left: 4px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--violet-500);
  border-radius: 50%;
}

.notif-avatar img,
.notif-avatar .avatar-placeholder {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.notif-content { flex: 1; min-width: 0; }
.notif-content p {
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text-primary);
  margin: 0;
}
.notif-content p strong { font-weight: 600; }
.notif-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}
.notif-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.notif-actions button {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all var(--t-fast) var(--ease);
}
.notif-actions .btn-accept-friend,
.notif-actions .btn-accept-message {
  background: var(--gradient-brand);
  color: #fff;
  border-color: transparent;
}
.notif-actions button:hover { transform: translateY(-1px); }



/* =====================================================================
   People page
   ===================================================================== */
.people-page { padding-bottom: 16px; }
.people-page h2 { font-size: var(--fs-xl); }
.chat-back-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-primary);
}
.chat-back-btn:hover { background: var(--bg-input); }


/* =====================================================================
   Settings page
   ===================================================================== */
.settings-page {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}
.settings-page h2 {
  font-size: var(--fs-xl);
  margin-bottom: 20px;
}
.settings-page form .btn[type="submit"] {
  width: 100%;
  padding: 14px;
  font-size: var(--fs-md);
  margin-top: 8px;
}

/* =====================================================================
   Admin / Seller dashboard
   ===================================================================== */
.admin-dashboard,
.seller-dashboard-page,
.seller-dashboard {
  padding: 16px;
}
.admin-title { font-size: var(--fs-2xl); margin-bottom: 16px; }

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 480px) {
  .admin-metrics-grid { grid-template-columns: repeat(3, 1fr); }
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.metric-card:hover { transform: translateY(-2px); border-color: var(--violet-500); }
.metric-card h3 {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 6px;
}
.metric-card p {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.admin-section {
  margin-top: 22px;
}
.admin-section h2 {
  font-size: var(--fs-lg);
  margin-bottom: 12px;
}

.verification-item .badge { margin-left: auto; }

.admin-post-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px !important;
}
.admin-post-item small { color: var(--text-muted); font-size: var(--fs-xs); }

/* =====================================================================
   Verified badge inline (used in many places)
   ===================================================================== */
.verified-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
  color: var(--violet-400);
}
body.light-mode .verified-badge { color: var(--violet-600); }

/* =====================================================================
   Generic dropdown menu
   ===================================================================== */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background-color var(--t-fast) var(--ease);
}
.dropdown-item:hover { background: var(--bg-elevated); }
.dropdown-item [data-lucide],
.dropdown-item svg.lucide { width: 16px; height: 16px; color: var(--text-secondary); }

/* =====================================================================
   Twemoji inline
   ===================================================================== */
.twemoji-inline {
  width: 18px; height: 18px;
  vertical-align: -4px;
  display: inline-block;
}

/* Edited label */
.edited-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* =====================================================================
   Full-screen image viewer (lightbox)
   ===================================================================== */
.image-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 180ms ease-out;
  cursor: zoom-out;
}

.image-viewer-container {
  position: relative;
  max-width: min(100%, 920px);
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.image-viewer-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
  z-index: 2;
}
.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}
.image-viewer-close svg.lucide {
  width: 22px;
  height: 22px;
}

.image-viewer-img {
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  user-select: none;
  -webkit-user-drag: none;
}


/* =====================================================================
   Email verification banner refinements
   ===================================================================== */
#verifyEmailBanner {
  border-radius: var(--radius-lg) !important;
  font-weight: 500;
  letter-spacing: 0.005em;
  box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.45);
  animation: slideDown 280ms ease-out;
}
#verifyEmailBanner svg.lucide {
  flex-shrink: 0;
}
#verifyEmailBanner button {
  border-radius: 9999px !important;
  font-weight: 600 !important;
  padding: 4px 12px !important;
  font-size: 0.75rem !important;
  height: auto !important;
  color: #fff !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 160ms ease;
}
#verifyEmailBanner button:hover {
  background: rgba(255, 255, 255, 0.32) !important;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Verification code input (inline-styled in JS, but ensure focus is on-brand) */
#verificationCodeInput:focus {
  border-color: var(--violet-500) !important;
  box-shadow: 0 0 0 3px var(--violet-100);
  outline: none;
}

/* =====================================================================
   Static info pages (Privacy, About, Guidelines, FAQ)
   ===================================================================== */
#mainContent > div > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

#mainContent > div > p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

#mainContent > div > p strong {
  color: var(--text-primary);
  font-weight: 600;
}

#mainContent > div > div > button[onclick*="history.back"] {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-subtle);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
#mainContent > div > div > button[onclick*="history.back"]:hover {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  transform: translateX(-2px);
}

 /* ── Push Notification Prompt ── */
.push-prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.push-prompt-card {
  background: var(--bg-surface);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 28px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  animation: sheetUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.push-prompt-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 8px 0 6px;
  color: var(--text-primary);
}

.push-prompt-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.push-prompt-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.push-prompt-actions .btn {
  flex: 1;
  padding: 11px 16px;
  font-size: 0.85rem;
  border-radius: 14px;
  font-weight: 600;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes sheetUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.profile-achievements-section {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.achievement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}
.achievement-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.achievement-info strong {
  font-size: 0.9rem;
  display: block;
}
.achievement-info span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.loading-bar {
  position: fixed; top: 0; left: 0; height: 3px;
  background: var(--gradient-brand);
  width: 0;
  z-index: 9999;
  transition: width 0.4s ease;
}

.promoted-post {
  border-left: 3px solid var(--amber-400);
  position: relative;
}
.promoted-label {
  position: absolute; top: 8px; right: 12px;
  background: rgba(251,191,36,0.15);
  color: var(--amber-400);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 8px;
}

.course-tag {
  display: inline-block;
  background: rgba(139,92,246,0.12);
  color: var(--violet-400);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 8px;
  margin-right: 6px;
}

/* Onboarding tooltip */
.onboarding-tip {
  position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--violet-500);
  border-radius: 16px;
  padding: 16px;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: slideUp 0.3s ease;
}
.onboarding-tip p { margin: 0 0 12px; font-size: 0.85rem; }
.onboarding-tip .btn { width: 100%; }


/* ── Install Prompt Banner ── */
.install-banner {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  left: 16px;
  right: 16px;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-500));
  color: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 500;
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.5);
  animation: slideUpBanner 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  font-size: 0.88rem;
  font-weight: 500;
}

.install-banner span {
  flex: 1;
  line-height: 1.4;
}

.install-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.install-actions .btn {
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.install-actions .btn-primary {
  background: #fff;
  color: var(--violet-700);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.install-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes slideUpBanner {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Prevent overlap: install banner sits above onboarding tip */
.install-banner {
  z-index: 510;
}

.onboarding-tip {
  z-index: 500;
}

/* When both are visible, push the onboarding tip higher */
.install-banner ~ .onboarding-tip {
  bottom: 190px;
}


.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@keyframes badgeBounce {
  0%   { transform: scale(0.3); }
  30%  { transform: scale(1.15); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.badge-bounce {
  animation: badgeBounce 0.45s ease;
}
.notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--violet-500);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  margin-left: 6px;
  padding: 0 4px;
}

.dismiss-notif-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.dismiss-notif-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* static pages wrapper */
.static-page-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

.static-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.static-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.static-back-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.static-page-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.static-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.static-card h3 {
  font-size: 1rem;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.static-card p {
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

.static-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.static-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.static-feature-list li svg {
  width: 18px;
  height: 18px;
  color: var(--violet-400);
}

/* FAQ accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
}

.faq-question:hover {
  background: var(--bg-elevated);
}

.faq-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-answer {
  padding: 0 16px 14px;
  border-top: 1px solid var(--border-subtle);
}

.faq-answer p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  font-size: 0.9rem;
}

/* People page */
.people-page {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 100px;
}

.people-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: var(--bg-base);
  z-index: 10;
}

.people-back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.people-back-btn:hover { background: var(--bg-input); }

.people-search-bar {
  display: flex;
  align-items: center;
  margin: 0 16px 12px;
  position: relative;
}

.people-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.people-search-input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.people-search-input:focus {
  border-color: var(--violet-400);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}
.people-search-input::placeholder {
  color: var(--text-muted);
}

.people-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-strong);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

/* card style */
.people-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px;
}

.people-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: background 0.15s, transform 0.15s;
  cursor: pointer;
}
.people-card-item:hover {
  background: var(--bg-elevated);
  transform: translateY(-1px);
}
.people-card-item:active {
  transform: scale(0.99);
}

.people-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.people-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.people-avatar-wrap img,
.people-avatar-wrap .avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

/* active dot */
.active-dot-small {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: var(--color-success);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
}

.people-info {
  flex: 1;
  min-width: 0;
}

.people-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.people-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.people-tag {
  font-size: 0.7rem;
  color: var(--violet-400);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.people-tag--courses {
  color: var(--color-success);
}

.people-tag svg {
  width: 12px;
  height: 12px;
}

.people-message-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.people-message-text {
  display: inline;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-left: 4px;
}
.admin-badge svg {
  width: 10px;
  height: 10px;
}

/* persistent offline bar (Twitter style) */
.offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px;
  background: #b91c1c;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.offline-bar .offline-retry-btn {
  background: #fff;
  color: #b91c1c;
  padding: 4px 12px;
  font-size: 0.75rem;
  border-radius: 999px;
  margin-left: 8px;
}
body.light-mode .offline-bar {
  background: #dc2626;
}
.admin-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.admin-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.admin-metrics-grid .metric-card {
  animation: fadeIn 0.3s ease both;
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 0;
  position: sticky;
  top: 0;
  background: var(--bg-base);
  z-index: 2;
}

.notification-section {
  margin-bottom: 8px;
}

.notification-bucket-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 16px 16px 8px;
}

.notification-cards {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  margin: 0 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.notification-item:active { background: var(--bg-elevated); }

.discussion-topic-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-surface);
}
.topic-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.topic-avatar {
  flex-shrink: 0;
}
.topic-body {
  flex: 1;
  min-width: 0;
}
.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.topic-title {
  font-weight: 600;
  color: var(--text-primary);
}
.topic-reply-badge {
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--violet-400);
  white-space: nowrap;
}
.topic-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.topic-author {
  margin-right: 8px;
}

/* ── Discussion topic avatar (same style as .feed-post-avatar) ── */
.topic-avatar {
  width: 38px;                     /* match feed post avatar size */
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s;
  background: var(--bg-elevated);   /* fallback if no image */
}

.topic-avatar:hover {
  border-color: var(--violet-500);
}

/* Image inside the avatar */
.topic-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Placeholder initials (when no image) – match feed's .avatar-placeholder */
.topic-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ── Home page card entrance ─────────────────────────────── */
.home-page .feed-section {
  animation: cardEntrance 0.35s ease both;
}
.home-page .feed-section:nth-child(1) { animation-delay: 0.00s; }
.home-page .feed-section:nth-child(2) { animation-delay: 0.05s; }
.home-page .feed-section:nth-child(3) { animation-delay: 0.10s; }
.home-page .feed-section:nth-child(4) { animation-delay: 0.15s; }
.home-page .feed-section:nth-child(5) { animation-delay: 0.20s; }

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Study Partner card ──────────────────────────────────── */
.study-partner-card {
  background: linear-gradient(135deg, rgba(45,125,50,0.08), rgba(45,125,50,0.02));
  border: 1px solid rgba(45,125,50,0.2);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
}
.study-partner-card::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 120px; height: 120px;
  background: rgba(139,92,246,0.08);
  border-radius: 50%;
  pointer-events: none;
}
.study-partner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.study-partner-card .btn {
  margin-top: 10px;
}

/* ── Pulse metric cards ──────────────────────────────────── */
.pulse-metric {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pulse-metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(139,92,246,0.12);
}
.pulse-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--violet-400);
  letter-spacing: -0.02em;
}
.pulse-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Section title accent ────────────────────────────────── */
.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Like button animation (already exists, ensure it works) */
.feed-like-btn.animating {
  animation: likePulse 0.4s ease, likeShake 0.3s ease;
}
@keyframes likePulse {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.3); }
  50%  { transform: scale(0.95); }
  75%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes likeShake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-3px); }
  40%  { transform: translateX(3px); }
  60%  { transform: translateX(-3px); }
  80%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

/* ─── FAB extra polish ───────────────────────────────────── */
.feed-fab {
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}
.feed-fab:active { transform: scale(0.94); }

/* ── Study Partner card – professional ───────────────────── */
.study-partner-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease;
}
.study-partner-card:hover {
  box-shadow: var(--shadow-sm);
}
.study-partner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.study-partner-header i,
.study-partner-header svg {
  color: var(--violet-400);
  width: 20px;
  height: 20px;
}
.study-partner-card .vertical-list {
  gap: 4px;
}
.study-partner-card .list-item {
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}