/* ──────────────────────────────────────────────────────────────────────────
   F1 Picks — Interactive Tour Guide
   Overlay-based walkthrough with highlight + tooltip
   ────────────────────────────────────────────────────────────────────────── */

/* ── Question-mark trigger button ─────────────────────────────────────── */
#tourTriggerBtn {
  position: fixed;
  top: 70px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--f1-red, #e10600);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 1050;
  box-shadow: 0 2px 12px rgba(225, 6, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
#tourTriggerBtn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(225, 6, 0, 0.6);
  background: #c40500;
}
#tourTriggerBtn:active {
  transform: scale(0.95);
}

/* Subtle pulse animation to draw attention */
@keyframes tour-btn-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(225, 6, 0, 0.4); }
  50% { box-shadow: 0 2px 20px rgba(225, 6, 0, 0.7), 0 0 0 6px rgba(225, 6, 0, 0.15); }
}
#tourTriggerBtn.tour-pulse {
  animation: tour-btn-pulse 2s ease-in-out 3;
}

/* ── Overlay backdrop ─────────────────────────────────────────────────── */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tour-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Dark backdrop with cutout hole */
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.65);
  transition: all 0.35s ease;
}

/* ── Spotlight (highlighted element) ──────────────────────────────────── */
.tour-spotlight {
  position: fixed;
  z-index: 10002;
  border-radius: 8px;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.65);
  transition: all 0.35s ease;
  pointer-events: none;
}
.tour-spotlight::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--f1-red, #e10600);
  border-radius: 10px;
  animation: tour-spotlight-pulse 1.5s ease-in-out infinite;
}
@keyframes tour-spotlight-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Tooltip / card ───────────────────────────────────────────────────── */
.tour-tooltip {
  position: fixed;
  z-index: 10003;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--bg-secondary, #fff);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(225, 6, 0, 0.2);
  transition: all 0.35s ease;
  pointer-events: auto;
  overflow: hidden;
}
[data-theme="dark"] .tour-tooltip {
  background: var(--bg-secondary, #202029);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(225, 6, 0, 0.3);
}

/* Tooltip arrow */
.tour-tooltip::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--bg-secondary, #fff);
  transform: rotate(45deg);
  z-index: -1;
}
[data-theme="dark"] .tour-tooltip::before {
  background: var(--bg-secondary, #202029);
}
.tour-tooltip[data-position="bottom"]::before {
  top: -7px;
  left: 30px;
  box-shadow: -1px -1px 0 rgba(225, 6, 0, 0.2);
}
.tour-tooltip[data-position="top"]::before {
  bottom: -7px;
  left: 30px;
  box-shadow: 1px 1px 0 rgba(225, 6, 0, 0.2);
}
.tour-tooltip[data-position="left"]::before {
  right: -7px;
  top: 20px;
  box-shadow: 1px -1px 0 rgba(225, 6, 0, 0.2);
}
.tour-tooltip[data-position="right"]::before {
  left: -7px;
  top: 20px;
  box-shadow: -1px 1px 0 rgba(225, 6, 0, 0.2);
}

/* Red accent stripe at top */
.tour-tooltip-header {
  background: linear-gradient(135deg, var(--f1-red, #e10600), #b00000);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tour-tooltip-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff !important;
}
.tour-tooltip-step {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.85) !important;
  font-weight: 600;
  white-space: nowrap;
}

.tour-tooltip-body {
  padding: 1rem;
}
.tour-tooltip-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary, #15151e) !important;
}

.tour-tooltip-footer {
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color, #dee2e6);
  gap: 0.5rem;
}

/* Progress dots */
.tour-progress {
  display: flex;
  gap: 5px;
  align-items: center;
}
.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color, #dee2e6);
  transition: all 0.2s;
}
.tour-dot.active {
  background: var(--f1-red, #e10600);
  transform: scale(1.2);
}
.tour-dot.completed {
  background: #28a745;
}

/* Navigation buttons */
.tour-nav {
  display: flex;
  gap: 0.4rem;
}
.tour-btn {
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tour-btn-secondary {
  background: var(--info-bg, #f8f9fa);
  color: var(--text-primary, #15151e);
}
.tour-btn-secondary:hover {
  background: var(--border-color, #dee2e6);
}
[data-theme="dark"] .tour-btn-secondary {
  background: var(--bg-primary, #15151e);
  color: var(--text-primary, #f8f9fa);
}
[data-theme="dark"] .tour-btn-secondary:hover {
  background: var(--border-color, #495057);
}
.tour-btn-primary {
  background: var(--f1-red, #e10600);
  color: #fff;
}
.tour-btn-primary:hover {
  background: #c40500;
}
.tour-btn-skip {
  background: transparent;
  color: var(--text-secondary, #6c757d);
  font-weight: 500;
  font-size: 0.75rem;
}
.tour-btn-skip:hover {
  color: var(--text-primary, #15151e);
  text-decoration: underline;
}

/* ── Welcome modal (first step of tour) ───────────────────────────────── */
.tour-welcome {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10003;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--bg-secondary, #fff);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  pointer-events: auto;
}
[data-theme="dark"] .tour-welcome {
  background: var(--bg-secondary, #202029);
}
.tour-welcome-hero {
  background: linear-gradient(135deg, #15151e 0%, var(--f1-red, #e10600) 100%);
  padding: 2rem 1.5rem;
  text-align: center;
}
.tour-welcome-hero i {
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 0.75rem;
  display: block;
}
.tour-welcome-hero h3 {
  color: #fff !important;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.tour-welcome-hero p {
  color: rgba(255,255,255,0.85) !important;
  font-size: 0.9rem;
  margin: 0;
}
.tour-welcome-body {
  padding: 1.25rem 1.5rem;
}
.tour-welcome-body p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary) !important;
  margin-bottom: 1rem;
}
.tour-welcome-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.tour-welcome-actions .tour-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

/* ── Mobile adjustments ───────────────────────────────────────────────── */
@media (max-width: 576px) {
  #tourTriggerBtn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
    top: 65px;
    right: 12px;
  }
  .tour-tooltip {
    width: calc(100vw - 24px);
    max-width: 100%;
  }
  .tour-tooltip-body p {
    font-size: 0.85rem;
  }
  .tour-welcome {
    width: calc(100vw - 24px);
  }
}
