/* ==========================================================================
   channel-panel.css — "Join our WhatsApp Channel" slide-in side panel
   Used on: Home, Notes, PYQ, Books, Scholarships, Career, Premium Notes
   Behaviour lives in js/channel-panel.js. All classes are prefixed .bpn-ch
   so nothing here can clash with the rest of the site.

   z-index 996 = above page content, BELOW navbar (1000), announcement bar
   (1001), mobile bottom nav (9996), drawers (9998-9999) and every modal.
   ========================================================================== */

.bpn-ch {
  --bpn-w: 236px;                 /* panel width (tab not included) */
  --bpn-green: #25d366;
  --bpn-green-2: #128c7e;
  --bpn-deep: #063b33;
  --bpn-ease: cubic-bezier(.22, 1, .36, 1);

  position: fixed;
  top: 50%;
  right: 0;
  z-index: 996;
  display: flex;
  align-items: center;
  /* closed: panel slid fully off the right edge, only the tab remains */
  transform: translate(var(--bpn-w), -50%);
  transition: transform 1s var(--bpn-ease);
  font-family: var(--font-body, 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif);
  -webkit-font-smoothing: antialiased;
  /* until the stylesheet + JS are ready the widget stays invisible */
  visibility: hidden;
}
.bpn-ch.is-ready { visibility: visible; }
.bpn-ch.is-open { transform: translate(0, -50%); }

.bpn-ch *, .bpn-ch *::before, .bpn-ch *::after { box-sizing: border-box; }

/* ── TAB (always visible on the right edge) ───────────────────────────── */
.bpn-ch__tab {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 92px;
  padding: 0;
  border: 0;
  border-radius: 14px 0 0 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(160deg, var(--bpn-green) 0%, var(--bpn-green-2) 100%);
  box-shadow: -6px 8px 22px -6px rgba(7, 94, 84, .5), inset 1px 0 0 rgba(255, 255, 255, .25);
  -webkit-tap-highlight-color: transparent;
  transition: filter .2s, width .2s;
}
.bpn-ch__tab:hover { filter: brightness(1.07); width: 40px; margin-left: -4px; }
.bpn-ch__tab:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.bpn-ch__tab-wa { width: 20px; height: 20px; fill: currentColor; }
.bpn-ch__tab-chev {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 1s var(--bpn-ease);
}
.bpn-ch.is-open .bpn-ch__tab-chev { transform: rotate(180deg); }

/* attention dot — only while the panel is closed */
.bpn-ch__dot {
  position: absolute;
  top: 9px; left: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .7);
  animation: bpnChPing 2.2s ease-out infinite;
}
.bpn-ch.is-open .bpn-ch__dot { display: none; }
@keyframes bpnChPing {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .75); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ── PANEL ────────────────────────────────────────────────────────────── */
.bpn-ch__panel {
  position: relative;
  width: var(--bpn-w);
  flex: 0 0 var(--bpn-w);
  padding: 16px 16px 14px;
  border-radius: 22px 0 0 22px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(37, 211, 102, .30) 0%, rgba(37, 211, 102, 0) 60%),
    linear-gradient(165deg, #0b4a40 0%, var(--bpn-deep) 60%, #042b25 100%);
  box-shadow: -14px 12px 40px -10px rgba(4, 43, 37, .55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  text-align: center;
}
.bpn-ch__panel::before {            /* subtle dotted texture */
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.2px);
  background-size: 14px 14px;
  opacity: .55;
  pointer-events: none;
}
.bpn-ch__panel > * { position: relative; }

/* header */
.bpn-ch__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}
.bpn-ch__badge {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--bpn-green), var(--bpn-green-2));
  box-shadow: 0 4px 12px -3px rgba(37, 211, 102, .6);
}
.bpn-ch__badge svg { width: 18px; height: 18px; fill: #fff; }
.bpn-ch__titles { min-width: 0; flex: 1; line-height: 1.15; }
.bpn-ch__eyebrow {
  display: flex; align-items: center; gap: 5px;
  font-size: .58rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: #7ff0ad;
  white-space: nowrap;
}
.bpn-ch__live {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80;
  animation: bpnChBlink 1.6s ease-in-out infinite;
}
@keyframes bpnChBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.bpn-ch__title {
  margin: 3px 0 0;
  font-family: var(--font-display, 'Sora', 'Segoe UI', system-ui, sans-serif);
  font-size: .95rem; font-weight: 700; letter-spacing: -.01em;
  color: #fff;
}
.bpn-ch__close {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .12);
  transition: background .15s, color .15s;
}
.bpn-ch__close:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.bpn-ch__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bpn-ch__close svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* QR */
.bpn-ch__qr {
  position: relative;
  width: 148px; height: 148px;
  padding: 9px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .5), 0 0 0 4px rgba(37, 211, 102, .22);
  overflow: hidden;
}
.bpn-ch__qr img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.bpn-ch__qr::after {                /* moving scan line */
  content: "";
  position: absolute; left: 6px; right: 6px; top: 8px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--bpn-green), transparent);
  box-shadow: 0 0 10px 1px rgba(37, 211, 102, .8);
  animation: bpnChScan 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bpnChScan {
  0%, 100% { transform: translateY(0); opacity: 0; }
  10%, 90% { opacity: 1; }
  50%      { transform: translateY(124px); opacity: 1; }
}
.bpn-ch__scan {
  margin: -3px 0 0;
  font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}

/* JOIN button */
.bpn-ch__join {
  position: relative;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden;
  text-decoration: none;
  font-family: inherit;
  font-size: .86rem; font-weight: 800; letter-spacing: .01em;
  color: #04210f;
  background: linear-gradient(135deg, #4ff08c 0%, var(--bpn-green) 55%, #1fbe5a 100%);
  box-shadow: 0 8px 20px -6px rgba(37, 211, 102, .75), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.bpn-ch__join:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -6px rgba(37, 211, 102, .9), inset 0 1px 0 rgba(255, 255, 255, .5); }
.bpn-ch__join:active { transform: translateY(0); }
.bpn-ch__join:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.bpn-ch__join svg { width: 17px; height: 17px; flex: 0 0 auto; }
.bpn-ch__join .wa { fill: #04210f; }
.bpn-ch__join .arrow { fill: none; stroke: #04210f; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.bpn-ch__join:hover .arrow { transform: translateX(3px); }
.bpn-ch__join::after {              /* shine sweep */
  content: "";
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: bpnChShine 3.6s ease-in-out 1.4s infinite;
  pointer-events: none;
}
@keyframes bpnChShine { 0% { left: -60%; } 38%, 100% { left: 130%; } }

/* "what we share" — small print */
.bpn-ch__share { width: 100%; }
.bpn-ch__share-label {
  margin: 0 0 6px;
  font-size: .6rem; font-weight: 600; letter-spacing: .05em;
  color: rgba(255, 255, 255, .62);
}
.bpn-ch__chips {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;
}
.bpn-ch__chips li {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .62rem; font-weight: 700; letter-spacing: .01em;
  color: #d9fbe6;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  white-space: nowrap;
}

/* ── MOBILE / TABLET ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .bpn-ch {
    --bpn-w: 204px;
    /* sit a little above centre so the 64px bottom nav never touches it */
    top: calc(50% - 30px);
  }
  .bpn-ch__tab { width: 32px; height: 82px; border-radius: 12px 0 0 12px; }
  .bpn-ch__tab:hover { width: 32px; margin-left: 0; }
  .bpn-ch__dot { left: 6px; }
  .bpn-ch__panel { padding: 13px 13px 12px; gap: 9px; border-radius: 18px 0 0 18px; }
  .bpn-ch__badge { width: 28px; height: 28px; flex-basis: 28px; border-radius: 9px; }
  .bpn-ch__badge svg { width: 16px; height: 16px; }
  .bpn-ch__title { font-size: .84rem; }
  .bpn-ch__eyebrow { font-size: .52rem; letter-spacing: .05em; }
  .bpn-ch__head { gap: 8px; }
  .bpn-ch__close { width: 24px; height: 24px; }
  .bpn-ch__qr { width: 124px; height: 124px; padding: 7px; border-radius: 14px; }
  @keyframes bpnChScan { 0%, 100% { transform: translateY(0); opacity: 0; } 10%, 90% { opacity: 1; } 50% { transform: translateY(102px); opacity: 1; } }
  .bpn-ch__join { min-height: 42px; font-size: .82rem; }
}

/* very small phones */
@media (max-width: 360px) {
  .bpn-ch { --bpn-w: 188px; }
  .bpn-ch__qr { width: 112px; height: 112px; }
  .bpn-ch__chips li { font-size: .58rem; padding: 3px 7px; }
}

/* short screens (landscape phones): drop the QR so the panel never overflows */
@media (max-height: 560px) {
  .bpn-ch__qr, .bpn-ch__scan { display: none; }
}
@media (max-height: 400px) {
  .bpn-ch__share { display: none; }
}

/* ── ACCESSIBILITY / PRINT ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bpn-ch, .bpn-ch__tab-chev { transition-duration: .01ms; }
  .bpn-ch__dot, .bpn-ch__live, .bpn-ch__qr::after, .bpn-ch__join::after { animation: none; }
  .bpn-ch__qr::after { display: none; }
}
@media print { .bpn-ch { display: none !important; } }
