/* RAJ PREMIUM PANEL — v10 (loaded LAST on admin, user/reseller and public store pages).
   1. Admin sidebar: every row is exactly the same height, the same gap apart, nothing can shrink or wobble.
   2. Every popup card inside the website gets the same theme-matched border pulse as the other cards.
   3. Buy Keys "CONFIRM PURCHASE" card: proper spacing between the heading and the product name.
   4. Remaining small icons get their own real colours.
   Only spacing / colours / border glow are touched. No PHP logic, forms, payments or scripts are affected.
   Rule prefix `html body:not(#rajx)` is the same ID-level specificity used by v6-v9; this file loads after them.
   To roll back: remove the <link> to this file from includes/admin_shell_bottom.php and includes/app_bottom.php. */


/* =====================================================================
   1. ADMIN SIDEBAR (.dr) — equal rows, equal gaps, accurate positions
   Root cause of the uneven look: .dr is a column flexbox with scrolling, so with ~25 rows the browser
   SHRANK every row (44px -> ~33px) and collapsed the divider to 0px. Rows are now flex:none.
   ===================================================================== */
html body:not(#rajx) .dr > * { flex: 0 0 auto !important; }

html body:not(#rajx) .dr {
  --dr-row-h: 46px;      /* height of every menu row */
  --dr-row-gap: 4px;     /* vertical gap between rows (2 x 2px) */
  --dr-side: 12px;       /* left / right margin of every row */
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 22px) !important;
  overscroll-behavior: contain;
}

/* header keeps its own height */
html body:not(#rajx) .dr .dh { flex: 0 0 auto !important; min-height: 64px; box-sizing: border-box; }

/* menu rows */
html body:not(#rajx) .dr a.it {
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  height: var(--dr-row-h) !important; min-height: var(--dr-row-h) !important; max-height: var(--dr-row-h) !important;
  margin: calc(var(--dr-row-gap) / 2) var(--dr-side) !important;
  padding: 0 12px 0 8px !important;
  gap: 12px !important;
  align-items: center !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  transform: none;
}
/* the hover nudge must not move the row out of line */
html body:not(#rajx) .dr a.it:hover:not(.act) { transform: none !important; }

/* icon tile: identical square, perfectly centred inside the row */
html body:not(#rajx) .dr a.it svg {
  box-sizing: border-box !important;
  width: 32px !important; height: 32px !important; min-width: 32px !important; flex: 0 0 32px !important;
  padding: 6px !important; margin: 0 !important; display: block !important;
}

/* first row sits clearly below the header line */
html body:not(#rajx) .dr .dh + a.it { margin-top: 12px !important; }

/* section labels + divider: same spacing every time */
html body:not(#rajx) .dr .sec {
  box-sizing: border-box !important;
  margin: 16px calc(var(--dr-side) + 12px) 6px !important;
  min-height: 16px; line-height: 16px !important;
}
html body:not(#rajx) .dr .sep {
  flex: 0 0 1px !important; height: 1px !important; min-height: 1px !important;
  margin: 14px calc(var(--dr-side) + 12px) 0 !important;
}
html body:not(#rajx) .dr .sp { flex: 0 0 12px !important; height: 12px !important; }

/* active marker: sits inside the highlighted row (it used to float 12px away at the screen edge) */
html body:not(#rajx) .dr a.it.act::before {
  left: 4px !important; top: 24% !important; bottom: 24% !important; width: 3px !important;
  border-radius: 3px !important;
}

/* ticket counter badge: stays on the right edge, vertically centred */
html body:not(#rajx) .dr a.it .cnt {
  margin-left: auto !important; flex: 0 0 auto !important; align-self: center !important;
  min-width: 22px; height: 22px !important; line-height: 22px; box-sizing: border-box;
}

/* very small phones: same rhythm, just a little tighter at the sides */
@media (max-width: 360px) {
  html body:not(#rajx) .dr { --dr-side: 9px; }
}


/* =====================================================================
   2. POPUP CARDS — same theme-matched border pulse as every other card
   Confirm purchase (.pn-mb), purchase success (.sx-box), reseller upgrade (.rup-box),
   colour picker (.th-box), admin dialogs (.mo > .mb) and the guest login/registration prompt.
   Uses the shared keyframes (rajBuyKeysSharedPulseV4) and the shared pulse clock, so the popup beats in sync
   with the cards behind it and follows the colour picker (--raj-accent-rgb / --raj-accent-alt-rgb).
   ===================================================================== */
html body:not(#rajx) .pn-mb.pn-mb.pn-mb,
html body:not(#rajx) .sx-box.sx-box.sx-box,
html body:not(#rajx) .rup-box.rup-box.rup-box,
html body:not(#rajx) .th-box.th-box.th-box,
html body:not(#rajx) .mo > .mb.mb.mb,
html body:not(#rajx) .guest-auth-box.guest-auth-box.guest-auth-box {
  --raj-v4-edge-alpha: .48;
  --raj-v4-near-radius: 2px;
  --raj-v4-near-alpha: .22;
  --raj-v4-far-radius: 4px;
  --raj-v4-far-alpha: .08;
  --raj-v4-edge-rgb: var(--raj-accent-rgb, 75,145,219);
  --raj-v4-alt-rgb: var(--raj-accent-alt-rgb, 39,194,208);
  border-width: 1.5px !important;
  border-style: solid !important;
  border-color: rgba(var(--raj-v4-edge-rgb), var(--raj-v4-edge-alpha)) !important;
  box-shadow:
    0 0 var(--raj-v4-near-radius) 0 rgba(var(--raj-v4-edge-rgb), var(--raj-v4-near-alpha)),
    0 0 var(--raj-v4-far-radius) 1px rgba(var(--raj-v4-alt-rgb), var(--raj-v4-far-alpha)),
    0 18px 46px rgba(0, 0, 0, .42) !important;
  animation: rajBuyKeysSharedPulseV4 var(--raj-buykeys-pulse-period-v4, 3.2s) ease-in-out infinite !important;
  animation-delay: var(--raj-card-pulse-delay, 0s) !important;
  animation-fill-mode: both !important;
}

/* keep the soft "pop up" entrance of the two cards that had one, and run the pulse next to it */
html body:not(#rajx) .pn-mb.pn-mb.pn-mb {
  animation: pnup .22s ease both, rajBuyKeysSharedPulseV4 var(--raj-buykeys-pulse-period-v4, 3.2s) ease-in-out infinite !important;
  animation-delay: 0s, var(--raj-card-pulse-delay, 0s) !important;
  animation-fill-mode: both, both !important;
}
html body:not(#rajx) .mo > .mb.mb.mb {
  animation: up .25s both, rajBuyKeysSharedPulseV4 var(--raj-buykeys-pulse-period-v4, 3.2s) ease-in-out infinite !important;
  animation-delay: 0s, var(--raj-card-pulse-delay, 0s) !important;
  animation-fill-mode: both, both !important;
}

@media (prefers-reduced-motion: reduce) {
  html body:not(#rajx) .pn-mb.pn-mb.pn-mb,
  html body:not(#rajx) .sx-box.sx-box.sx-box,
  html body:not(#rajx) .rup-box.rup-box.rup-box,
  html body:not(#rajx) .th-box.th-box.th-box,
  html body:not(#rajx) .mo > .mb.mb.mb,
  html body:not(#rajx) .guest-auth-box.guest-auth-box.guest-auth-box { animation: none !important; --raj-v4-edge-alpha: .8; --raj-v4-near-alpha: .5; --raj-v4-near-radius: 4px; }
}


/* =====================================================================
   3. CONFIRM PURCHASE CARD — spacing
   The product-name line (#mTitle, class .pn-mt) had NO style at all (the old CSS only styled a class that
   does not exist in the page), so it touched the heading above it and the first row below it.
   ===================================================================== */
html body:not(#rajx) .pn-mb .pn-mh {
  margin: 2px 0 0 !important;
  padding: 0 0 14px !important;
  font-size: 12px !important; line-height: 1.3 !important;
  border-bottom: 1px solid rgba(var(--raj-accent-rgb, 75,145,219), .22);
}
html body:not(#rajx) .pn-mb .pn-mt {
  margin: 0 0 8px !important;
  padding: 16px 6px 14px !important;
  text-align: center;
  color: #fff;
  font-size: 16px; font-weight: 800; line-height: 1.35; letter-spacing: .3px;
  word-break: break-word; overflow-wrap: anywhere;
}
html body:not(#rajx) .pn-mb .pn-mt:empty { display: none; }
html body:not(#rajx) .pn-mb .pn-mr:first-of-type { padding-top: 9px; }
html body:not(#rajx) .pn-mb .pn-mr { align-items: center; padding: 10px 0 !important; }
html body:not(#rajx) .pn-mb .pn-ma { margin-top: 18px; }


/* =====================================================================
   4. REMAINING ICONS — real colours by meaning (buttons that already set their own colour are left alone)
   ===================================================================== */
html body:not(#rajx) .ksel > i.fa-chevron-down,
html body:not(#rajx) .so-ar.fa-chevron-down,
html body:not(#rajx) .pn-more.pn-more.pn-more i.fa-chevron-down { color: #7dd3fc !important; }

html body:not(#rajx) .pn-search > i.fa-magnifying-glass,
html body:not(#rajx) .ra-sw > i.fa-magnifying-glass,
html body:not(#rajx) .ksearch > i.fa-magnifying-glass { color: #22d3ee !important; }

html body:not(#rajx) .pf-pw.pf-pw.pf-pw button i.fa-eye,
html body:not(#rajx) .pf-pw.pf-pw.pf-pw button i.fa-eye-slash,
html body:not(#rajx) .ra-ib.ra-ib.ra-ib i.fa-eye,
html body:not(#rajx) .ra-ib.ra-ib.ra-ib i.fa-eye-slash { color: #a78bfa !important; }

html body:not(#rajx) .ra-ib.ra-ib.ra-ib i.fa-copy,
html body:not(#rajx) .bn-cp.bn-cp.bn-cp i.fa-copy,
html body:not(#rajx) .rs-link-h i.fa-copy { color: #38bdf8 !important; }
html body:not(#rajx) .bn-cp.bn-cp.bn-cp i.fa-check { color: #34d399 !important; }

html body:not(#rajx) .kactive.kactive.kactive button i.fa-xmark { color: #fb7185 !important; }
html body:not(#rajx) .ra-st i.fa-check { color: #34d399 !important; }
html body:not(#rajx) .ra-st i.fa-circle-notch { color: #22d3ee !important; }
html body:not(#rajx) .big.bad i.fa-circle-xmark { color: #f87171 !important; }
html body:not(#rajx) .raj-thumb-title i.fa-image { color: #a78bfa !important; }
html body:not(#rajx) .bn-dl i.fa-download { color: #fbbf24 !important; }
html body:not(#rajx) .sx-go i.fa-download { color: #fff !important; }
