/* ===================================================================
   BASE & LAYOUT
   =================================================================*/
html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 0;
  /* Padding for fixed mobile footer. Resets in @media query */
  padding-bottom: 60px;
}

body.toggled {
  overflow: hidden;
}

/* Use flexbox for vertical layout */
.page {
  transition: transform .2s ease-in-out;
  flex-grow: 1; /*push footer to bottom*/
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Make the main content fill available space */
main {
  flex-grow: 1;
}

/* Offset sections for sticky navbar height */
section {
  scroll-margin-top: 72px; /* Unified value */
  padding-top: 3rem;
  padding-bottom: 3rem;
}

/* ===================================================================
   NAVBAR
   =================================================================*/
.app-navbar {
  position: fixed;
  top: 0;
  z-index: 1030;
  width: 100%;
  background: #fff;
  transition: box-shadow .2s, border-color .2s;
}

/* Active link highlighting */
.app-nav .nav-link {
  border-bottom: 2px solid transparent;
  padding-bottom: .5rem;
  color: var(--bs-success);
}

.app-nav .nav-link.active {
  border-bottom-color: var(--bs-success);
  color: var(--bs-success) !important;
}

/* Navbar shadow on scroll */
.scrolled {
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}

/* ===================================================================
   SIDEBAR (MOBILE MENU)
   =================================================================*/
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 70vw;
  max-width: 300px; /* Unified value */
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, .08);
  transform: translateX(-100%);
  transition: transform .3s ease-in-out;
  z-index: 1040;
  padding: 1rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 1035;
}

/* Toggle States */
body.toggled .sidebar {
  transform: translateX(0);
}

body.toggled .overlay {
  opacity: 1;
  pointer-events: auto;
}

body.toggled .page {
  transform: translateX(70vw);
}

body.toggled .toggle-btn {
  display: none !important;
}

/* Hamburger menu icon */
.hamburger-menu {
  width: 28px;
  height: 20px;
  position: relative;
  cursor: pointer;
}

.bar {
  height: 2px;
  background-color: var(--bs-success);
  position: absolute;
  right: 0;
  transition: transform .3s ease-in-out, width .3s ease-in-out;
}

.bar-top {
  top: 0;
  right: 0;
  width: 100%;
}

.bar-middle {
  top: 50%;
  width: 66.667%;
  transform: translateY(-50%);
}

.bar-bottom {
  bottom: 0;
  right: 0;
  width: 33.333%;
}

/* ===================================================================
   PAGE SECTIONS & COMPONENTS
   =================================================================*/
/* Hero section */
.hero {
  background: url('../images/hero.webp') no-repeat center center/cover;
  min-height: 450px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1;
}

.hero-content {
  z-index: 2;
}

.hero-content h1,
.hero-content p {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Card image ratio 4:3 */
.card-img-top {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Testimonials image */
img.rounded-circle {
  filter: brightness(0.7); /* dark hue */
}

/* ===================================================================
   PRICING SECTION (CLEANED)
   - Removed all aggressive/animating/card rules that conflicted.
   - Keep only minimal layout & utility classes so pricing markup is neutral.
   =================================================================*/
#pricing {
  /* minimal presentational rules only */
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 1rem;
  padding-top: 5rem;
  padding-bottom: 5rem;
  position: relative; /* Kept from duplicate block to ensure z-index */
  z-index: 1020; /* Kept from duplicate block to ensure z-index */
}

/* Keep accordion header simple and consistent with other headers */
#pricing .accordion-button {
  font-weight: 900;
  padding: 1rem 1.25rem;
  gap: .75rem;
  border-radius: .5rem !important;
  background: #fff;
  box-shadow: none; /* removed shadow to avoid stacking issues */
  transition: none;
  color: var(--bs-success) !important; /* FIX: Set text color to success green */
}

/* Accordion body: neutral, inherit page typography */
#pricing .accordion-body {
  background: transparent !important;
  border: none !important;
  padding: 1rem !important;
  color: #0b1728 !important; /* FIX: Enforce dark color for visibility */
}

/* FIX 1 (Structural): Force display and height when fully open */
#pricing .accordion-collapse.show {
  display: block !important;
  height: auto !important;
}

/* FIX 2 (The Visibility Issue): Force the content wrapper (.no-card) to be visible */
/* This rule is highly specific and should override any remaining hidden states. */
#pricing .accordion-collapse.show .no-card {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  height: auto !important;
}

/* FIX 3: Ensure any elements inside the content wrapper are also visible */
#pricing .accordion-collapse.show .no-card * {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Explicit: do NOT animate or force opacity/transform on pricing children */
#pricing .card,
#pricing .card * {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
}

/* Remove any forced .weekly-plan or .pricing-visible overrides */
#pricing .weekly-plan,
#pricing .pricing-visible {
  all: unset;
  display: block;
  box-sizing: border-box;
}

/* Utility: plain inline layout inside accordion (no borders/shadows) */
.no-card {
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

/* Keep collapse overflow visible during transitions to avoid clipping */
#pricing .accordion-collapse {
  overflow: visible !important;
}

/* Prevent Bootstrap's temporary collapsing height from clipping content */
#pricing .accordion-collapse.collapsing {
  height: auto !important;
  transition: none !important;
}

/* Small responsive tweaks to fit carousel/accordion */
@media (max-width: 767px) {
  #pricing .fs-4 { font-size: 1.125rem; }
  .no-card { padding-left: .5rem; padding-right: .5rem; }
}

#overlay { z-index: 980 !important; }

/* Minimal fade (non-blocking) - KEPT FROM DUPLICATE BLOCK */
@keyframes pricingFade { from { opacity: .0; transform: translateY(6px);} to {opacity:1; transform:none;} }
.pricing-fade-in { animation: pricingFade .32s ease-out both; }

/* ===================================================================
   MOBILE FOOTER NAVIGATION
   =================================================================*/
.app-footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1020; /* Below sidebar/overlay */
  background: #fff;
  border-top: 1px solid #E5E7EB; /* border-gray-200 */
}

.footer-inner-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60px; /* Fixed height for mobile footer */
}

.footer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #4B5563; /* text-gray-600 */
  transition: color 0.1s;
  flex: 1; /* Equal width buttons */
  padding: 4px 0;
}

.footer-btn:hover,
.footer-btn.active {
  color: #059669; /* text-success */
}

.footer-circle-wrapper {
  /* For the center 'Home' button */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #059669; /* bg-success */
  color: #fff;
  transform: translateY(-15px); /* Lift it up */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  border: 4px solid #fff; /* White ring */
}

.footer-circle-wrapper i {
  font-size: 1.5rem;
}

/* Hide the custom footer and reset body padding on desktop */
@media (min-width: 768px) {
  .app-footer-nav {
    display: none;
  }

  body {
    padding-bottom: 0 !important; /* Reset for desktop */
  }
}
