/* Tour styles */
.tour-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.tour-highlight {
  position: relative;
  z-index: 10001 !important;
  transition: all 0.3s ease;
}

/* Only apply box-shadow to non-button elements */
.tour-highlight:not(input):not(button) {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3) !important;
  border-radius: 8px !important;
}

/* Special highlighting for buttons - completely preserve original appearance */
input[type="submit"].tour-highlight,
button.tour-highlight,
.tour-highlight input[type="submit"],
.tour-highlight button {
  position: relative !important;
  /* Force preserve all original button styling */
  background: #2563eb !important;
  background-color: #2563eb !important;
  background-image: none !important;
  color: white !important;
  border: 1px solid transparent !important;
  border-color: transparent !important;
  border-radius: 0.75rem !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 1 !important;
  filter: none !important;
  outline: none !important;
  text-decoration: none !important;
}

/* Create external glow around buttons without affecting the button itself */
input[type="submit"].tour-highlight::before,
button.tour-highlight::before,
.tour-highlight input[type="submit"]::before,
.tour-highlight button::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: transparent;
  border: 4px solid rgba(37, 99, 235, 0.9);
  border-radius: inherit;
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
  pointer-events: none;
  z-index: -1;
}

.tour-tooltip {
  position: fixed;
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #e5e7eb;
  max-width: 320px;
  min-width: 280px;
  z-index: 10002;
  font-family: system-ui, -apple-system, sans-serif;
}

.tour-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 0;
  gap: 10px;
}

.tour-tooltip-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  line-height: 1.4;
}

.tour-close-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tour-close-btn:hover {
  background: #f3f4f6;
  color: #6b7280;
}

.tour-tooltip-content {
  padding: 16px 20px;
}

.tour-tooltip-content p {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
  font-size: 14px;
}

.tour-tooltip-footer {
  padding: 0 20px 20px;
  border-top: 1px solid #f3f4f6;
  margin-top: 16px;
  padding-top: 16px;
}

.tour-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tour-step-counter {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}

.tour-progress-bar {
  flex: 1;
  height: 4px;
  background: #f3f4f6;
  border-radius: 2px;
  overflow: hidden;
}

.tour-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.tour-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.tour-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  min-width: 70px;
}

.tour-btn-primary {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.tour-btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-1px);
}

.tour-btn-secondary {
  background: white;
  color: #6b7280;
  border-color: #d1d5db;
}

.tour-btn-secondary:hover {
  background: #f9fafb;
  color: #4b5563;
  border-color: #9ca3af;
}

/* Body modifications when tour is active */
body.tour-active {
  overflow: hidden;
}

/* Animation for tour elements */
.tour-tooltip {
  animation: tourFadeIn 0.3s ease-out;
}

@keyframes tourFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tour-highlight {
  animation: tourHighlight 0.4s ease-out;
}

@keyframes tourHighlight {
  from {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  to {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tour-tooltip {
    max-width: 280px;
    min-width: 260px;
    margin: 10px;
  }
  
  .tour-tooltip-header {
    padding: 16px 16px 0;
  }
  
  .tour-tooltip-content {
    padding: 12px 16px;
  }
  
  .tour-tooltip-footer {
    padding: 0 16px 16px;
    padding-top: 12px;
  }
  
  .tour-buttons {
    flex-wrap: wrap;
  }
  
  .tour-btn {
    flex: 1;
    min-width: auto;
  }
}

/* Ensure tour elements are always on top */
.tour-backdrop,
.tour-tooltip,
.tour-highlight {
  pointer-events: auto !important;
}

/* Tour controller is always hidden - it just manages the tour */
.tour-controller {
  display: none !important;
}