/* UI components — Basket Trading */

/* ============ Badge ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding-inline: 13px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t-mono);
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge i {
  font-size: 14px;
}

.badge--wa {
  background: rgba(37, 211, 102, 0.14);
  color: #128a3e;
}

.badge--tg {
  background: rgba(34, 158, 217, 0.14);
  color: #1a7fb0;
}

.on-dark .badge--wa {
  color: #4ade80;
}

.on-dark .badge--tg {
  color: #5cc4ef;
}

.badge--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2.2s var(--ease) infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

/* ============ Buttons — color only, no movement ============ */
.btn {
  --btn-bg: var(--fill);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-full);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--t-sm);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.012em;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn i {
  font-size: 19px;
}

.btn:hover {
  background: var(--fill-2);
}

.btn:active {
  opacity: 0.85;
}

.btn--sm {
  min-height: 40px;
  padding-inline: 17px;
  font-size: var(--t-xs);
  gap: 7px;
}

.btn--sm i {
  font-size: 17px;
}

.btn--lg {
  min-height: 54px;
  padding-inline: 30px;
  font-size: 1.02rem;
}

.btn--block {
  width: 100%;
}

.btn--primary,
.btn--primary:hover {
  --btn-fg: #ffffff;
}
.btn--primary {
  background: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--wa,
.btn--wa:hover {
  --btn-fg: #ffffff;
}
.btn--wa {
  background: var(--wa);
}
.btn--wa:hover {
  background: var(--wa-hover);
}

.btn--tg,
.btn--tg:hover {
  --btn-fg: #ffffff;
}
.btn--tg {
  background: var(--tg);
}
.btn--tg:hover {
  background: var(--tg-hover);
}

.btn--yt,
.btn--yt:hover {
  --btn-fg: #ffffff;
}
.btn--yt {
  background: var(--yt);
}
.btn--yt:hover {
  background: var(--yt-hover);
}

/* Buttons inside popups */
.pop .btn {
  --btn-bg: var(--pop-fill);
  --btn-fg: var(--pop-ink);
}

.pop .btn:hover {
  background: var(--pop-fill-2);
}

/* ============ Glow ring — the one deliberate contour ============ */
@property --ang {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.glow {
  --ring: 0, 0, 255;
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-full);
  background:
    conic-gradient(
      from var(--ang),
      rgba(var(--ring), 0) 0deg,
      rgba(var(--ring), 0) 170deg,
      rgba(var(--ring), 0.9) 255deg,
      rgba(var(--ring), 0.25) 300deg,
      rgba(var(--ring), 0) 340deg
    ),
    linear-gradient(rgba(var(--ring), 0.18), rgba(var(--ring), 0.18));
  animation: ring-spin 4.5s linear infinite;
}

.on-dark .glow,
.pop .glow {
  --ring: 90, 120, 255;
}

.glow--wa,
.on-dark .glow--wa,
.pop .glow--wa {
  --ring: 37, 211, 102;
}

.glow--block {
  display: flex;
  width: 100%;
}

.glow--block > .btn {
  width: 100%;
}

@keyframes ring-spin {
  to {
    --ang: 360deg;
  }
}

/* ============ Cards — filled, no frames ============ */
.card {
  position: relative;
  padding: var(--s-5);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--dur) var(--ease);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 22px;
  margin-bottom: var(--s-4);
}

.card__title {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card__text {
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.6;
}

/* ============ Section heading ============ */
.section-head {
  max-width: 680px;
  margin-bottom: var(--s-6);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .lead {
  margin-inline: auto;
}

/* Section eyebrows: bare blue label, no pill, no icon */
.section-head .badge {
  margin-bottom: var(--s-4);
  height: auto;
  padding: 0;
  background: none;
  color: var(--accent-ink);
}

.section-head .badge i {
  display: none;
}

/* …except the status pills, which keep their colour and icon */
.section-head .badge--wa,
.section-head .badge--tg {
  height: 30px;
  padding-inline: 13px;
}

.section-head .badge--wa {
  background: rgba(37, 211, 102, 0.15);
  color: #128a3e;
}

.section-head .badge--tg {
  background: rgba(34, 158, 217, 0.15);
  color: #1a7fb0;
}

.section-head .badge--wa i,
.section-head .badge--tg i {
  display: inline-flex;
}

.section-head .lead {
  margin-top: var(--s-4);
}

/* ============ Chips ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--ink);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1;
  transition: background-color var(--dur) var(--ease);
}

.chip:hover {
  background: var(--fill-2);
}

.chip i {
  color: var(--accent-ink);
  font-size: 16px;
}

/* ============ Accordion ============ */
.acc {
  border-radius: var(--r-lg);
  background: var(--card);
  overflow: hidden;
}

.acc + .acc {
  margin-top: 10px;
}

.acc__btn {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  padding: 19px var(--s-5);
  text-align: left;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.02em;
  transition: color var(--dur) var(--ease);
}

.acc__btn span {
  flex: 1;
}

.acc__btn:hover {
  color: var(--accent-ink);
}

.acc__btn > i {
  font-size: 20px;
  color: var(--faint);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}

.acc.is-open .acc__btn > i {
  transform: rotate(180deg);
  color: var(--accent-ink);
}

.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-slow) var(--ease);
}

.acc.is-open .acc__panel {
  grid-template-rows: 1fr;
}

.acc__inner {
  overflow: hidden;
}

.acc__inner p {
  padding: 0 var(--s-5) 21px;
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.7;
  max-width: 70ch;
}

/* ============ Overlay + popups ============ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-slow) var(--ease), visibility var(--dur-slow);
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.pop {
  position: fixed;
  z-index: 100;
  background: var(--pop-bg);
  backdrop-filter: blur(40px) saturate(180%) brightness(1.12);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.12);
  color: var(--pop-ink);
  box-shadow: inset 0 0 0 1px rgba(233, 233, 233, 0.3), var(--shadow-pop);
  visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.pop.is-open {
  visibility: visible;
}

.pop.is-dragging {
  transition: none !important;
  cursor: grabbing;
}

.pop h3 {
  color: var(--pop-ink);
}

.pop p {
  color: var(--pop-muted);
}

/* Drawer — right panel, mobile only */
.pop.drawer {
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 350px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s-5) var(--s-5) calc(var(--s-6) + env(safe-area-inset-bottom));
  border-radius: var(--r-2xl) 0 0 var(--r-2xl);
  /* Frosted crystal: thin tint, heavy blur, lit edges */
  background: rgba(14, 14, 14, 0.42);
  backdrop-filter: blur(46px) saturate(190%) brightness(1.08);
  -webkit-backdrop-filter: blur(46px) saturate(190%) brightness(1.08);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    var(--shadow-pop);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease), visibility var(--dur-slow);
}

.drawer.is-open {
  transform: none;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-5);
}

.drawer__link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--pop-ink);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.drawer__link > i:first-child {
  font-size: 19px;
  color: var(--pop-muted);
  transition: color var(--dur) var(--ease);
}

.drawer__link .go {
  margin-left: auto;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.28);
}

.drawer__link:hover,
.drawer__link:focus-visible {
  background: var(--pop-fill);
  color: #fff;
}

.drawer__link:hover > i:first-child {
  color: #93a4ff;
}

.drawer__foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: var(--s-5);
}

/* Sheet — draggable bottom sheet (mobile) / centered glass modal (desktop) */
.sheet {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88svh;
  padding: 12px var(--s-5) calc(var(--s-6) + env(safe-area-inset-bottom));
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease), visibility var(--dur-slow);
  cursor: grab;
}

.sheet.is-open {
  transform: none;
}

.sheet__grip {
  display: block;
  width: 46px;
  height: 5px;
  margin: 0 auto var(--s-5);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.24);
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.sheet__head p {
  font-size: var(--t-sm);
  line-height: 1.6;
  margin-top: 7px;
  max-width: 42ch;
}

.sheet__list {
  display: grid;
  gap: 10px;
}

.sheet__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--pop-fill);
  transition: background-color var(--dur) var(--ease);
}

.sheet__item:hover {
  background: var(--pop-fill-2);
}

.sheet__item .mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.09);
  color: #9aabff;
  font-weight: 500;
  font-size: 1rem;
  overflow: hidden;
}

.sheet__item .mark img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.sheet__item strong {
  display: block;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--pop-ink);
}

.sheet__item span span {
  color: var(--pop-muted);
  font-size: var(--t-xs);
  line-height: 1.4;
}

.sheet__item .go {
  margin-left: auto;
  color: #93a4ff;
  font-size: 18px;
}

.pop .note {
  margin-top: var(--s-5);
  color: rgba(247, 247, 247, 0.45);
  font-size: var(--t-xs);
  line-height: 1.65;
}

/* Icon buttons */
.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--ink);
  font-size: 19px;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-btn:hover {
  background: var(--accent);
  color: #fff;
}

.icon-btn--plain {
  background: none;
  color: var(--pop-muted);
  font-size: 24px;
}

.icon-btn--plain:hover {
  background: none;
  color: #fff;
}

@media (min-width: 768px) {
  /* Desktop popups: wider and lighter, glass only — no solid frame */
  .pop {
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(52px) saturate(190%) brightness(1.18);
    -webkit-backdrop-filter: blur(52px) saturate(190%) brightness(1.18);
    box-shadow: inset 0 0 0 1.5px rgba(238, 238, 238, 0.45), var(--shadow-pop);
  }

  .sheet {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(94vw, 720px);
    max-height: 86svh;
    padding: var(--s-7) var(--s-8);
    border-radius: var(--r-2xl);
    transform: translate(-50%, -46%);
    opacity: 0;
    cursor: default;
    transition: transform var(--dur-slow) var(--ease), opacity var(--dur) var(--ease),
      visibility var(--dur-slow);
  }
  .sheet.is-open {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  .sheet__grip {
    display: none;
  }
}
