/* Projectopia tour — leather / gold palette, matches hero & dashboard (no background nuking on targets) */

.tour-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 10, 6, 0.78);
  z-index: 9998;
  pointer-events: auto;
}

/*
 * Highlight ring only — do NOT set background-image / background-clip on the target
 * (old rules broke .sidebar and other leather panels).
 */
.tour-highlighted {
  position: relative !important;
  z-index: 10000 !important;
  pointer-events: auto !important;
  border-radius: 14px !important;
  outline: 3px solid rgba(240, 199, 94, 0.95) !important;
  outline-offset: 5px !important;
  box-shadow:
    0 0 0 2px rgba(42, 24, 16, 0.95),
    0 0 26px rgba(240, 199, 94, 0.5),
    0 0 42px rgba(132, 204, 22, 0.18),
    inset 0 0 0 1px rgba(255, 248, 235, 0.12) !important;
  animation: tour-ring-pulse 2.2s ease-in-out infinite;
  transition: outline-color 0.25s ease, box-shadow 0.25s ease, outline-offset 0.25s ease !important;
}

@keyframes tour-ring-pulse {
  0%,
  100% {
    outline-color: rgba(240, 199, 94, 0.88);
    box-shadow:
      0 0 0 2px rgba(42, 24, 16, 0.95),
      0 0 22px rgba(240, 199, 94, 0.42),
      0 0 36px rgba(190, 242, 100, 0.14),
      inset 0 0 0 1px rgba(255, 248, 235, 0.1);
  }
  50% {
    outline-color: rgba(255, 224, 130, 0.98);
    box-shadow:
      0 0 0 2px rgba(42, 24, 16, 1),
      0 0 34px rgba(240, 199, 94, 0.65),
      0 0 52px rgba(190, 242, 100, 0.22),
      inset 0 0 0 1px rgba(255, 248, 235, 0.18);
  }
}

/* Legacy highlight box (if reintroduced in JS) */
.tour-highlight {
  position: absolute;
  border: 3px solid rgba(240, 199, 94, 0.85);
  border-radius: 14px;
  box-shadow:
    0 0 0 2px rgba(42, 24, 16, 0.85),
    0 0 24px rgba(240, 199, 94, 0.45);
  background: transparent;
  z-index: 9999;
  pointer-events: none;
  animation: tour-ring-pulse 2.2s ease-in-out infinite;
}

.tour-tooltip {
  position: fixed;
  z-index: 10001;
  max-width: min(380px, calc(100vw - 28px));
  min-width: 280px;
  pointer-events: auto;
  animation: tour-slide-in 0.28s ease-out;
  box-sizing: border-box;
}

@keyframes tour-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tour-tooltip-content {
  position: relative;
  background-color: var(--hero-leather-base, #3d2817);
  background-image:
    var(--hero-leather-grad, linear-gradient(135deg, rgba(61, 40, 23, 0.72) 0%, rgba(92, 61, 46, 0.65) 50%, rgba(61, 40, 23, 0.72) 100%)),
    var(--leather-seamless, none);
  background-size: 100% 100%, var(--leather-tile-size, 168px) var(--leather-tile-size, 168px);
  background-repeat: no-repeat, repeat;
  background-blend-mode: multiply, normal;
  border: 4px solid var(--hero-leather-border, #2a1810);
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.45),
    0 10px 22px rgba(0, 0, 0, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.45);
  font-family: var(--default-font-family, 'Shrikhand'), system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  max-height: min(88vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  isolation: isolate;
}

.tour-tooltip-content::before {
  content: '';
  position: absolute;
  inset: 11px;
  border-radius: 12px;
  border: 2px dashed var(--hero-leather-stitch, rgba(218, 165, 32, 0.4));
  pointer-events: none;
  z-index: 0;
}

.tour-tooltip-content::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.09) 0%, transparent 58%);
  pointer-events: none;
  z-index: 0;
}

.tour-tooltip-content > * {
  position: relative;
  z-index: 1;
}

.tour-tooltip-title {
  font-size: 1.28rem;
  font-weight: 700;
  color: #fffef9;
  margin: 0 0 10px;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.35);
  line-height: 1.25;
}

.tour-tooltip-text {
  font-size: 1rem;
  color: rgba(255, 254, 249, 0.94);
  line-height: 1.55;
  margin: 0 0 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-shrink: 1;
  min-height: 0;
}

.tour-progress {
  font-size: 0.88rem;
  color: rgba(240, 199, 94, 0.95);
  text-align: center;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.tour-navigation {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 4px;
}

.tour-btn {
  padding: 10px 16px;
  min-height: 44px;
  font-size: 0.92rem;
  font-family: var(--default-font-family, 'Shrikhand'), system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  outline: none;
  touch-action: manipulation;
  user-select: none;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tour-btn:focus-visible {
  outline: 2px solid rgba(240, 199, 94, 0.95);
  outline-offset: 2px;
}

.tour-btn.tour-next {
  color: #0f240c;
  border-color: #4d7c0f;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, transparent 42%),
    linear-gradient(145deg, #bef264 0%, #84cc16 45%, #65a30d 100%);
  box-shadow:
    0 5px 0 0 #2f5c12,
    0 8px 18px rgba(0, 0, 0, 0.32),
    inset 0 -2px 3px rgba(0, 0, 0, 0.15);
}

.tour-btn.tour-next:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.tour-btn.tour-next:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 0 #2f5c12,
    0 4px 12px rgba(0, 0, 0, 0.28),
    inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.tour-btn.tour-prev {
  color: #fff8ef;
  border-color: #5c4a3a;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
    linear-gradient(145deg, #6d5544 0%, #4a3628 100%);
  box-shadow:
    0 4px 0 0 #2e1f18,
    0 6px 14px rgba(0, 0, 0, 0.28),
    inset 0 -2px 3px rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.tour-btn.tour-prev:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.tour-btn.tour-prev:active {
  transform: translateY(1px);
}

.tour-btn.tour-skip {
  color: #fff5f5;
  border-color: #7f2d2d;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 42%),
    linear-gradient(145deg, #c85a5a 0%, #8b2f2f 55%, #6a2222 100%);
  box-shadow:
    0 4px 0 0 #4a1818,
    0 6px 14px rgba(0, 0, 0, 0.3),
    inset 0 -2px 3px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.tour-btn.tour-skip:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.tour-btn.tour-skip:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .tour-tooltip {
    max-width: calc(100vw - 24px);
    min-width: auto;
    left: 12px !important;
    right: 12px;
  }

  .tour-tooltip-content {
    padding: 18px 16px 14px;
    max-height: 85vh;
  }

  .tour-tooltip-title {
    font-size: 1.12rem;
  }

  .tour-tooltip-text {
    font-size: 0.9rem;
  }

  .tour-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    flex: 1;
    min-width: 76px;
  }
}
