/**
 * PFAS Dashboard — Guided Tour Styling
 * ============================================================
 * Styles ONLY the tour's own elements: the "Take a quick tour" button
 * and a light theme pass over driver.js's popover (applied only to
 * popovers carrying the "pfas-tour-popover" class, so it can never
 * affect anything else on the page). Nothing here touches existing
 * dashboard markup or class names.
 */

:root {
  --pfas-tour-primary: #00274c; /* matches the dashboard's header/body color */
  --pfas-tour-accent: #ffcb05; /* matches the dashboard's link color; used for keyboard focus only */
  --pfas-tour-on-primary: #ffffff;
}

/* ---- Launch button ---- */
/* Deliberately quiet: light/neutral so it reads as part of the header
   chrome rather than a call-to-action competing with the dashboard. */

.pfas-tour-launch-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: fixed;
  z-index: 999999;
  /* Docked in the header strip's empty right side by default — that
     strip is a fixed height and doesn't grow with map/legend content,
     so this never overlaps anything below it. */
  top: 20px;
  right: 20px;
  padding: 8px 14px;
  background-color: #ffffff;
  color: var(--pfas-tour-primary);
  border: 1px solid #d5dae0;
  border-radius: 999px;
  font-family: "Helvetica Neue", Inter, ui-sans-serif, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.pfas-tour-launch-btn:hover {
  background-color: #f2f5f8;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

/* Focus keeps a clear, visibly-accessible ring — it only ever shows up
   for keyboard users tabbing through, not during ordinary mouse use. */
.pfas-tour-launch-btn:focus-visible {
  outline: 2px solid var(--pfas-tour-primary);
  outline-offset: 2px;
}

.pfas-tour-launch-btn:focus:not(:focus-visible) {
  outline: none;
}
.pfas-tour-launch-btn:focus {
  outline: 2px solid var(--pfas-tour-primary);
  outline-offset: 2px;
}

.pfas-tour-launch-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.pfas-tour-launch-btn__label {
  white-space: nowrap;
}

/* On narrow layouts the header wraps to multiple lines and its top-right
   corner holds the app's own share icons, so the button moves to a
   fixed bottom-left corner instead — clear of both. */
@media (max-width: 760px) {
  .pfas-tour-launch-btn {
    top: auto;
    right: auto;
    left: 12px;
    bottom: 12px;
  }
}

@media (max-width: 480px) {
  .pfas-tour-launch-btn {
    padding: 10px;
  }
  .pfas-tour-launch-btn__label {
    display: none;
  }
}

/* ---- Popover theme pass (scoped to .pfas-tour-popover only) ---- */

.pfas-tour-popover.driver-popover {
  border-radius: 8px;
  border-top: 4px solid var(--pfas-tour-primary);
  max-width: 320px;
}

.pfas-tour-popover .driver-popover-title {
  color: var(--pfas-tour-primary);
  font-size: 17px;
}

.pfas-tour-popover .driver-popover-description {
  color: #333;
}

.pfas-tour-popover .driver-popover-progress-text {
  color: #727272;
}

.pfas-tour-popover .driver-popover-footer-btn {
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 600;
}

.pfas-tour-popover .driver-popover-next-btn,
.pfas-tour-popover .driver-popover-done-btn {
  background-color: var(--pfas-tour-primary);
  border-color: var(--pfas-tour-primary);
  color: var(--pfas-tour-on-primary);
}

.pfas-tour-popover .driver-popover-next-btn:hover,
.pfas-tour-popover .driver-popover-done-btn:hover,
.pfas-tour-popover .driver-popover-next-btn:focus,
.pfas-tour-popover .driver-popover-done-btn:focus {
  background-color: #001a33;
}

.pfas-tour-popover .driver-popover-prev-btn {
  background-color: #fff;
  color: var(--pfas-tour-primary);
  border-color: var(--pfas-tour-primary);
}

.pfas-tour-popover .driver-popover-close-btn {
  font-size: 20px;
  color: #999;
}

.pfas-tour-popover .driver-popover-close-btn:hover,
.pfas-tour-popover .driver-popover-close-btn:focus {
  color: var(--pfas-tour-primary);
}

/* Responsive: keep the popover comfortably on smaller screens. */
@media (max-width: 480px) {
  .pfas-tour-popover.driver-popover {
    max-width: calc(100vw - 32px);
    min-width: 0;
  }
}
