/* Onboarding: welcome modal, floating help button, quick-access drawer, chat tooltip */

:root {
  /* z-index layering */
  --ob-z-fab: 900;      /* floating help button — above page content, below drawer/modal */
  --ob-z-drawer: 950;   /* quick-access drawer */
  --ob-z-overlay: 9999; /* welcome modal backdrop — above everything except the modal itself */
  --ob-z-modal: 10000;

  --ob-saffron: #F5A623;
  --ob-saffron-dim: rgba(245, 166, 35, 0.35);
  --ob-maroon: #4e1c0a;
}

/* ── Welcome modal ─────────────────────────────────────────────── */

.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--ob-z-overlay);
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 220ms ease-out;
}
.ob-overlay.open { display: flex; }
.ob-overlay.show { opacity: 1; }

.ob-modal {
  position: relative;
  width: 480px;
  max-width: 100%;
  background: var(--ih-bg, #1a1a2e);
  border: 1px solid var(--ob-saffron);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.12), 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--ob-saffron-dim);
  padding: 28px 26px 20px;
  color: var(--ih-text, #fff);
  transform: scale(0.82) translateY(24px);
  filter: blur(6px);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 280ms ease-out, opacity 260ms ease-out;
}
.ob-overlay.show .ob-modal {
  transform: scale(1) translateY(0);
  filter: blur(0);
  opacity: 1;
}
.ob-overlay.closing {
  opacity: 0;
  transition-duration: 180ms;
}
.ob-overlay.closing .ob-modal {
  transform: scale(0.88) translateY(10px);
  filter: blur(3px);
  opacity: 0;
  transition-duration: 180ms;
  transition-timing-function: ease-in;
}

.ob-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
  background: linear-gradient(90deg, var(--ob-saffron), #ffd27a, var(--ob-saffron));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ob-sheen 3.5s linear infinite;
}
.ob-sub {
  text-align: center;
  font-size: 13px;
  color: var(--ih-muted, rgba(255, 255, 255, 0.6));
  margin: 0 0 20px;
}

.ob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 480px) {
  .ob-grid { grid-template-columns: 1fr; }
}

.ob-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  background: var(--ih-surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--ih-border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  color: var(--ih-text, #fff);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out;
  width: auto;
  max-width: 100%;
}
.ob-btn:hover {
  border-color: var(--ob-saffron);
  background: rgba(245, 166, 35, 0.09);
  transform: translateY(-2px);
}
.ob-btn:active { transform: translateY(0) scale(0.97); }
.ob-btn-emoji { font-size: 24px; line-height: 1; }

.ob-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
}
.ob-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ih-muted, rgba(255, 255, 255, 0.6));
  cursor: pointer;
  user-select: none;
}
.ob-check-label input { accent-color: var(--ob-saffron); }
.ob-explore {
  color: var(--ob-saffron);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  padding: 0;
  text-decoration: underline;
}

@keyframes ob-sheen {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── Floating help button ──────────────────────────────────────── */

.ob-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--ob-z-fab);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ob-saffron);
  color: #1a0800;
  border: none;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 160ms ease-out, filter 160ms ease-out;
}
.ob-fab:hover { transform: scale(1.05); filter: brightness(1.1); }
@media (max-width: 480px) {
  .ob-fab { width: 46px; height: 46px; font-size: 19px; bottom: 18px; right: 18px; }
}

/* ── Quick-access drawer ────────────────────────────────────────── */

.ob-drawer {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: var(--ob-z-drawer);
  width: 240px;
  max-width: calc(100vw - 32px);
  background: var(--ih-bg, #1a1a2e);
  border: 1px solid var(--ih-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  padding: 10px;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transform-origin: bottom right;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 180ms ease-out, visibility 0s linear 200ms;
}
.ob-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 180ms ease-out, visibility 0s;
}
@media (max-width: 480px) {
  .ob-drawer { bottom: 76px; right: 16px; }
}

.ob-drawer-hd {
  font-size: 12px;
  font-weight: 700;
  color: var(--ob-saffron);
  padding: 4px 8px 8px;
}
.ob-drawer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 8px;
  border-radius: 8px;
  color: var(--ih-text, #fff);
  text-decoration: none;
  font-size: 13.5px;
  transition: background 120ms ease-out;
}
.ob-drawer-link:hover { background: var(--ih-surface, rgba(255, 255, 255, 0.06)); }

/* ── Chat section tooltip ───────────────────────────────────────── */

.ob-dot-wrap {
  position: relative;
  display: inline-block;
  margin-left: 8px;
  cursor: pointer;
}
.ob-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ob-saffron);
  animation: ob-pulse 1.8s ease-out infinite;
}
@keyframes ob-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(245, 166, 35, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0); }
}
.ob-tip {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px) scale(0.92);
  width: 240px;
  max-width: 70vw;
  background: var(--ih-bg, #1a1a2e);
  border: 1px solid var(--ob-saffron);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ih-text, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out, visibility 0s linear 200ms;
  z-index: 20;
}
.ob-tip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
  transition: opacity 200ms ease-out, transform 200ms ease-out, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .ob-overlay, .ob-modal, .ob-btn, .ob-fab, .ob-drawer, .ob-dot, .ob-tip, .ob-title {
    transition: none !important;
    animation: none !important;
  }
  .ob-overlay.show .ob-modal, .ob-overlay.closing .ob-modal { transform: none; filter: none; }
}
