/* ═══ Help Corner — Permanent Asset (do not overwrite) ═══ */

/* ── Wrapper: fixed bottom-left ────────────────────────── */
.hb-wrap {
  position: fixed;
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  left: 1.5rem;
  z-index: 9500;
  animation: hb-enter 0.72s cubic-bezier(0.34, 1.56, 0.64, 1) 2s both;
}

@keyframes hb-enter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.78);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Button: starts as circle, expands to pill ─────────── */
.hb-btn {
  position: relative;
  height: 50px;
  width: 50px;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 9, 14, 0.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    width 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: width, transform;
}

.hb-btn:hover {
  transform: scale(1.06);
}

.hb-btn:active {
  transform: scale(0.92);
  transition-duration: 0.1s;
}

/* ── Expanded state ──────────────────────────────────────── */
.hb-btn.hb-expanded {
  width: 238px;
  border-color: rgba(251, 191, 36, 0.30);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.10),
    0 0 28px rgba(251, 191, 36, 0.20),
    0 6px 24px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hb-btn:hover,
.hb-btn.hb-expanded:hover {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.16),
    0 0 32px rgba(251, 191, 36, 0.28),
    0 8px 28px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ── Idle breathing glow (for repeat visitors) ──────────── */
@keyframes hb-idle-glow {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(251, 191, 36, 0.00),
      0 2px 12px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  40% {
    box-shadow:
      0 0 0 5px rgba(251, 191, 36, 0.10),
      0 2px 12px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  70% {
    box-shadow:
      0 0 0 8px rgba(251, 191, 36, 0.00),
      0 2px 12px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}

.hb-btn.hb-idle-pulse {
  animation: hb-idle-glow 6s ease-in-out 3s infinite;
}

/* Shimmer sweep when expanding */
@keyframes hb-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.hb-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(251, 191, 36, 0.12) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  pointer-events: none;
  opacity: 0;
}

.hb-btn.hb-shimmer::after {
  opacity: 1;
  animation: hb-shimmer 0.7s ease-in-out forwards;
}

/* ── Icon container (always visible) ──────────────────────── */
.hb-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hb-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hb-btn.hb-expanded .hb-icon svg {
  transform: scale(0.88);
}

/* ── Label text ──────────────────────────────────────────── */
.hb-label {
  padding-right: 18px;
  padding-left: 4px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fbbf24;
  letter-spacing: 0.015em;
  line-height: 1.3;
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity 0.28s ease 0.22s,
    transform 0.28s ease 0.22s;
  pointer-events: none;
  user-select: none;
}

.hb-btn.hb-expanded .hb-label {
  opacity: 1;
  transform: translateX(0);
}

/* ── Tap hint dot (pulses on first expansion) ────────────── */
@keyframes hb-dot-ping {
  0%, 100% { opacity: 0; transform: scale(0); }
  20%       { opacity: 1; transform: scale(1); }
  80%       { opacity: 0.6; transform: scale(2.2); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .hb-wrap {
    left: 1rem;
    bottom: calc(1.4rem + env(safe-area-inset-bottom, 0px));
  }

  .hb-btn {
    height: 46px;
    width: 46px;
    border-radius: 23px;
  }

  .hb-btn.hb-expanded {
    width: 214px;
  }

  .hb-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }

  .hb-label {
    font-size: 0.72rem;
  }
}
