/* ============================================================
   CashPay Clinics — In-App Onboarding Tooltip System
   ============================================================ */

/* ── Overlay / Spotlight ───────────────────────────────────── */
.cp-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;          /* let spotlight punch-through clicks */
  transition: opacity 0.3s ease;
}

.cp-tour-overlay.active {
  pointer-events: auto;
}

/* SVG fills the whole screen; the "hole" is drawn by JS */
.cp-tour-overlay svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Tooltip Card ──────────────────────────────────────────── */
.cp-tour-tooltip {
  position: fixed;
  z-index: 9100;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.10);
  padding: 20px 20px 16px;
  font-family: 'Poppins', sans-serif;
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.cp-tour-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Arrow indicator pointing toward highlighted element */
.cp-tour-tooltip::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.06);
}

.cp-tour-tooltip[data-arrow="top"]::before    { top: -6px;    left: 24px; }
.cp-tour-tooltip[data-arrow="bottom"]::before { bottom: -6px; left: 24px; }
.cp-tour-tooltip[data-arrow="left"]::before   { left: -6px;   top: 24px;  }
.cp-tour-tooltip[data-arrow="right"]::before  { right: -6px;  top: 24px;  }
.cp-tour-tooltip[data-arrow="none"]::before   { display: none; }

/* Header */
.cp-tour-tooltip__header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.cp-tour-tooltip__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #00A651, #198B53);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
}

.cp-tour-tooltip__title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.35;
  padding-top: 2px;
}

/* Step counter badge */
.cp-tour-tooltip__step {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  color: #888;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Body */
.cp-tour-tooltip__body {
  font-size: 13px;
  color: #555;
  line-height: 1.55;
  margin-bottom: 16px;
}

/* Footer / controls */
.cp-tour-tooltip__footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-tour-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 7px 14px;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.cp-tour-btn--next {
  background: #00A651;
  color: #fff;
  margin-left: auto;
}

.cp-tour-btn--next:hover {
  background: #198B53;
}

.cp-tour-btn--skip {
  background: transparent;
  color: #999;
}

.cp-tour-btn--skip:hover {
  color: #555;
}

/* Progress dots */
.cp-tour-dots {
  display: flex;
  gap: 5px;
  margin-left: auto;
  margin-right: 4px;
}

.cp-tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ddd;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cp-tour-dot.active {
  background: #00A651;
  transform: scale(1.3);
}

/* ── Welcome / Intro card (centred, no spotlight) ─────────── */
.cp-tour-welcome {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cp-tour-welcome__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9150;
  animation: cpFadeIn 0.3s ease forwards;
}

.cp-tour-welcome__card {
  position: relative;
  z-index: 9200;
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  animation: cpSlideUp 0.35s ease forwards;
}

.cp-tour-welcome__logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #00A651, #198B53);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  color: #fff;
}

.cp-tour-welcome__title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.cp-tour-welcome__text {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 24px;
}

.cp-tour-welcome__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.cp-tour-welcome__btn-start {
  background: #00A651;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cp-tour-welcome__btn-start:hover {
  background: #198B53;
}

.cp-tour-welcome__btn-skip {
  background: transparent;
  color: #999;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.cp-tour-welcome__btn-skip:hover {
  border-color: #bbb;
  color: #555;
}

/* ── Floating Help Button ─────────────────────────────────── */
.cp-tour-help-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 8900;
  width: 44px;
  height: 44px;
  background: #00A651;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 166, 81, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cp-tour-help-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 166, 81, 0.55);
}

.cp-tour-help-btn__label {
  position: absolute;
  right: 54px;
  white-space: nowrap;
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  font-family: 'Poppins', sans-serif;
  padding: 5px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cp-tour-help-btn:hover .cp-tour-help-btn__label {
  opacity: 1;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes cpFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes cpSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Highlighted element pulse ring ──────────────────────── */
.cp-tour-highlight-ring {
  position: fixed;
  z-index: 8999;
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 0 0 3px #00A651, 0 0 0 6px rgba(0, 166, 81, 0.25);
  animation: cpPulseRing 1.4s ease-in-out infinite;
  transition: all 0.3s ease;
}

@keyframes cpPulseRing {
  0%,100% { box-shadow: 0 0 0 3px #00A651, 0 0 0 6px rgba(0,166,81,0.25); }
  50%      { box-shadow: 0 0 0 3px #00A651, 0 0 0 10px rgba(0,166,81,0.10); }
}

/* ── Homepage Hints ───────────────────────────────────────── */
.cp-hint-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9500;
  max-width: 600px;
  width: calc(100% - 32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cp-hint-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.cp-hint-banner__content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, #00A651, #198B53);
  color: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 166, 81, 0.35);
  font-family: 'Poppins', sans-serif;
}

.cp-hint-banner__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.cp-hint-banner__text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

.cp-hint-banner__text strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.cp-hint-banner__text span {
  opacity: 0.95;
}

.cp-hint-banner__close {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.cp-hint-banner__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Pulse hint effect */
.cp-hint-pulse {
  position: relative;
  animation: cpHintPulse 2s ease-in-out infinite;
}

@keyframes cpHintPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 166, 81, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(0, 166, 81, 0); }
}

/* Small tooltip for hints */
.cp-hint-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.cp-hint-tooltip.visible {
  opacity: 1;
}

.cp-hint-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1a1a;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 991px) {
  /* Mobile styles for tablets and phones */
  .cp-tour-tooltip {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    left: 16px !important;
    right: 16px;
  }

  .cp-tour-tooltip__header {
    flex-wrap: wrap;
  }

  .cp-tour-tooltip__step {
    margin-left: 0;
    margin-top: 4px;
    width: 100%;
    text-align: left;
  }

  .cp-tour-tooltip__footer {
    flex-wrap: wrap;
    gap: 12px;
  }

  .cp-tour-dots {
    order: -1;
    width: 100%;
    justify-content: center;
    margin: 0;
  }

  .cp-tour-btn--skip {
    order: 1;
  }

  .cp-tour-btn--next {
    order: 2;
    margin-left: auto;
  }
}

@media (max-width: 576px) {
  .cp-tour-tooltip {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
  }

  .cp-tour-welcome__card {
    padding: 28px 20px 22px;
    margin: 16px;
    width: calc(100vw - 32px);
  }

  .cp-tour-welcome__actions {
    flex-direction: column;
  }

  .cp-tour-welcome__btn-start,
  .cp-tour-welcome__btn-skip {
    width: 100%;
  }

  .cp-tour-help-btn {
    bottom: 70px;
    right: 14px;
  }
}
