/**
 * ReWSE / EWSE – Shepherd.js Tour Theme v3
 * Purple #5B2D8E | Magenta #E8007D | Dark #1A1A2E | Light #F5F0FF
 */

/* ── Shell ───────────────────────────────────────────────────────────────── */
.shepherd-theme-rewse.shepherd-element {
  border-radius: 10px !important;
  box-shadow: 0 6px 28px rgba(91,45,142,0.35) !important;
  border: none !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
  max-width: 360px !important;
}
.shepherd-theme-rewse .shepherd-content {
  border-radius: 10px !important;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.shepherd-theme-rewse .shepherd-header {
  background: linear-gradient(135deg, #5B2D8E 0%, #1A1A2E 100%) !important;
  padding: 10px 14px !important;
  border-bottom: 2px solid #E8007D !important;
}
.shepherd-theme-rewse .shepherd-title {
  color: #fff !important;
  font-size: .97em !important;
  font-weight: 700 !important;
}
.shepherd-theme-rewse .shepherd-cancel-icon {
  background: transparent !important;
  color: #fff !important;
  border: none !important;
  font-size: 19px !important;
  opacity: .75;
  transition: opacity .2s, transform .2s;
}
.shepherd-theme-rewse .shepherd-cancel-icon:hover {
  opacity: 1;
  transform: scale(1.25);
  color: #E8007D !important;
  background: transparent !important;
}
.shepherd-theme-rewse .shepherd-cancel-icon:focus {
  outline: 2px solid #E8007D !important;
  border-radius: 4px;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.shepherd-theme-rewse .shepherd-text {
  background: #F5F0FF !important;
  color: #2B2B2B !important;
  font-size: .89em !important;
  line-height: 1.52 !important;
  padding: 13px 15px !important;
}
.shepherd-theme-rewse .shepherd-text p { margin: 0 0 7px; }
.shepherd-theme-rewse .shepherd-text p:last-child { margin-bottom: 0; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.shepherd-theme-rewse .shepherd-footer {
  background: #1A1A2E !important;
  padding: 9px 13px !important;
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
  position: relative;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.shepherd-theme-rewse .shepherd-button {
  border-radius: 17px !important;
  padding: 5px 15px !important;
  font-size: .86em !important;
  font-weight: 600 !important;
  cursor: pointer;
  border: 2px solid transparent !important;
  transition: background .2s, transform .15s, border-color .2s;
}
.shepherd-theme-rewse .shepherd-button-primary {
  background: #E8007D !important;
  color: #fff !important;
  border-color: #E8007D !important;
}
.shepherd-theme-rewse .shepherd-button-primary:hover {
  background: #5B2D8E !important;
  border-color: #5B2D8E !important;
  transform: scale(1.04);
}
.shepherd-theme-rewse .shepherd-button-secondary {
  background: transparent !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.45) !important;
}
.shepherd-theme-rewse .shepherd-button-secondary:hover {
  border-color: #E8007D !important;
  color: #E8007D !important;
}
.shepherd-theme-rewse .shepherd-button:focus {
  outline: 2px solid #E8007D !important;
  outline-offset: 2px;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.rw-prog {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 5px;
  background: rgba(255,255,255,.15);
  border-radius: 5px;
  overflow: hidden;
}
.rw-prog span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #E8007D, #5B2D8E);
  border-radius: 5px;
  transition: width .3s ease;
  min-width: 5px;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.shepherd-modal-overlay-container { opacity: .6 !important; }

/* ── Arrow ───────────────────────────────────────────────────────────────── */
.shepherd-arrow::before { background: #5B2D8E !important; }

/* ── Welcome & finish steps (centred, no arrow) ──────────────────────────── */
.shepherd-element[data-shepherd-step-id=welcome],
.shepherd-element[data-shepherd-step-id=finish] {
  max-width: 420px !important;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media screen and (max-width: 640px) {
  /* On mobile all steps are centred – prevents off-screen bubbles */
  .shepherd-theme-rewse.shepherd-element {
    max-width: 92vw !important;
    /* Force centre positioning on small screens */
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    bottom: 80px !important;  /* above the bottom nav bar */
    margin: 0 !important;
  }
  .shepherd-has-cancel-icon .shepherd-cancel-icon { font-size: 22px !important; }
  .shepherd-theme-rewse .shepherd-text { font-size: .93em !important; }
  .shepherd-theme-rewse .shepherd-button { padding: 7px 14px !important; font-size: .9em !important; }
  .rw-prog { display: none; }
  /* Arrow hidden on mobile since step isn't near its target */
  .shepherd-arrow { display: none !important; }
}

/* ── High-contrast mode ──────────────────────────────────────────────────── */
@media (forced-colors: active) {
  .shepherd-theme-rewse .shepherd-header { background: ButtonFace !important; border-bottom-color: ButtonText !important; }
  .shepherd-theme-rewse .shepherd-title,
  .shepherd-theme-rewse .shepherd-cancel-icon { color: ButtonText !important; }
  .shepherd-theme-rewse .shepherd-button { border: 2px solid ButtonText !important; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .shepherd-theme-rewse .shepherd-button,
  .shepherd-theme-rewse .shepherd-cancel-icon { transition: none !important; transform: none !important; }
  .rw-prog span { transition: none !important; }
}
