:root {
      /* Base Colors */
      --color-background: #fffcf9;
      --color-text: #232121;
      --color-text-muted: var(--color-text);
      --color-border: #e5e4e2;
      --color-card-background: #ffffff;
      --color-section-background: var(--color-fuchsia-light);
      --card-bg: #ffffff;
      --text-color: #333333;
      --text-light: #666666;
      --accent-color: #007bff;
      --accent-hover: #0056b3;
      --shadow-color: rgba(0, 0, 0, 0.1);
      --color-brand: var(--color-fuchsia);
      --color-fuchsia: #4b0082;
      --color-fuchsia-light: #fde7f3;
      --color-orange-red: #f96353; /* Formerly --purple */
      --color-dark-blue: #0b1220; /* Formerly --dark */
      --color-indigo: #4f46e5;
      --color-indigo-light: #e0e7ff;
      --color-emerald: #059669;
      --color-emerald-light: #d1fae5;

      /* Typography */
      --color-title: #0b1220;

      /* UI Properties */
      --shadow-main: 0 10px 20px rgba(2, 6, 23, .08);
      --border-radius: 14px;
}
html.dark {
      --color-background: #0b1220;
      --color-dark-blue: #0b1220;
      --color-background2: #fffcf9;
      --color-text: #f5f7fa; /* Fixed from black */
      --color-text-muted: #94a3b8;
      --color-border: #334155;
      --color-card-background: #1e293b; /* Fixed from white */
      --color-section-background: #0b1220;
      --color-fuchsia-light: #2c1938;
      --color-title: #f1efeb;
      --shadow-main: 0 10px 20px rgba(0, 0, 0, .25);
}
    *{box-sizing:border-box}
    html,body{margin:0;background:var(--color-background);color:var(--color-text);font:16px/1.6 "Inter",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;overflow-x:hidden}
    a{color:inherit;text-decoration:none}
    img{display:block;max-width:100%}  
    .container{
    position:relative;
    max-width:1152px;
    margin-inline:auto;
    padding:0 18px;
    overflow:hidden;
  }
    .btn{display:inline-flex;align-items:center;justify-content:center;font-weight:700;border-radius:var(--border-radius);padding:.8rem 1.1rem;border:1px solid transparent;cursor:pointer;transition:all .2s ease-in-out}
    .btn-primary{background:linear-gradient(90deg,var(--color-fuchsia),var(--color-orange-red));color:#fff;border:none}
    .btn-outline{
      background: #ffffff; /* Fixed value from light theme's --color-card-background */
      border-color: #e5e4e2; /* Fixed value from light theme's --color-border */
      color: #232121; /* Explicitly set dark text color to prevent it from changing in dark mode */
    }
  
    .btn-outline:hover, .btn-outline:focus-visible {
      background: var(--color-fuchsia);
      color: #fff;
      border-color: var(--color-fuchsia);
    }
    .btn-dark{background:#0f172a;color:#fff}
    html.dark .btn-dark {
      background-color: var(--color-background2);
      color: var(--color-background);
    }
    .chip{display:inline-flex;align-items:center;gap:.35rem;padding:.35rem .6rem;border-radius:999px;font-size:.75rem;background:var(--color-border)}
    html.dark .chip {
      color: var(--color-text);
    }
    .h1{font-size:clamp(42px,5.2vw,58px);line-height:1.15;font-weight:800;letter-spacing:-.02em; color: var(--color-title);}
    .h2{font-size:clamp(24px,3.2vw,32px);font-weight:800;letter-spacing:-.01em;padding-top:20px; color: var(--color-title);}
    .h3{font-size:20px;font-weight:700;}
    .hcustom{font-size:clamp(24px,3.2vw,42px);font-weight:800;letter-spacing:-.01em;padding-top:20px;color: #fff;}
    .svg{
        position:absolute;
        top:0;
        left:0;
    }
    .sub{color:var(--color-text);padding-inline: 1rem;}
    .community-description { font-size: 1.1rem; padding-inline: 0; }
    .community-intro-card {
      background: #f96353; /* Use a fixed light background, independent of theme */
      margin-bottom: 24px;
    }
    .community-intro-card .h2 {
      padding-top: 0; /* Reset default h2 padding */
      margin-bottom: 8px; /* Add spacing below the heading */
      color: #0b1220; /* Fixed dark color for title */
    }
    .community-intro-card .sub.community-description {
      color: #232121; /* Fixed dark color for text, fulfilling the request */
    }
    .card .sub, .blog-card .sub, .step .sub, footer .sub { padding-inline: 0; } /* Reset padding for subs inside components */
    .card{background:var(--color-card-background);border:1px solid var(--color-border);border-radius:var(--border-radius);box-shadow:var(--shadow-main)}
    .grid{display:grid;gap:10px}
    .grid-2{grid-template-columns:repeat(2,minmax(0,275px));justify-content:center}
    .grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
    .grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
    @media (max-width:960px){.grid-3,.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media (max-width:640px){.grid-2,.grid-3{grid-template-columns:1fr}.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}}

    /* Loading Screen */
    #loader {
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: linear-gradient(90deg, var(--color-brand), var(--color-orange-red));
      display: flex;
      justify-content: center;
      align-items: center;
      transition: opacity 0.7s ease, visibility 0.7s ease;
      visibility: visible;
      opacity: 1;
    }
    #loader.hidden {
      opacity: 0;
      visibility: hidden;
    }
    .loader-logo {
      width: 120px;
      height: 120px;
      animation: pulse 1.5s infinite ease-in-out;
    }

    /* Header */
    .header{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.7);backdrop-filter:saturate(180%) blur(10px)}
    html.dark .header {
      background: rgba(11, 18, 32, 0.7); /* dark bg with transparency */
    }
    .nav{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0}
    .brand{display:flex;align-items:center;gap:10px;font-weight:700;padding-left:15px;font-size:clamp(18px, 4vw, 22px);line-height:1}
    header .brand {
      font-size: 30px;
    }
    .brand-icon{height:48px;width:48px;border-radius:var(--border-radius);object-fit:cover;}
    .navlinks{display:flex;gap:22px;align-items:center}
    @media (max-width:820px){.navlinks{display:none}}

    /* Center main navigation links */
    nav.navlinks {
      flex-grow: 1;
      justify-content: center; 
    }

    /* Theme Toggle Icons */
    html:not(.dark) #theme-icon-moon { display: none; }
    html.dark #theme-icon-sun { display: none; }

    /* Hero */
    .hero{height:auto;width:100%;display:grid;place-items:start;background:var(--color-background);padding: 0 0 20px;}
    .hero-wrap{display:grid;gap:clamp(0px, 4vw, 48px);grid-template-columns:1fr 1fr;}
    @media (max-width:1024px){.hero-wrap{grid-template-columns:1fr}}
    .smart-card{position:relative;border:1px solid var(--color-border);border-radius:16px;background:rgba(255,255,255,.78);box-shadow:var(--shadow-main);padding:22px;display:grid;gap:10px;align-content:start;margin-top: 20px;}
    .hero .sub {
      padding-inline: 0; /* Remove side padding for the hero subheading */
    }
    .smart-card .grid-2 {
      position: relative;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }
    @media (max-width: 500px) {
      .smart-card .grid-2 { grid-template-columns: 1fr; }
    }
    .thumb{height:210px;border-radius:var(--border-radius);overflow:hidden;position:relative;background:var(--color-border)}
    .pagination-btn {
      background: #f1f5f9;
      border: 1px solid var(--color-border);
      border-radius: 50%;
      width: 32px;
      height: 32px;
      color: var(--color-text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    }
    html.dark .pagination-btn {
      background: #334155;
    }
    .pagination-btn:hover:not(:disabled),
    .pagination-btn:focus-visible:not(:disabled) {
      background-color: var(--color-brand);
      color: #000; /* Black for the SVG stroke */
      border-color: var(--color-brand);
    }
    .pagination-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .profile-card.blurred {
      filter: blur(4px);
      pointer-events: none;
      user-select: none;
    }
    .paywall-overlay {
      position: absolute; 
      inset: 0; 
      background: rgba(255, 255, 255, 0.6);
      backdrop-filter: blur(2px);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 20px;
      border-radius: inherit;
      z-index: 2;
    }
    html.dark .paywall-overlay {
      background: rgba(11, 18, 32, 0.6);
    }
    .paywall-content .h3 {
      font-weight: 700;
      margin: 0;
    }
    @keyframes pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.1); }
    }
    .thumb img{width:100%;height:100%;object-fit:cover;transition:transform .25s;border-radius:inherit}
    .thumb:focus-visible{outline:3px solid var(--color-fuchsia)}
    .thumb:hover img{transform:scale(1.05)}
    .skeleton{position:absolute;inset:0;border-radius:inherit;background:linear-gradient(90deg, var(--color-border) 25%, #f1f5f9 37%, var(--color-border) 63%);background-size:400% 100%;animation:shimmer 1.1s infinite}
    html.dark .skeleton {
      background: linear-gradient(90deg, #1e293b 25%, #334155 37%, #1e293b 63%);
      background-size: 400% 100%;
    }
    html.dark .smart-card { background: rgba(30, 41, 59, 0.78); }
    html.dark .smart-card .sub {
      color: #fff; /* Override muted color for this specific element */
    }
    @keyframes shimmer{0%{background-position:100% 0}100%{background-position:0 0}}

#stories {
  padding-top: 0;
  padding-bottom: 40px;
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
}

#stories .container {
  border: none !important;
}

#stories .h2 {
  border: none !important;
}

#safety {
  margin-top: 0;
  padding-top: 0 !important;
}
    .stat{display:grid;place-items:center;padding:18px 0}
    .stat .num{font-weight:800;font-size:28px;letter-spacing:-.02em}
    .stat .lbl{font-size:.9rem;color:var(--color-text-muted)}

    /* New Stats Section */
    .new-stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 40px 30px;
      text-align: left;
    }

    @media (max-width: 960px) {
      .new-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 56px 40px;
      }
    }

    @media (max-width: 640px) {
      .new-stats-grid {
        grid-template-columns: 1fr;
      }
    }

    .new-stat {
      position: relative;
      padding-left: 24px;
    }

    .new-stat::before {
      content: "";
      position: absolute;
      left: 0;
      top: 4px;
      bottom: 4px;
      width: 3px;
      background: var(--color-dark-blue);
      border-radius: 3px;
    }

    .new-stat-value {
      font-weight: 800;
      letter-spacing: -0.02em;
      color: #fff;
      font-size: clamp(2.5rem, 6vw, 3.5rem);
      line-height: 1;
      margin: 0 0 4px;
    }

    .new-stat-caption {
      font-size: 1rem;
      color: var(--color-dark-blue);
      line-height: 1.4;
    }

    .stats-block {
      background-color: var(--color-orange-red);
      padding: 28px;
      border-radius: var(--border-radius);
    }

    /* Cards */
    .niche-card,.feature-card{padding:22px}
    .niche-icon{height:28px;width:28px;color:var(--color-fuchsia)}
    .niche-card-title { margin-top: 8px; }
    .niche-card {
      /* This sets a fixed background color, using the value from the light theme's --color-background. */
      background: #fffcf9;
    }
    /* When in dark mode, the niche-card has a light background, so text must be dark for contrast. */
    html.dark .niche-card {
      color: var(--color-dark-blue); /* Set default text color for the card to dark */
    }
    /* The .sub class has a global rule that makes it light in dark mode. We must override it here. */
    html.dark .niche-card .sub {
      color: #0b1220; /* Inherit the dark color from the .niche-card parent */
    }
    .niche-card-button { margin-top: 12px; }

    /* Make the niche card button have a consistent dark outline, regardless of theme */
    .btn-outline.niche-card-button {
      color: #0b1220;
      border-color: var(--color-dark-blue);
      background-color: transparent; /* Ensure it's an outline button */
    }
    .btn-outline.niche-card-button:hover {
      background-color: var(--color-dark-blue);
      color: #fff; /* White text on dark hover */
    }

/* ===== Why BadsX (new style) ===== */
    .why-badsx, .why-badsx--no-icons {
      background: var(--color-background);
      padding: 0 0 40px;
    }
    .why-badsx__container {
      max-width: 1116px;
      margin-inline: auto;
      padding: 0 18px;
    }
    .why-badsx__header {
      text-align: center;
      max-width: 950px;
      margin-inline: auto;
      margin-bottom: 40px;
    }
    .why-badsx__header .h2 {
      margin-bottom: 12px;
      color: var(--color-title);
    }
    .why-badsx__header p {
      color: var(--color-text-muted);
      line-height: 1.6;
      padding-inline: 1rem;
    }
    html.dark .why-badsx, html.dark .why-badsx--no-icons {
      background: var(--color-background);
    }
    #community {
      background-color: var(--color-orange-red);
    }
    .why-badsx__grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      /* Replaced grid with flex for JS-powered masonry layout */
      /* This container is now controlled by JS for the masonry layout */
      display: flex;
      align-items: flex-start;
      gap: 24px;
    }
    .masonry-column {
      display: flex;
      flex-direction: column;
      gap: 24px;
      flex: 1;
    }
    .why-badsx__card {
      background: var(--color-card-background);
      border: 1px solid var(--color-border);
      border-radius: var(--border-radius);
      padding: 24px;
      text-align: center;
    }
    .why-badsx__card .h3 {
      margin-top: 16px;
      margin-bottom: 8px;
    }
    .why-badsx__card .sub {
      margin: 0;
      padding-inline: 0;
    }
    .why-badsx__icon {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background-color: var(--color-fuchsia-light);
    }
    .why-badsx__icon svg {
      width: 28px; height: 28px; color: var(--color-fuchsia);
      stroke-width: 2; fill: none; stroke: currentColor;
    }
    .why-badsx__icon--indigo { background-color: var(--color-indigo-light); }
    .why-badsx__icon--indigo svg { color: var(--color-indigo); }
    .why-badsx__icon--emerald { background-color: var(--color-emerald-light); }
    .why-badsx__icon--emerald svg { color: var(--color-emerald); }
    .why-badsx--no-icons .why-badsx__card .h3 {
      margin-top: 0;
    }
    /* Profile Cards (Success Stories) */
    .profile-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
      gap: 24px;
    }

    /* Homepage Success Stories Carousel */
    .stories-carousel-wrapper {
      position: relative;
      width: 100%;
      padding: 0 calc((100% - 1152px) / 2 + 18px); /* Align with container padding */
    }

    #stories .profile-grid {
      display: flex;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      gap: 24px;
      padding: 10px 0; /* Add padding so hover shadow isn't cut off */
      -ms-overflow-style: none;  /* IE and Edge */
      scrollbar-width: none;  /* Firefox */
      scroll-behavior: smooth;
    }

    #stories .profile-grid::-webkit-scrollbar {
      display: none; /* Chrome, Safari, and Opera */
    }

    #stories .profile-grid .profile-card {
      flex: 0 0 400px; /* Don't grow, don't shrink, base width 400px */
      scroll-snap-align: start;
    }

    .story-controls-container {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      margin-top: 16px;
      max-width: 1152px; /* Align with container */
      margin-inline: auto; /* Center it */
    }

    .story-scroll-btn {
      width: 48px;
      height: 48px;
      background-color: #fff !important;
      color: #000 !important;
      border: 2px solid #fff !important;
    }
    .story-scroll-btn:hover:not(:disabled) {
      background-color: #f8f9fa !important;
      color: #000 !important;
      border: 2px solid #f8f9fa !important;
    }
    .story-scroll-btn:disabled {
      background-color: #f8f9fa !important;
      color: #6c757d !important;
      border: 2px solid #f8f9fa !important;
      opacity: 0.6;
    }

    .profile-card {
      overflow: hidden;
      padding: 0;
      cursor: pointer;
      text-align: left;
      transition: transform 0.2s ease-in-out;
    }
    .profile-card:hover {
      transform: scale(1.03);
      z-index: 10;
      box-shadow: 0 15px 30px rgba(2,6,23,.12);
    }
    .profile-card-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
    .profile-card-content { padding: 16px; }
    .profile-card-name { font-size: 18px; font-weight: 700; margin: 0; }
    .profile-card-role { font-size: 0.9rem; margin-top: 4px; }

    #stories .card, #stories .profile-card {
      border: none;
    }

    #stories-grid {
      padding-bottom: 30px;
    }

    /* CTA band */
    .cta{background:linear-gradient(90deg, var(--color-fuchsia), var(--color-orange-red));color:#fff;padding:30px 0;margin-top:100px}
    .cta .h2 {
      padding-top: 0;
    }

    /* Footer */
    footer{background:#020617;color:#e5e4e2;}
    html:not(.dark) footer { color: #e5e4e2; } /* Ensure light text on dark footer in light mode */
    footer .sub {
      color: #e5e4e2;
    }
    html:not(.dark) footer a { color: #e5e4e2; }
    footer .brand-icon { height: 36px; width: 36px; }
    footer .cols{display:grid;gap:28px;grid-template-columns:2fr 1fr 1fr 1fr}
    @media (max-width:900px){footer .cols{grid-template-columns:1fr 1fr}}
    @media (max-width:540px){footer .cols{grid-template-columns:1fr}}

    /* When modal is open */
    body.modal-is-open { overflow: hidden; }
    body.modal-is-open .header { display: none; }

    /* Modal */
    .modal{position:fixed;inset:0;display:none;background:rgba(15, 23, 42, 0.7);padding:16px;overflow-y:auto;z-index:1000}
    html:not(.dark) .modal {
      background:rgba(0,0,0,.5);
    }
    .modal.open{display:flex;align-items:center;justify-content:center}
    .profile{position:relative;max-width:780px;width:min(100%,780px);margin:auto} /* margin:auto centers it in the flex container */
    .banner{position:relative;height:200px}
    .avatar{position:absolute;left:22px;bottom:-75px;height:150px;width:150px;border-radius:24px;border:4px solid var(--color-card-background);object-fit:cover;box-shadow:0 6px 18px rgba(2,6,23,.18)}
    .close{position:absolute;top:12px;right:12px;background:var(--color-card-background);border:none;border-radius:999px;padding:8px;cursor:pointer; color: var(--color-text);}
    .gallery-slider{position:relative;overflow:hidden;border-radius:var(--border-radius)}
    .gallery-track{display:flex;transition:transform .3s ease-in-out}
    .gallery-slider .ph{flex:0 0 100%;width:100%;position:relative;aspect-ratio:4/3;background-color:#e5e4e2}
    .slider-btn{
      position:absolute;
      top:50%;
      transform:translateY(-50%);
      background:rgba(255,255,255,.85); /* Keep this light for contrast on dark images */
      border:none;
      border-radius:50%;
      width:40px;
      height:40px;
      font-size:24px;
      font-weight:bold;
      color:#333;
      cursor:pointer;
      z-index:10;
      display:flex;
      align-items:center;
      justify-content:center;
      line-height:1;
      padding-bottom:4px
    }
    .slider-btn.prev{left:10px}
    .slider-btn.next{right:10px}
    .slider-btn:hover{
      background:#fff;
    }
    .modal-section-title {
      font-size: 1rem;
      font-weight: 700;
      margin-top: 24px;
      margin-bottom: 8px;
    }
    .profile-body {
      padding: 0 24px 24px;
      /* On mobile, this div just adds padding. On desktop, it becomes the scrollable area. */
    }
    .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
    .hidden{display:none}

    /* Blurred photo effect for gallery */
    .ph-bg {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: blur(15px);
      transform: scale(1.1);
    }
    .ph-fg {
      position: relative;
      z-index: 1;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .modal-blur-overlay {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.6);
      backdrop-filter: blur(4px);
      display: none; /* Controlled by JS */
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      color: white;
      padding: 20px;
      border-radius: inherit;
      z-index: 15;
    }

    /* Desktop Modal: Contained and internally scrollable */

.niches-hero {
  background: linear-gradient(180deg, #fde7f3 0%, #fff 55%);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
html.dark .niches-hero {
  background: linear-gradient(180deg, var(--color-background) 0%, #131c2f 55%);
}

.niches-hero .h1 {
  font-size: clamp(36px, 4vw, 48px);
  margin-bottom: 10px;
}

.niches-hero .sub {
  max-width: 700px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
}

#niche-display-section {
  padding: 50px 0;
}

.niche-category-section {
  margin-bottom: 40px;
}

.niche-category-section .h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--color-fuchsia);
}

.niche-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.niche-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 25px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.niche-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(2,6,23,.12);
}

.niche-card .niche-icon {
  height: 40px;
  width: 40px;
  color: var(--color-orange-red);
  margin-bottom: 10px;
}

.niche-card-title {
  font-size: 22px;
  margin-top: 0;
  margin-bottom: 8px;
}

.niche-card .sub {
  font-size: 0.95rem;
  flex-grow: 1;
  margin-bottom: 15px;
}

.niche-card-button {
  margin-top: auto; /* Pushes the button to the bottom */
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .niche-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 480px) {
  .niche-grid {
    grid-template-columns: 1fr;
  }
  .niche-card {
    padding: 20px;
  }
  .niche-card .niche-icon {
    height: 35px;
    width: 35px;
  }
  .niche-card-title {
    font-size: 20px;
  }
}

/* Search Bar Styles */
.search-bar-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden; 
  background-color: var(--color-background);
}

.search-input {
  flex-grow: 1;
  padding: 12px 18px;
  border: none;
  font-size: 1rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-button {
  background-color: var(--color-fuchsia);
  color: #fff;
  border: none;
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.search-button:hover {
  background-color: var(--color-orange-red);
}

.search-button svg {
  stroke: currentColor;
}

/* Filter Buttons */
.filter-buttons-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 15px;
}

.filter-button {
  background-color: #f1f5f9;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
html.dark .filter-button {
  background-color: #334155;
}

.filter-button:hover {
  background-color: #e5e4e2;
}

.filter-button.active {
  background-color: var(--color-fuchsia);
  color: #fff;
  border-color: var(--color-fuchsia);
}

/* How It Works Page Styles */
.hero-small {
  background: linear-gradient(180deg, #fde7f3 0%, #fff 55%);
  padding-top: 5px;
  padding-bottom: 20px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
html.dark .hero-small {
  background: linear-gradient(180deg, var(--color-background) 0%, #131c2f 55%);
}

.hero-small .h1 {
  font-size: 30px;
  margin-bottom: 10px;
}

.hero-small .sub {
  max-width: 700px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
}

/* Infinite Carousel styles */
.carousel {
  overflow: hidden; /* Hide anything outside the carousel */
  width: 100%;
  margin-top: 20px; /* Add some space above the carousel */
  /* Removed max-width to allow full width for infinite scroll */
  /* Removed box-shadow and border-radius from here, can be applied to carousel-item */
}

.carousel-inner {
  display: flex; /* Arrange items horizontally */
  /* The width will be calculated by the content inside */
  animation: scrollRight 30s linear infinite; /* Animation for continuous scroll */
  cursor: grab; /* Indicate that the carousel is grabbable */
  -webkit-overflow-scrolling: touch; /* Enable momentum scrolling on iOS */
}

.carousel-inner.active {
  cursor: grabbing; /* Change cursor when dragging */
  animation-play-state: paused; /* Pause animation when active (dragging) */
}

.carousel-item {
  flex: 0 0 300px; /* Prevent items from shrinking, set fixed width */
  margin-right: 20px; /* Space between items */
  text-align: center;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.carousel-item img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 10px;
}

.carousel-caption .h3 {
  font-size: 1.2em;
  margin-top: 0; /* Reset margin-top from previous styles */
  margin-bottom: 5px;
  color: var(--color-fuchsia); /* Keep original color */
}

.carousel-caption .sub {
  font-size: 0.9em;
  color: #666; /* Keep original color */
  margin-top: 8px; /* Keep original margin-top */
}

/* Keyframes for infinite right scroll */
@keyframes scrollRight {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%); /* Scrolls half the width of duplicated content */
  }
}

/* Remove existing carousel-control styles as they are not needed for infinite scroll */
.carousel-control {
  display: none;
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
  .carousel-item {
    flex-direction: column;
    text-align: center;
  }

  .carousel-item img {
    width: 80%;
    margin-right: 0;
    margin-bottom: 20px;
  }

  .carousel-caption {
    width: 90%;
  }

  .carousel-caption .h3,
  .carousel-caption .sub {
    text-align: center;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Styles for story modal, signup modal etc. */
.modal-content {
    background-color: var(--color-card-background);
    margin: auto; /* Center the modal */
    padding: 30px;
    border-radius: var(--border-radius);
    width: 80%; /* Could be more responsive */
    max-width: 700px;
    position: relative;
    box-shadow: var(--shadow-main);
    animation-name: animatetop;
    animation-duration: 0.4s
}

.onboarding-modal-content {
  background-color: var(--dark); /* Use a dark background for the form */
  color: #fff; /* Light text for dark background */
  border: 1px solid #374151;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.4);
  max-width: 500px; /* Adjust as needed for the form */
}

.signup-modal-content .form-group {
    margin-bottom: 15px;
}

.signup-modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.signup-modal-content input[type="text"],
.signup-modal-content input[type="email"],
.signup-modal-content input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
}

.signup-modal-content button[type="button"],
.signup-modal-content button[type="submit"] {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

.signup-modal-content button[type="button"], .choice-btn {
    background-color: var(--color-orange-red);
    color: #fff;
}

.signup-modal-content button[type="button"]:hover, .choice-btn:hover {
    background-color: #3a0062; /* Darker purple */
}

.signup-modal-content button[type="submit"] {
    background-color: var(--color-fuchsia);
    color: #fff;
}

.signup-modal-content button[type="submit"]:hover {
    background-color: #a21caf; /* Darker fuchsia */
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.modal-text-content {
    padding-right: 20px;
}

/* Add Animation */
@-webkit-keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}

@keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 2px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Live counter styles (if needed, adjust as per actual implementation) */
.live-counter {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #28a745; /* Green for online */
  border-radius: 50%;
  margin-right: 5px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#modal-story-name {
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 15px;
    color: var(--color-fuchsia);
}
html.dark #modal-story-name {
    color: #fff;
}

#modal-story-text {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text);
}

/* Story Gallery Vertical */
.story-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.story-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.story-gallery img:hover {
    transform: scale(1.05);
}

.submit-story {
    padding: 50px 0;
    border-top: 1px solid var(--color-border);
}

/* Contact Page */
#contact-section {
  padding: 50px 0;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
}
@media (max-width: 960px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
.contact-info {
  padding: 30px;
}
.contact-details {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  display: grid;
  gap: 18px;
}
.contact-details li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.contact-details svg {
  color: var(--color-fuchsia);
}
.contact-form {
  padding: 30px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Form Controls (used on Contact and Signup pages) */
.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: .6rem .9rem; /* Adjusted for a less bulky feel */
  font: inherit;
  line-height: 1.5;
  color: #000; /* Black text for light mode */
  background-color: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
html.dark .form-control,
html.dark .form-select {
  color: var(--text);
  background-color: #374151; /* Dark background for form fields */
  border-color: #4B5563;   /* Darker border */
}
.form-control::placeholder,
.form-select:required:invalid {
  /* Style for placeholder text like "Day", "Month", "Year" and in inputs */
  color: #000; /* Black for light mode placeholders */
}
/* In dark mode, make placeholders lighter and slightly transparent to distinguish them from selected values */
html.dark .form-control::placeholder,
html.dark .form-select:required:invalid {
  color: var(--color-text);
  opacity: 0.65;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--color-fuchsia);
  box-shadow: 0 0 0 3px rgba(192, 38, 211, 0.18);
}

/* Help Center / FAQ */
#faq-section {
  padding: 50px 0;
}
.faq-accordion {
  display: grid;
  gap: 15px;
}
.faq-item {
  padding: 0; /* Remove padding from card to let button fill it */
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  padding: 20px 25px;
  font-size: 1.1rem;
  font-weight: 600; 
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
}
.faq-question:hover {
  background-color: #f9fafb;
}
html.dark .faq-question:hover {
  background-color: #334155;
}
html.dark .faq-question {
  color: #fff;
}
.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-text-muted);
  transition: transform 0.3s ease;
}
.faq-question.active::after {
  transform: rotate(45deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.faq-answer p {
  padding: 0 25px 20px;
  margin: 0;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* Blog Page */
#blog-section {
  padding: 50px 0;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}
.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(2,6,23,.12);
}
.blog-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.blog-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.blog-card-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.blog-card-title {
  margin-top: 0;
  margin-bottom: 10px;
}
.blog-card .sub {
  margin-top: 0;
}
.blog-card-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
}

/* Signup Page Body */
body.signup-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--color-section-background) 0%, var(--color-background) 55%);
}

/* Center the form vertically and horizontally within the main content area */
#signup-form-main {
  flex-grow: 1;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 24px 18px;
}
/* =================================== */
/* ========== Responsive Styles ========== */
/* =================================== */

/* --- Mobile Navigation --- */
.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding-right: 10px;
  z-index: 1001;
  color: var(--text);
}
.mobile-menu-button .icon-close { display: none; }

.mobile-nav {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--color-card-background);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.4s;
}
.mobile-nav-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.mobile-nav-content > *,
.mobile-nav-footer {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.mobile-nav-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 8px;
  line-height: 0; /* Prevents extra space */
}
.mobile-nav .nav-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mobile-nav .nav-items a {
  font-size: 1.5rem;
  font-weight: 700;
}
.mobile-nav .nav-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 280px;
}
.mobile-nav-footer {
  position: absolute;
  bottom: 2rem;
  transform: translateY(15px); /* Initial transform for animation */
}
.mobile-nav .nav-actions .btn,
.mobile-nav .nav-actions .sub {
  width: 100%;
  text-align: center;
  font-size: 1.1rem;
}

/* --- Tablet & Mobile Breakpoints --- */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
  .hero-wrap {
    grid-template-columns: 1fr;
    padding: 0 0 40px;
    transform: translateY(0);
    text-align: center;
  }
  .hero-wrap > div:first-child > div {
    justify-content: center;
  }
  .smart-card {
    transform: translateY(0);
    margin-top: 40px;
  }
  .hero {
    height: auto;
    padding-inline: 18px;
  }
}

/* General tablets */
@media (max-width: 960px) {
  .why-badsx__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile navigation activation */
@media (max-width: 820px) {
  .header .navlinks { display: none; } /* Hide desktop nav groups */
  .mobile-menu-button { display: block; } /* Show hamburger */
  
  body.mobile-menu-open .mobile-menu-button .icon-menu { display: none; }
  body.mobile-menu-open .mobile-menu-button .icon-close { display: block; }
  body.mobile-menu-open .mobile-nav {
    transform: translateX(0);
    visibility: visible;
  }
  body.mobile-menu-open { overflow: hidden; }
  body.mobile-menu-open .mobile-nav-content > *:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
  }
  body.mobile-menu-open .mobile-nav-content > *:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
  }
  body.mobile-menu-open .mobile-nav-footer {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
  }
}

/* General mobile phones */
@media (max-width: 640px) {
  .why-badsx__grid {
    grid-template-columns: 1fr;
  }
}
html.dark body.signup-page {
  background: linear-gradient(180deg, var(--color-background) 0%, #131c2f 55%);
}

/* Signup Form Choices */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.choice-btn { 
    display: block; 
    width: 100%; 
    padding: 0.85rem 0.75rem; 
    margin-bottom: 0; 
    border: 2px solid var(--color-border); 
    background-color: var(--color-card-background); 
    color: var(--color-text); 
    border-radius: 0.5rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.25s ease; 
    font-size: 0.95rem;
}
html.dark .choice-btn {
    background-color: #374151;
    border-color: #4B5563;
    color: #F9FAFB;
}
.choice-btn:hover { 
    border-color: var(--color-fuchsia); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.15);
}
.choice-btn.selected { 
    background-color: var(--color-fuchsia); 
    border-color: var(--color-fuchsia); 
    color: #fff; 
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

/* Form Container Enhanced Styling */
#signup-form-main .form-container {
    position: relative;
}

html.dark #signup-form-main .form-container {
    background: linear-gradient(145deg, #1F2937 0%, #111827 100%);
    border: 1px solid #374151;
}

/* Form Controls Enhanced */
#signup-form-main .form-control,
#signup-form-main .form-select {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

html.dark #signup-form-main .form-control,
html.dark #signup-form-main .form-select {
    background-color: #374151;
    border-color: #4B5563;
    color: #F9FAFB;
}

html.dark #signup-form-main .form-control:focus,
html.dark #signup-form-main .form-select:focus {
    border-color: var(--color-fuchsia);
    box-shadow: 0 0 0 0.25rem rgba(236, 72, 153, 0.15);
    background-color: #374151;
}

html.dark #signup-form-main .form-control::placeholder {
    color: #9CA3AF;
}

/* Submit Button Enhanced */
#signup-form-main button[type="submit"] {
    position: relative;
    overflow: hidden;
}

#signup-form-main button[type="submit"]:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

#signup-form-main button[type="submit"]:active {
    transform: scale(0.98);
}

.dob-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.niche-grid-with-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 16px;
}
.niche-grid-with-controls .pagination-btn {
    flex-shrink: 0; /* Prevent buttons from shrinking */
    width: 40px;
    height: 40px;
    background-color: #fff !important;
    border-color: #fff !important;
    color: #000 !important;
}

.niche-grid-with-controls .pagination-btn:hover:not(:disabled),
.niche-grid-with-controls .pagination-btn:focus-visible:not(:disabled) {
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
    color: #000 !important;
}

.niche-grid-with-controls .pagination-btn:disabled {
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
    color: #6c757d !important;
    opacity: 0.6;
}
.niche-grid-with-controls #nicheGrid {
    flex-grow: 1; /* Allow grid to take up available space */
    margin-top: 0; /* Reset margin as it's now inside a flex container */
}


        .page-header h1 {
            font-size: 2.5rem;
            margin-bottom: 8px;
        }

        .page-header p {
            font-size: 1.1rem;
            color: var(--text-light);
            max-width: 600px;
            margin: 0 auto;
        }

        /* Masonry Grid Layout */
        .bt-masonry-grid {
            /* Using CSS Grid with 3 columns, similar to the reference site */
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 24px;
            max-width: 1400px;
            margin: 0 auto;
            align-items: start; /* Prevents items in a row from stretching to the same height */
        }

        /* Responsive Collapse */
        @media (max-width: 991px) {
            .bt-masonry-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Flip Card Setup */
        .bt-masonry-entry {
            perspective: 1000px; /* 3D space for the flip effect */
        }
        
        .bt-masonry-column {
            display: grid;
            gap: 24px;
        }

        .bt-flip-card-inner {
            position: relative;
            width: 100%;
            transform-style: preserve-3d;
            border-radius: 12px;
            box-shadow: 0 4px 12px var(--shadow-color);
            background-color: var(--card-bg);
        }

        .bt-flip-card-front {
            /* This card is in the normal flow, so its content determines the height of the container. */
            width: 100%;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            border-radius: 12px;
            overflow: hidden;
        }

        .bt-flip-card-back {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            -webkit-backface-visibility: hidden; /* Safari */
            backface-visibility: hidden;
            border-radius: 12px;
            transform: rotateY(180deg);
            display: flex;
            flex-direction: column;
            background-color: var(--card-bg);
        }

        /* Card Content Styling */
        .bt-card-content {
            padding: 24px;
            display: flex;
            flex-direction: column;
            box-sizing: border-box; /* Ensure padding is included in height */
        }

        .bt-flip-card-back .bt-card-content {
            /* Content will now expand the card, so no scroll needed */
        }

        .bt-card-image {
            width: 100%;
            height: auto;
            display: block;
        }

        .bt-card-content .bt-card-image {
            margin: 20px 0 0;
            width: 100%;
            max-width: 100%;
            border-radius: 8px; /* Keep the image corners soft inside the card */
        }

        /* This style makes the image flush with the bottom of the card. */
        .bt-card-content .bt-card-image2 {
            margin: 20px 0 -24px; /* Adjusts bottom margin to counteract the card's padding */
            width: 100%;
            border-radius: 8px; /* Keep the corners consistent with other images */
        }

        .bt-card-content h3 {
            margin: 0 0 12px 0;
            font-size: 1.4rem;
            color: var(--text-color);
        }

        .bt-card-content p {
            margin: 0;
            color: var(--text-light);
            line-height: 1.6;
            flex-grow: 1; /* Pushes the icon to the bottom */
            overflow-wrap: break-word; /* Ensures long text wraps and doesn't break the grid */
        }

        /* Icons */
        .learn-more-icon {
            font-size: 1.5rem;
            color: var(--accent-color);
            margin-top: 20px;
            align-self: flex-end;
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .learn-more-icon:hover {
            color: var(--accent-hover);
        }

        .bt-flip-card-back .learn-more-icon {
            align-self: flex-start; /* Position icon to the left on the back */
        }