/* Shared Interests Pills - Success Green */
.shared-interest-pill {
  background: var(--tf-success) !important;
  color: #fff !important;
  border-radius: 20px;
  padding: 0.25em 0.75em;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  margin-right: 0.25em;
  margin-bottom: 0.25em;
}
/* Sign Out button custom styles */
#navSignOut {
  color: #d32f2f !important;
  border-color: #d32f2f !important;
  background: transparent !important;
}
#navSignOut:hover, #navSignOut:focus {
  background: #d32f2f !important;
  color: #fff !important;
  border-color: #d32f2f !important;
}

/* TrueFew Styles - Colors from TF-Color-Styles.jpg */
:root{
  --tf-navbar-h: 56px;
  --tf-text-dark: #03324f;      /* Dark Navy Blue - For light backgrounds */
  --tf-text-light: #e6edf3;     /* Light text - For dark backgrounds */
  --tf-accent-red: #8B2332;     /* Accent Red */
  --tf-accent-bronze: #6B5D3F;  /* Accent Bronze */
  --tf-accent-blue: #1498A7;    /* Accent Blue (Primary) */
  --tf-accent-peach: #D9A692;   /* Accent Peach */
  --tf-accent-gold: #D48C34;    /* Accent Gold */
  --tf-accent-orange: #D97803;  /* Accent Orange */
  --tf-success: #5CB885;        /* Success Green */
  --tf-warning: #F5B841;        /* Warning Yellow */
  --tf-danger: #B3333C;         /* Danger Red */
  --tf-white: #FFFFFF;          /* White */
  --tf-bg: #FFFFFF;             /* Lt Background */
  --tf-surface: #FFFFFF;        /*Surface */
  --tf-card: #FFFFFF;           /* Cards */
  --tf-primary: #3F8A91;        /* Primary action color (same as accent-blue) */
  --tf-muted: #93a1b3;          /* Muted text */
}

html, body { height: 100%; }
body { margin: 0; }

/* When landing page is active, prevent document scrolling so the hero stays fixed */
body.landing-mode {
  overflow: hidden;
  height: 100vh;
}
/* Better box-sizing for predictable layout */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body.tf-bg{
  background: var(--tf-white); /* Use white background like demo mode */
  color: var(--tf-text-dark); /* Use dark text like demo mode */
}
/* Prevent body scroll ONLY on landing page */
body.landing-mode {
  overflow: hidden;
  height: 100vh;
}

/* Navbar - White with dark blue text */
.tf-nav {
  background: var(--tf-white) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tf-nav .navbar-brand {
  color: var(--tf-text-dark) !important;
}
.tf-nav .nav-link {
  color: var(--tf-text-dark) !important;
}
.tf-nav .nav-link:hover {
  color: var(--tf-accent-blue) !important;
}
.tf-logo { width: 28px; height: 28px; object-fit: contain; }
.slogan { color: var(--tf-text-dark) !important; opacity: 0.7; }

/* Landing - background visible with centered content circle */
.tf-landing{
  /* Fixed under the navbar so landing never scrolls */
  position: fixed;
  top: var(--tf-navbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden; /* prevent internal scrolling */
  background: url('Assets/background-image.jpeg') center/cover no-repeat fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  z-index: 900; /* just under any modals */
}
.tf-landing > .container{
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.95); /* Slight transparency to show background */
  border-radius: 50%;
  width: min(420px, 78vw);
  height: min(420px, 78vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}
.tf-landing h1,
.tf-landing p,
.tf-landing .lead {
  color: var(--tf-text-dark) !important;
}
@media (max-width: 768px) {
  .tf-landing > .container {
    width: 86vw;
    height: 86vw;
    max-width: 360px;
    max-height: 360px;
    padding: 24px 18px;
  }
  .tf-landing h1 { font-size: 2rem; }
}

/* Hero buttons - clear and user-friendly */
.hero-buttons .hero-top-row { flex-wrap: wrap; gap: 0.5rem; }
.hero-buttons .hero-top-row .btn { min-width: 130px; font-weight: 600; }
.hero-buttons .hero-bottom-row { margin-top: 0.75rem; }

/* Landing page button theming - bold borders for visibility */
.tf-landing .btn {
  border-width: 2px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.tf-landing .btn-outline-accent-orange {
  color: var(--tf-accent-orange);
  border-color: var(--tf-accent-orange);
  background: transparent;
}
.tf-landing .btn-outline-accent-orange:hover {
  background: var(--tf-accent-orange);
  color: var(--tf-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240, 122, 47, 0.3);
}
.tf-landing .btn-outline-accent-blue {
  color: var(--tf-accent-blue);
  border-color: var(--tf-accent-blue);
  background: transparent;
}
.tf-landing .btn-outline-accent-blue:hover {
  background: var(--tf-accent-blue);
  color: var(--tf-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(63, 138, 145, 0.3);
}
.tf-landing .btn-outline-success {
  color: var(--tf-success);
  border-color: var(--tf-success);
  background: transparent;
}
.tf-landing .btn-outline-success:hover {
  background: var(--tf-success);
  color: var(--tf-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(92, 184, 133, 0.3);
}

/* Demo mode: light theme with background image at 40% opacity */
/* Authenticated mode: dark theme with background image at 20% opacity */
/* Note: body overflow styling is in the main body section above */
body.demo-mode::before,
body.tf-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('Assets/background-image.jpeg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}
/* Authenticated mode has darker/subtler background */
body.tf-bg::before {
  opacity: 0.2;
}
/* Cards use white/light backgrounds in demo mode and authenticated mode */
body.demo-mode .tf-card,
body.tf-bg .tf-card {
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--tf-text-dark);
  border: 1px solid rgba(12, 35, 64, 0.1);
  backdrop-filter: blur(10px);
}
body.demo-mode .modal-content,
body.tf-bg .modal-content {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: rgba(12, 35, 64, 0.15);
}
body.demo-mode .dropdown-menu,
body.tf-bg .dropdown-menu {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: rgba(12, 35, 64, 0.15);
}
body.demo-mode .list-group-item,
body.tf-bg .list-group-item {
  background-color: rgba(255, 255, 255, 0.85);
  color: var(--tf-text-dark);
  border-color: rgba(12, 35, 64, 0.1);
}
body.demo-mode .form-control,
body.demo-mode .form-select,
body.tf-bg .form-control,
body.tf-bg .form-select {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: rgba(12, 35, 64, 0.2);
}
body.demo-mode .form-control:focus,
body.demo-mode .form-select:focus,
body.tf-bg .form-control:focus,
body.tf-bg .form-select:focus {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: var(--tf-accent-blue);
}

/* Landing mode: light/white modals to match landing page theme */
body.landing-mode .modal-content {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: rgba(12, 35, 64, 0.15);
}
body.landing-mode .modal-header {
  border-bottom-color: rgba(12, 35, 64, 0.15);
}
body.landing-mode .modal-footer {
  border-top-color: rgba(12, 35, 64, 0.15);
}
body.landing-mode .form-control,
body.landing-mode .form-select {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: rgba(12, 35, 64, 0.2);
}
body.landing-mode .form-control:focus,
body.landing-mode .form-select:focus {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: var(--tf-accent-blue);
  box-shadow: 0 0 0 0.25rem rgba(63, 138, 145, 0.25);
}
body.landing-mode .btn-close {
  filter: none; /* Don't invert close button on light backgrounds */
}
body.landing-mode .input-group .btn-outline-secondary {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: rgba(12, 35, 64, 0.2);
}
body.landing-mode .input-group .btn-outline-secondary:hover {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
  color: var(--tf-white);
}

/* Search input: white background with primary text color */
#profileSearchInput {
  width: 220px;
  background: var(--tf-white);
  color: var(--tf-text-dark);
  border: 1.5px solid var(--tf-accent-blue);
  border-radius: 6px;
}
#profileSearchInput::placeholder { color: var(--tf-accent-blue); opacity: 0.7; }

/* Content wrapper below navbar */
.tf-content{
  margin-top: calc(var(--tf-navbar-h) + 1rem);
  margin-bottom: 2.5rem;
  padding: 0 0.5rem;
}
.tf-content, main#dashboard { overflow-x: hidden; }
/* Demo mode and authenticated mode content has no margin-top since dashboard controls positioning */
body.demo-mode .tf-content,
body.tf-bg .tf-content {
  margin-top: 0; /* No margin - dashboard handles its own positioning */
  margin-bottom: 0;
  padding: 0; /* No padding to prevent scroll */
  overflow: hidden; /* Prevent any scrolling */
}

@media (min-width: 992px) {
  .tf-content {
    padding: 0;
  }
}

/* Responsive images */
img, .post-media img { max-width: 100%; height: auto; display: block; }

/* Prevent long words/URLs from breaking layout */
.tf-card, .post-text { word-break: break-word; }
.tf-card{
  background: var(--tf-card);
  border: 1px solid #242b36;
  color: var(--tf-text-light);
  border-radius: 12px;
  overflow: visible; /* Changed from hidden to show full content */
  margin-bottom: 1rem;
}
.tf-card .card-body {
  overflow: visible;
}

/* Interests pills */
.tf-pill-row{
  display: flex;
  gap: .5rem;
  overflow:auto;
  padding-bottom: .5rem;
}
.tf-pill{
  /* text-style item (not an outlined button) */
  background: transparent !important;
  border: none !important;
  padding: 0.35rem 0.5rem; /* More padding for better click area */
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  border-radius: 6px;
}
.tf-pill { min-height: 38px; } /* Reduced from 44px */
.tf-pill i.bi { font-size: 0.95rem; color: var(--tf-accent-blue); }
.tf-pill .tf-pill-label { color: var(--tf-text-light); }
/* Demo mode and authenticated mode - darker text for visibility */
body.demo-mode .tf-pill .tf-pill-label,
body.tf-bg .tf-pill .tf-pill-label {
  color: var(--tf-text-dark);
  font-weight: 500;
}
body.demo-mode .tf-pill i.bi,
body.tf-bg .tf-pill i.bi {
  color: var(--tf-accent-blue);
}
/* Hover effect */
body.demo-mode .tf-pill:hover,
body.demo-mode .tf-pill:focus,
body.tf-bg .tf-pill:hover,
body.tf-bg .tf-pill:focus {
  background: rgba(63, 138, 145, 0.1) !important;
  outline: none;
}
/* Active/selected state */
.tf-pill.active,
body.demo-mode .tf-pill.active,
body.tf-bg .tf-pill.active {
  background: rgba(63, 138, 145, 0.15) !important;
}
.tf-pill.active .tf-pill-label,
body.demo-mode .tf-pill.active .tf-pill-label,
body.tf-bg .tf-pill.active .tf-pill-label {
  font-weight: 700;
  color: var(--tf-accent-blue);
}

/* News list */
.tf-news{
  max-height: 60vh;
  overflow: auto;
}
.tf-news a{
  text-decoration: none;
}

/* Form tweaks */
.form-label::after{
  content: attr(data-required);
  margin-left:.25rem;
  color: var(--tf-accent);
}

/* Post card media */
.post-media iframe, .post-media img, .post-media audio {
  width: 100%;
  border-radius: .5rem;
}
.card-body, .tf-card .card-body {
  overflow-wrap: anywhere;
  word-wrap: break-word;
  overflow: visible !important; /* Ensure full content shows */
  max-height: none !important; /* No height restrictions */
}
.post-text {
  white-space: pre-wrap; /* Preserve line breaks and wrapping */
  word-break: break-word;
  overflow-wrap: break-word;
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
}
.tf-card .card-body {
  height: auto !important;
  min-height: auto !important;
}
.post-media { overflow: hidden; }
.modal-body { max-height: calc(80vh - 200px); overflow: auto; }
.post-media img { max-height: 520px; object-fit: cover; }

/* Dropdown button (ellipsis) */
.btn-light { background:#2a323f; border-color:#2a323f; color:#dbe4ef; }

/* Helpers */
.pointer{ cursor: pointer; }
.text-muted { color: var(--tf-muted) !important; }
body.demo-mode .text-muted,
body.tf-bg .text-muted { color: rgba(12, 35, 64, 0.6) !important; }
.list-group-item { background: var(--tf-surface); color: var(--tf-text-light); }
.list-group-item + .list-group-item { border-top-color: #2a323f; }

/* Required badges */
.badge.required { background: var(--tf-accent); }

/* Bootstrap overrides for dark theme */
.modal-content {
  background: var(--tf-card);
  color: var(--tf-text-light);
  border-color: #242b36;
}
.modal-header {
  border-bottom-color: #242b36;
}
.modal-footer {
  border-top-color: #242b36;
}
.form-control, .form-select {
  background: var(--tf-surface);
  border-color: #2a323f;
  color: var(--tf-text-light);
}
.form-control:focus, .form-select:focus {
  background: var(--tf-surface);
  border-color: var(--tf-primary);
  color: var(--tf-text-light);
  box-shadow: 0 0 0 0.25rem rgba(63, 138, 145, 0.25);
}
.form-check-input {
  background-color: var(--tf-white);
  border-color: #2a323f;
}
.form-check-input:checked {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
}
.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}
.dropdown-menu {
  background: var(--tf-card);
  border-color: #242b36;
}
.dropdown-item {
  color: var(--tf-text-light);
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--tf-surface);
  color: var(--tf-text-light);
}
body.demo-mode .dropdown-item,
body.tf-bg .dropdown-item {
  color: var(--tf-text-dark);
}
body.demo-mode .dropdown-item:hover,
body.demo-mode .dropdown-item:focus,
body.tf-bg .dropdown-item:hover,
body.tf-bg .dropdown-item:focus {
  background: rgba(63, 138, 145, 0.1);
  color: var(--tf-text-dark);
}

/* TrueFew Buttons - Based on TF-Color-Styles */
.btn {
  cursor: pointer;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.18s ease;
  padding: .45rem .75rem;
  font-size: 0.95rem;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Primary Button - Accent Blue */
.btn-primary {
  background-color: var(--tf-accent-blue) !important;
  border-color: var(--tf-accent-blue) !important;
  color: var(--tf-white) !important;
}
.btn-primary:hover {
  background-color: #358a90 !important;
  border-color: #358a90 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(63, 138, 145, 0.5);
}

/* Outline Primary Button */
.btn-outline-primary {
  border-color: var(--tf-accent-blue) !important;
  color: var(--tf-accent-blue) !important;
}
.btn-outline-primary:hover {
  background-color: var(--tf-accent-blue) !important;
  border-color: var(--tf-accent-blue) !important;
  color: var(--tf-white) !important;
}

/* Accent-specific outline styles for hero buttons */
.btn-outline-accent-blue {
  border-color: var(--tf-accent-blue) !important;
  color: var(--tf-accent-blue) !important;
}
.btn-outline-accent-blue:hover { background-color: var(--tf-accent-blue) !important; color: var(--tf-white) !important; }

.btn-outline-accent-gold {
  border-color: var(--tf-accent-gold) !important;
  color: var(--tf-accent-gold) !important;
}
.btn-outline-accent-gold:hover { background-color: var(--tf-accent-gold) !important; color: var(--tf-white) !important; }

.btn-outline-accent-orange {
  border-color: var(--tf-accent-orange) !important;
  color: var(--tf-accent-orange) !important;
}
.btn-outline-accent-orange:hover { background-color: var(--tf-accent-orange) !important; color: var(--tf-white) !important; }

.btn-outline-success {
  border-color: var(--tf-success) !important;
  color: var(--tf-success) !important;
}
.btn-outline-success:hover { background-color: var(--tf-success) !important; color: var(--tf-white) !important; }

/* Small hero-specific button size */
.tf-landing .btn-lg { padding: .5rem .75rem; font-size: .98rem; border-radius: 8px; }


/* Hide profile search on small screens to prevent navbar overflow */
@media (max-width: 991px) {
  #profileSearchForm { display: none !important; }
}

/* Search input focus state */
#profileSearchInput:focus {
  border-color: var(--tf-accent-blue) !important;
  box-shadow: 0 0 0 0.25rem rgba(63,138,145,0.12) !important;
}

/* NAVBAR: specific outlined buttons with hover-fill */
#navViewDemo, #navCreateProfile, #navSignIn {
  background: transparent !important;
  border-width: 1.5px !important;
}

/* View Demo = Accent Orange */
#navViewDemo {
  color: var(--tf-accent-orange) !important;
  border-color: var(--tf-accent-orange) !important;
}
#navViewDemo:hover, #navViewDemo:focus {
  background: var(--tf-accent-orange) !important;
  color: var(--tf-white) !important;
  border-color: var(--tf-accent-orange) !important;
}

/* Create a Profile = Accent Blue */
#navCreateProfile {
  color: var(--tf-accent-blue) !important;
  border-color: var(--tf-accent-blue) !important;
}
#navCreateProfile:hover, #navCreateProfile:focus {
  background: var(--tf-accent-blue) !important;
  color: var(--tf-white) !important;
  border-color: var(--tf-accent-blue) !important;
}

/* Sign In = Success Green */
#navSignIn {
  color: var(--tf-success) !important;
  border-color: var(--tf-success) !important;
}
#navSignIn:hover, #navSignIn:focus {
  background: var(--tf-success) !important;
  color: var(--tf-white) !important;
  border-color: var(--tf-success) !important;
}

/* Badge styling - context-aware colors */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
/* Default badges and counter badges use accent blue */
.badge:not([class*="text-bg-"]),
.badge.text-bg-warning,
.badge.text-bg-info {
  background-color: var(--tf-accent-blue);
  color: var(--tf-white);
}
.badge.text-bg-secondary { background-color: #6c757d; color: var(--tf-white); }

/* Edit Profile button (left column) - outline success */
#editProfileBtn {
  color: var(--tf-success) !important;
  border-color: var(--tf-success) !important;
  background: transparent !important;
}
#editProfileBtn:hover, #editProfileBtn:focus { background: var(--tf-success) !important; color: var(--tf-white) !important; }

/* Edit Interests button - outline success */
#editInterestsBtn {
  color: var(--tf-success) !important;
  border-color: var(--tf-success) !important;
  background: transparent !important;
}
#editInterestsBtn:hover, #editInterestsBtn:focus { background: var(--tf-success) !important; color: var(--tf-white) !important; }

/* Navbar button styling - clean and consistent */
.navbar-nav .nav-link.btn {
  padding: .35rem .75rem;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s ease;
  border-width: 1.5px;
}
.navbar-nav .nav-link.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

/* Success Button - Green */
.btn-success {
  background-color: var(--tf-success) !important;
  border-color: var(--tf-success) !important;
  color: var(--tf-white) !important;
}
.btn-success:hover {
  background-color: #4da572 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(92, 184, 133, 0.4);
}


/* Ellipsis (three-dots) button inside post cards: neutral/transparent style so it doesn't show a color fill */
.tf-card .dropstart > .btn,
.tf-card .dropend > .btn,
.card .dropstart > .btn,
.card .dropend > .btn {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--tf-text-light) !important;
  box-shadow: none !important;
  padding: 0.15rem 0.4rem !important;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.tf-card .dropstart > .btn:hover,
.tf-card .dropend > .btn:hover,
.card .dropstart > .btn:hover,
.card .dropend > .btn:hover {
  opacity: 1;
}

/* Secondary Button */
.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: var(--tf-white);
}
.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #545b62;
}

/* Danger Button */
.btn-danger {
  background-color: var(--tf-danger);
  border-color: var(--tf-danger);
  color: var(--tf-white);
}
.btn-danger:hover {
  background-color: #9b2b33;
  transform: translateY(-1px);
}
.text-danger { color: var(--tf-danger) !important; }

/* Demo dashboard AND authenticated dashboard - transparent to show background subtly, no scroll */
body.demo-mode #dashboard,
body.demo-mode main#dashboard,
body.tf-bg #dashboard,
body.tf-bg main#dashboard {
  background-color: transparent;
  overflow: hidden !important; /* Never scroll */
}
body.demo-mode main,
body.tf-bg main {
  overflow: hidden !important; /* Prevent main element from scrolling */
}

/* Dashboard sizing using navbar variable to avoid magic numbers */
body.demo-mode #dashboard,
body.tf-bg #dashboard {
  height: calc(100vh - var(--tf-navbar-h));
  overflow: hidden !important; /* Prevent dashboard scroll */
  padding: 0;
  margin-top: var(--tf-navbar-h); /* Sit below the fixed navbar */
  margin-bottom: 0;
  margin-left: auto; /* Center horizontally */
  margin-right: auto; /* Center horizontally */
  max-width: 1400px; /* Optional: set max width for better layout on very wide screens */
}
body.demo-mode #dashboard > .row,
body.tf-bg #dashboard > .row {
  height: 100%;
  margin: 0 !important;
  overflow: hidden;
}
body.demo-mode #dashboard .container,
body.tf-bg #dashboard .container {
  height: 100%;
  overflow: hidden;
}

/* Left/right sidebars scroll internally; center section is the main scroller for posts */
body.demo-mode #dashboard aside,
body.tf-bg #dashboard aside {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.5rem 1.5rem 0.5rem; /* Align tops with padding */
}
body.demo-mode #dashboard section,
body.tf-bg #dashboard section {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.5rem 1.5rem 0.5rem; /* Match aside padding for alignment */
  overflow: hidden; /* Parent doesn't scroll, only feed does */
}

/* Cards maintain light backgrounds in demo mode and authenticated mode */
body.demo-mode #dashboard .tf-card,
body.tf-bg #dashboard .tf-card {
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--tf-text-dark);
  border: 1px solid rgba(12, 35, 64, 0.1);
  backdrop-filter: blur(10px);
}

/* Your Interests: make the list vertical and scrollable on demo and authenticated */
body.demo-mode #interestPills,
body.tf-bg #interestPills {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.15rem !important; /* Reduced from .25rem */
  --tf-interest-item-h: 38px; /* Reduced from 44px */
  max-height: calc(var(--tf-interest-item-h) * 3);
  overflow-y: auto;
  padding-right: .25rem;
}
/* Round corners on Your Interests card */
body.demo-mode aside .card.mb-3,
body.tf-bg aside .card.mb-3 {
  border-radius: 12px;
  overflow: hidden;
}

/* Add Friend button hover effect */
.add-friend-btn {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  min-width: 32px;
  transition: all 0.2s ease;
}
body.demo-mode .add-friend-btn {
  color: var(--tf-accent-blue);
  border-color: var(--tf-accent-blue);
}
body.demo-mode .add-friend-btn:hover {
  background-color: var(--tf-accent-blue);
  color: var(--tf-white);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(63, 138, 145, 0.3);
}
body.demo-mode .add-friend-btn.btn-success {
  transform: none;
}
body.demo-mode .add-friend-btn.btn-success:hover {
  transform: none;
  cursor: default;
}

/* Make key cards sticky within their columns so components feel locked in place */
body.demo-mode aside .tf-card:first-child,
body.demo-mode section .tf-card:first-child,
body.tf-bg aside .tf-card:first-child,
body.tf-bg section .tf-card:first-child {
  position: sticky;
  top: 0.75rem; /* small offset within column */
  z-index: 3;
}

/* Keep interest card header sticky within right column to keep 'Your Interests' label visible */
body.demo-mode aside .card.mb-3,
body.tf-bg aside .card.mb-3 { position: relative; }
body.demo-mode aside .card.mb-3 .card-body,
body.tf-bg aside .card.mb-3 .card-body {
  position: sticky;
  top: 0.75rem;
  z-index: 2;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--tf-text-dark);
}

/* Composer stays within column naturally with sticky positioning */
body.demo-mode .composer-card,
body.tf-bg .composer-card {
  position: sticky;
  top: 0;
  z-index: 10; /* Lower z-index, doesn't need to be 2000 */
  box-shadow: 0 8px 30px rgba(12, 35, 64, 0.15);
  backdrop-filter: blur(10px);
  overflow: visible;
  margin: 0 0 1rem 0; /* No side margins to stay within column */
  width: 100%;
  max-width: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  color: var(--tf-text-dark);
  border: 1px solid rgba(12, 35, 64, 0.1);
}
body.demo-mode .composer-card .card-body,
body.tf-bg .composer-card .card-body {
  padding: 0.75rem 1rem;
}

/* Feed scrolls naturally after composer (no padding needed with sticky positioning) */
body.demo-mode section #feed,
body.tf-bg section #feed {
  flex: 1 1 auto; /* allow feed to grow and be the main scroller */
  overflow-y: auto; /* scroll posts here */
  overflow-x: hidden;
  padding-top: 0; /* No padding needed - composer is sticky */
  position: relative;
  z-index: 1;
}

/* Ensure feed cards don't use z-index that could overlap composer */
body.demo-mode section #feed .card,
body.tf-bg section #feed .card { z-index: 1; }

/* Prevent per-post stacking or absolute positioning from overlapping composer */
body.demo-mode section #feed .card,
body.tf-bg section #feed .card { position: relative; }

/* Match spacing: make News for You separated from Interests same as Suggested Friends is from profile */
body.demo-mode aside .card.mb-3,
body.tf-bg aside .card.mb-3 { margin-bottom: 1.5rem; }
body.demo-mode aside .card.tf-card,
body.tf-bg aside .card.tf-card { margin-bottom: 1.5rem; }

/* Ensure the news list can scroll independently as well */
body.demo-mode #newsList.tf-news,
body.tf-bg #newsList.tf-news { max-height: 60vh; overflow-y: auto; }

/* Suggested friends hover effect */
.suggested-friend-avatar,
.suggested-friend-info {
  transition: all 0.2s ease;
}
.suggested-friend-avatar:hover,
.suggested-friend-info:hover {
  transform: scale(1.05);
  opacity: 0.85;
}
body.demo-mode .suggested-friend-info:hover .fw-semibold {
  color: var(--tf-accent-blue);
}

/* Password toggle button styling - dark theme default */
.input-group .btn-outline-secondary {
  border-color: #2a323f;
  color: var(--tf-text-light);
  background: var(--tf-surface);
}
.input-group .btn-outline-secondary:hover {
  background: var(--tf-primary);
  border-color: var(--tf-primary);
  color: var(--tf-white);
}
.input-group .btn-outline-secondary:focus {
  box-shadow: 0 0 0 0.25rem rgba(63, 138, 145, 0.25);
}
/* Light mode password toggle for demo mode and authenticated mode */
body.demo-mode .input-group .btn-outline-secondary,
body.tf-bg .input-group .btn-outline-secondary {
  background-color: var(--tf-white);
  color: var(--tf-text-dark);
  border-color: rgba(12, 35, 64, 0.2);
}
body.demo-mode .input-group .btn-outline-secondary:hover,
body.tf-bg .input-group .btn-outline-secondary:hover {
  background-color: var(--tf-primary);
  border-color: var(--tf-primary);
  color: var(--tf-white);
}

/* Shared post attachment styling */
.shared-post-attachment {
  background: var(--tf-surface);
  border-color: #2a323f !important;
}
body.demo-mode .shared-post-attachment {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(12, 35, 64, 0.15) !important;
}
.shared-post-attachment img {
  max-width: 100%;
  border-radius: 8px;
}
