/* ==========================================================================
   BadhteJao.com - Sitewide Floating Desktop Sidebar, Mobile Bottom Nav
   & Join Us Community QR Slider Modal
   ========================================================================== */

:root {
  --bj-nav-primary: #0d6efd;
  --bj-nav-dark: #0f172a;
  --bj-nav-surface: #ffffff;
  --bj-nav-border: rgba(15, 23, 42, 0.1);
  --bj-nav-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

/* Desktop Floating Right-Side Vertical Rail (>= 992px) */
.bj-floating-rail {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1035;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--bj-nav-border);
  border-radius: 18px;
  box-shadow: var(--bj-nav-shadow);
}

@media (min-width: 992px) {
  .bj-floating-rail {
    display: flex;
  }
}

.bj-rail-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: #f8fafc;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-size: 1.05rem;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}

.bj-rail-item:hover,
.bj-rail-item:focus-visible {
  background: var(--bj-nav-primary);
  color: #ffffff;
  transform: translateX(-3px);
  box-shadow: 0 6px 14px rgba(13, 110, 253, 0.28);
  outline: none;
}

.bj-rail-item.is-active {
  background: #e7f1ff;
  color: var(--bj-nav-primary);
}

.bj-rail-item.is-join {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: #ffffff;
}

.bj-rail-item.is-join:hover,
.bj-rail-item.is-join:focus-visible {
  background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
  color: #ffffff;
}

/* Tooltip for Desktop Floating Rail */
.bj-rail-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: var(--bj-nav-dark);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 11px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
}

.bj-rail-tooltip::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--bj-nav-dark);
}

.bj-rail-item:hover .bj-rail-tooltip,
.bj-rail-item:focus-visible .bj-rail-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Mobile Fixed Bottom Navigation Bar (< 992px) */
.bj-mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1035;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 992px) {
  .bj-mobile-bottom-nav {
    display: none;
  }
}

.bj-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 46px;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: #334155;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.18s ease, background-color 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bj-bottom-item i {
  font-size: 1.05rem;
  line-height: 1;
}

.bj-bottom-item.is-active {
  color: var(--bj-nav-primary);
  background: rgba(13, 110, 253, 0.08);
}

.bj-bottom-item.is-join {
  color: var(--bj-nav-primary);
}

.bj-bottom-item:hover,
.bj-bottom-item:focus-visible {
  color: var(--bj-nav-primary);
  outline: none;
}

/* Keep page bottom and back-to-top button clear of mobile bottom bar */
@media (max-width: 991.98px) {
  body.bj-has-bottom-nav {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  body.bj-has-bottom-nav .back-to-top {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px !important;
  }
}

/* ==========================================================================
   Join Us Community Slider Modal
   ========================================================================== */
.bj-join-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bj-join-backdrop.is-open {
  display: flex;
}

.bj-join-dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  color: #0f172a;
}

.bj-join-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: #ffffff;
}

.bj-join-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
}

.bj-join-subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.88);
}

.bj-join-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.bj-join-close:hover,
.bj-join-close:focus-visible {
  background: rgba(255, 255, 255, 0.3);
  outline: 2px solid #ffffff;
}

.bj-join-slider-wrap {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 14px;
}

.bj-join-track {
  display: flex;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: pan-y;
}

.bj-join-slide {
  flex: 0 0 100%;
  min-width: 100%;
  text-align: center;
  padding: 4px 10px 6px;
  box-sizing: border-box;
}

.bj-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.bj-platform-telegram {
  background: #e0f2fe;
  color: #0369a1;
}

.bj-platform-whatsapp {
  background: #dcfce7;
  color: #15803d;
}

.bj-platform-facebook {
  background: #dbeafe;
  color: #1d4ed8;
}

.bj-qr-box {
  width: 216px;
  max-width: 72%;
  margin: 0 auto 12px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.bj-qr-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
}

.bj-slide-desc {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.45;
  margin: 0 auto 10px;
  max-width: 340px;
}

.bj-slide-url {
  font-size: 0.75rem;
  color: #64748b;
  word-break: break-all;
  margin-bottom: 12px;
}

.bj-slide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.bj-slide-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  background: var(--bj-nav-primary);
  min-height: 42px;
}

.bj-slide-cta:hover {
  color: #ffffff;
  filter: brightness(0.94);
}

.bj-slide-cta.is-telegram {
  background: #0088cc;
}

.bj-slide-cta.is-whatsapp {
  background: #16a34a;
}

.bj-slide-cta.is-facebook {
  background: #1877f2;
}

.bj-slide-qr-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  min-height: 42px;
}

.bj-slide-qr-open:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.bj-slider-arrow {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}

.bj-slider-arrow.is-prev {
  left: 10px;
}

.bj-slider-arrow.is-next {
  right: 10px;
}

.bj-slider-arrow:hover,
.bj-slider-arrow:focus-visible {
  background: var(--bj-nav-primary);
  color: #ffffff;
  border-color: var(--bj-nav-primary);
  outline: none;
}

.bj-join-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px 16px;
}

.bj-join-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.bj-join-dot.is-active {
  width: 26px;
  background: var(--bj-nav-primary);
}

@media (max-width: 380px) {
  .bj-qr-box {
    width: 180px;
  }

  .bj-bottom-item {
    font-size: 0.65rem;
  }
}

@media print {
  .bj-floating-rail,
  .bj-mobile-bottom-nav,
  .bj-join-backdrop {
    display: none !important;
  }
}
