/**
 * Custom Shepherd Tour Styling
 * Localized version of Shepherd CSS with customized styling
 */

:root {
  --shepherd-primary-color: #3288e6;
  --shepherd-secondary-color: #f1f2f3;
  --shepherd-text-color: rgba(0, 0, 0, 0.75);
  --shepherd-background: #fff;
  --shepherd-header-background: #f6f7f9;
  --shepherd-border-radius: 6px;
  --shepherd-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Button styling */
.shepherd-button {
  background: var(--shepherd-primary-color);
  border: 0;
  border-radius: var(--shepherd-border-radius);
  color: #ffffff;
  cursor: pointer;
  font-weight: 500;
  margin-right: 0.75rem;
  padding: 0.5rem 1.25rem;
  transition: all 0.2s ease;
}

.shepherd-button:not(:disabled):hover {
  background: #196fcc;
  transform: translateY(-1px);
}

.shepherd-button.shepherd-button-secondary {
  background: var(--shepherd-secondary-color);
  color: var(--shepherd-text-color);
}

.shepherd-button.shepherd-button-secondary:not(:disabled):hover {
  background: #d6d9db;
}

.shepherd-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Footer styling */
.shepherd-footer {
  border-bottom-left-radius: var(--shepherd-border-radius);
  border-bottom-right-radius: var (--shepherd-border-radius);
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
}

.shepherd-footer .shepherd-button:last-child {
  margin-right: 0;
}

/* Cancel icon styling */
.shepherd-cancel-icon {
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 1.6em;
  font-weight: 400;
  margin: 0;
  padding: 0;
  transition: color 0.2s ease;
}

.shepherd-cancel-icon:hover {
  color: rgba(0, 0, 0, 0.75);
}

/* Title styling */
.shepherd-title {
  color: var(--shepherd-text-color);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
  padding: 0;
}

/* Header styling */
.shepherd-header {
  align-items: center;
  border-top-left-radius: var(--shepherd-border-radius);
  border-top-right-radius: var(--shepherd-border-radius);
  display: flex;
  justify-content: space-between;
  line-height: 1.5em;
  padding: 0.75rem 1rem 0.75rem;  /* Adjusted padding to be consistent */
  position: relative;             /* Added position relative */
  z-index: 2;                     /* Added z-index to ensure header stays on top */
}

.shepherd-has-title .shepherd-content .shepherd-header {
  background: var(--shepherd-header-background);
  padding: 1em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Content text styling */
.shepherd-text {
  color: var(--shepherd-text-color);
  font-size: 0.94rem;
  line-height: 1.5em;
  padding: 1rem;
  position: relative;     /* Added position relative */
  z-index: 1;             /* Added z-index to ensure content is below header but visible */
  background: var(--shepherd-background);  /* Added background to ensure content is visible */
  overflow: auto;         /* Added overflow auto for long content */
  max-height: 300px;      /* Added max-height to prevent extremely tall tooltips */
}

.shepherd-text p {
  margin-top: 0;
}

.shepherd-text p:last-child {
  margin-bottom: 0;
}

/* Main content container */
.shepherd-content {
  border-radius: var(--shepherd-border-radius);
  outline: none;
  padding: 0;
  display: flex;          /* Added flex display */
  flex-direction: column; /* Added column direction */
  background: var(--shepherd-background);  /* Added background */
}

/* Element styling (tooltip/popup) */
.shepherd-element {
  background: var(--shepherd-background);
  border-radius: var(--shepherd-border-radius);
  box-shadow: var(--shepherd-shadow);
  max-width: 400px;
  opacity: 0;
  outline: none;
  /* Modified transition to only affect opacity, not position */
  transition: opacity 0.3s ease;
  visibility: hidden;
  width: 100%;
  z-index: 9999;
  overflow: hidden;
  /* Prevent any transform animations that could cause the flying effect */
  transform: none !important;
}

.shepherd-enabled.shepherd-element {
  opacity: 1;
  visibility: visible;
  /* Remove the transform that was causing position change */
  transform: none !important;
}

/* Arrow styling */
.shepherd-arrow,
.shepherd-arrow:before {
  height: 16px;
  position: absolute;
  width: 16px;
  z-index: -1;
}

.shepherd-arrow:before {
  background: var(--shepherd-background);
  content: "";
  transform: rotate(45deg);
  box-shadow: var(--shepherd-shadow);
}

.shepherd-element[data-popper-placement^=top] > .shepherd-arrow {
  bottom: -8px;
}

.shepherd-element[data-popper-placement^=bottom] > .shepherd-arrow {
  top: -8px;
}

.shepherd-element[data-popper-placement^=left] > .shepherd-arrow {
  right: -8px;
}

.shepherd-element[data-popper-placement^=right] > .shepherd-arrow {
  left: -8px;
}

.shepherd-element.shepherd-has-title[data-popper-placement^=bottom] > .shepherd-arrow:before {
  background-color: var(--shepherd-header-background);
}

/* Overlay styling */
.shepherd-modal-overlay-container {
  height: 0;
  left: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  top: 0;
  transition: all 0.3s ease-out, height 0ms 0.3s, opacity 0.3s 0ms;
  width: 100vw;
  z-index: 9997;
}

.shepherd-modal-overlay-container.shepherd-modal-is-visible {
  height: 100vh;
  opacity: 0.6;
  transform: translateZ(0);
  transition: all 0.3s ease-out, height 0s 0s, opacity 0.3s 0s;
}

/* Add this to override any positional animations from Shepherd */
[data-popper-reference-hidden],
[data-popper-escaped],
[data-popper-placement] {
  transition: opacity 0.3s ease !important;
  /*transform: none !important;*/
}

/* Ensure Popper.js doesn't add unwanted transitions */
.shepherd-element[data-popper-reference-hidden],
.shepherd-element[data-popper-escaped],
.shepherd-element[data-popper-placement] {
  transition: opacity 0.3s ease !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .shepherd-element {
    max-width: 90%;
    margin: 0 auto;
  }
}
