/* ================= FINAL MOBILE CLEANUP ================= */
/* ================= MOBILE: STOP PULL-TO-REFRESH & OVERSCROLL ================= */
html,
body {
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;

  /* 🔒 Stops pull-to-refresh + overscroll chaining */
  overscroll-behavior: none;
}

/* iOS Safari fix */
body {
  position: relative;
  -webkit-overflow-scrolling: auto; /* disables rubber-band */
}

/* Ensure scrolling happens only inside page */
@media (max-width: 480px) {
  body {
    touch-action: pan-y;
  }
}

@media (max-width: 480px) {

  /* ---------------- GLOBAL REMOVALS ---------------- */

  .bottom-row,
  .bottom-row *,
  .footer,
  .footer-links,
  .footer-links *,
  body > div[style*="text-align:center"],
  .banner-links,
  .banner-links *,
  .nav-links,
  .nav-links * {
    display: none !important;
  }

  /* ❌ REMOVE ACCOUNT BOX */
  .login-logo,
  .login-logo * {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* ❌ REMOVE FROG ICONS */
  img[src*="frog-1.png"] {
    display: none !important;
  }

  /* ---------------- LAYOUT ---------------- */

  .main-content {
    display: flex !important;
    flex-direction: column !important;
  }

  /* ---------------- FRIEND REQUESTS ---------------- */

  /* ✅ KEEP FRIENDS / REQUESTS */
  .right-box {
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    order: 1; /* 👈 FIRST */
  }

  .right-box-content {
    height: auto !important;
    overflow: visible !important;
  }

  /* ---------------- RECENT POSTS ---------------- */

  .content-box.left-box {
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    order: 2; /* 👈 BELOW FRIENDS */
  }

  #recent-posts,
  .left-box-content {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
.right-box {
  display: none !important;
}
  /* ---------------- REMOVE MESSAGES ONLY ---------------- */


  /* ---------------- CONTAINER ---------------- */

  .container {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    transform: none !important;
    position: relative !important;

    min-height: 100vh !important;
    padding: 90px 8px 40px;

    display: flex;
    flex-direction: column;
  }
}
.mobile-bottom-nav {
  display: none !important;
}
/* ================= MOBILE BOTTOM NAV ================= */
@media (max-width: 480px) {

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 52px;


    display: flex;
    justify-content: space-around;
    align-items: center;

    z-index: 5000;
  }

  .mobile-bottom-nav a {
    font-size: 12px;
    color: #6ab0ff;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
  }

  .mobile-bottom-nav a:hover {
    text-decoration: underline;
  }


}

.banner-text,
.banner-search-wrapper,
.banner-search-wrapper *,
#banner-search-form {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* ================= MOBILE: RECENT POSTS FIX ================= */
@media (max-width: 480px) {

  /* Remove desktop height constraints */
  .main-content {
    height: auto !important;
    overflow: visible !important;
  }

  .content-box.left-box {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  .left-box-content,
  #recent-posts {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Ensure post cards expand and wrap */
  .post-item {
    width: 100% !important;
    height: auto !important;
    overflow: hidden !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .post-item img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
  }

}

@media (max-width: 480px) {

  .banner {
    width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right));
    margin-left: calc(-50vw + 50% + env(safe-area-inset-left));
    margin-right: calc(-50vw + 50% + env(safe-area-inset-right));

    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;


  }

  #ribbitLogo {
    max-height: 56px;
  }
}

@media (max-width: 480px) {
  body {
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
}

@media (max-width: 480px) {

  /* Stop desktop centering behavior */
  body {
    display: block !important;
  }

  /* Normalize container for mobile flow */
  .container {
    position: static !important;
    transform: none !important;
    padding-top: 0 !important;
    border: none !important;
  }

  /* Clean, normal mobile banner */
  .banner {
    position: static !important;
    height: auto !important;
    min-height: 56px;

    display: flex !important;
    justify-content: center !important;
    align-items: center !important;


  }

  #ribbitLogo {
    display: block !important;
    margin: 0 auto !important;
    max-height: 56px;
  }

}
@media (max-width: 480px) {
  #invite-bottom {
    display: none !important;
  }
}
@media (max-width: 480px) {

  /* FULL-WIDTH MOBILE BANNER */
  .banner {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;

    position: relative !important;
    left: 0 !important;
    right: 0 !important;

    display: flex !important;
    justify-content: center !important;
    align-items: center !important;


  }

  #ribbitLogo {
    max-height: 56px;
  }

}
/* ================= MOBILE: MESSAGES BOX MUST EXPAND ================= */
@media (max-width: 480px) {

  /* Outer messages box */
  .people-you-may-know {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* Inner messages container (THIS is the scrollbar culprit) */
  .people-you-may-know-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }

  /* Defensive: ensure children don’t force scroll */
  .people-you-may-know-content > *,
  .people-you-may-know-content * {
    max-height: none !important;
    overflow: visible !important;
  }
}
.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}


@media (max-width: 480px) {

  /* ✅ KEEP USER POSTS + ADD BOTTOM SPACE */
  .content-box.user-posts {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }


}
@media (max-width: 480px) {

  /* ✅ Single source of truth for scroll height */
  .container {
    min-height: calc(100vh + 120px) !important;
    padding-bottom: 140px !important; /* nav + safe space */
  }

}

@media (max-width: 480px) {

  .container {
    min-height: 100svh;     /* fills the viewport */
    height: auto !important; /* grows with content */
    display: flex;
    flex-direction: column;
  }

}
@media (max-width: 480px) {

  .banner {
    position: relative;
    padding-top: env(safe-area-inset-top);
  }

  .banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 32px; /* LOWER fade */

    pointer-events: none;
    z-index: 1;

    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;

    background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.6) 0%,
      rgba(0,0,0,0.35) 40%,
      rgba(0,0,0,0.12) 70%,
      rgba(0,0,0,0) 100%
    );
  }

}
@media (max-width: 480px) {

  .mobile-bottom-nav {
    position: relative;
  }

  .mobile-bottom-nav::after {
    content: "";
    position: absolute;
    bottom: -32px; /* sits below nav */
    left: 0;
    width: 100%;
    height: 32px;

    pointer-events: none;
    z-index: 1;

    border-top-left-radius: 14px;
    border-top-right-radius: 14px;

    background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.6) 0%,
      rgba(0,0,0,0.35) 40%,
      rgba(0,0,0,0.12) 70%,
      rgba(0,0,0,0) 100%
    );
  }

}
