/* Tour Theme CSS - Custom Shepherd.js styling
 * Matches repo theme: black/white with blue accents
 * borders gray-200, primary blue-600, text gray-900
 */

/* ======================================
 * CSS Variables for Theme
 * ====================================== */
:root {
  --tour-bg: #ffffff;
  --tour-text: #1f2937;          /* gray-900 */
  --tour-text-muted: #6b7280;    /* gray-500 */
  --tour-border: #e5e7eb;        /* gray-200 */
  --tour-primary: #2563eb;       /* blue-600 */
  --tour-primary-hover: #1d4ed8; /* blue-700 */
  --tour-secondary: #f3f4f6;     /* gray-100 */
  --tour-overlay: rgba(0, 0, 0, 0.5);
  --tour-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ======================================
 * Modal Overlay
 * ====================================== */
.shepherd-modal-overlay-container {
  fill: var(--tour-overlay);
  pointer-events: none;
  z-index: 9998;
}

/* ======================================
 * Step Element Container
 * ====================================== */
.shepherd-element {
  background: var(--tour-bg);
  border: 1px solid var(--tour-border);
  border-radius: 0.5rem;
  box-shadow: var(--tour-shadow);
  max-width: 400px;
  z-index: 9999;
  outline: none;
}

.shepherd-element.shepherd-has-title .shepherd-content .shepherd-header {
  background: var(--tour-bg);
  padding: 1rem 1rem 0;
}

/* ======================================
 * Header
 * ====================================== */
.shepherd-header {
  align-items: center;
  border-radius: 0.5rem 0.5rem 0 0;
  display: flex;
  justify-content: flex-end;
  line-height: 2em;
  padding: 0.75rem 0.75rem 0;
}

.shepherd-has-title .shepherd-content .shepherd-header {
  padding: 1rem;
  background: var(--tour-bg);
  border-bottom: 1px solid var(--tour-border);
}

.shepherd-title {
  color: var(--tour-text);
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  flex: 1 0 auto;
  margin: 0;
  padding: 0;
}

.shepherd-cancel-icon {
  background: transparent;
  border: none;
  color: var(--tour-text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0;
  padding: 0;
  transition: color 0.15s ease;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shepherd-cancel-icon:hover {
  color: var(--tour-text);
}

.shepherd-has-cancel-icon .shepherd-title {
  margin-right: 0.5rem;
}

/* ======================================
 * Content / Text
 * ====================================== */
.shepherd-content {
  border-radius: 0.5rem;
}

.shepherd-text {
  color: var(--tour-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 1rem;
}

.shepherd-text p {
  margin: 0 0 0.5rem;
}

.shepherd-text p:last-child {
  margin-bottom: 0;
}

/* ======================================
 * Footer / Buttons
 * ====================================== */
.shepherd-footer {
  border-top: 1px solid var(--tour-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--tour-secondary);
  border-radius: 0 0 0.5rem 0.5rem;
}

.shepherd-button {
  background: var(--tour-primary);
  border: none;
  border-radius: 0.375rem;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.15s ease;
}

.shepherd-button:hover {
  background: var(--tour-primary-hover);
}

.shepherd-button:focus {
  outline: 2px solid var(--tour-primary);
  outline-offset: 2px;
}

/* Secondary button (Back, Skip) */
.shepherd-button-secondary,
.shepherd-button.shepherd-button-secondary {
  background: var(--tour-bg);
  color: var(--tour-text-muted);
  border: 1px solid var(--tour-border);
}

.shepherd-button-secondary:hover,
.shepherd-button.shepherd-button-secondary:hover {
  background: var(--tour-secondary);
  color: var(--tour-text);
}

/* ======================================
 * Progress Indicator
 * ====================================== */
.shepherd-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shepherd-progress-text {
  font-size: 0.75rem;
  color: var(--tour-text-muted);
}

.shepherd-progress-dots {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.shepherd-progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tour-border);
  transition: all 0.2s ease;
}

.shepherd-progress-dot.active {
  background: var(--tour-primary);
  transform: scale(1.2);
}

.shepherd-progress-dot.completed {
  background: var(--tour-primary);
  opacity: 0.5;
}

/* ======================================
 * Arrow
 * ====================================== */
.shepherd-arrow,
.shepherd-arrow:before {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: -1;
}

.shepherd-arrow:before {
  content: '';
  transform: rotate(45deg);
  background: var(--tour-bg);
  border: 1px solid var(--tour-border);
}

.shepherd-element[data-popper-placement^='top'] > .shepherd-arrow {
  bottom: -8px;
}

.shepherd-element[data-popper-placement^='top'] > .shepherd-arrow:before {
  border-top: none;
  border-left: none;
}

.shepherd-element[data-popper-placement^='bottom'] > .shepherd-arrow {
  top: -8px;
}

.shepherd-element[data-popper-placement^='bottom'] > .shepherd-arrow:before {
  border-bottom: none;
  border-right: none;
}

.shepherd-element[data-popper-placement^='left'] > .shepherd-arrow {
  right: -8px;
}

.shepherd-element[data-popper-placement^='left'] > .shepherd-arrow:before {
  border-left: none;
  border-bottom: none;
}

.shepherd-element[data-popper-placement^='right'] > .shepherd-arrow {
  left: -8px;
}

.shepherd-element[data-popper-placement^='right'] > .shepherd-arrow:before {
  border-top: none;
  border-right: none;
}

/* ======================================
 * Target Element Highlight
 * ====================================== */
.shepherd-target-click-disabled {
  pointer-events: none !important;
}

.shepherd-target {
  outline: 3px solid var(--tour-primary) !important;
  outline-offset: 2px;
  border-radius: 4px;
  position: relative;
  z-index: 9997;
}

/* Pulse animation for highlighted element */
.shepherd-target.shepherd-target-pulse {
  animation: tour-pulse 1.5s ease-in-out infinite;
}

@keyframes tour-pulse {
  0%, 100% {
    outline-offset: 2px;
    outline-color: var(--tour-primary);
  }
  50% {
    outline-offset: 4px;
    outline-color: rgba(37, 99, 235, 0.6);
  }
}

/* ======================================
 * First Login Modal
 * ====================================== */
.tour-welcome-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tour-welcome-modal.active {
  opacity: 1;
  visibility: visible;
}

.tour-welcome-modal-content {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 400px;
  width: 90%;
  padding: 2rem;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.tour-welcome-modal.active .tour-welcome-modal-content {
  transform: scale(1);
}

.tour-welcome-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-welcome-icon i {
  font-size: 1.75rem;
  color: white;
}

.tour-welcome-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tour-text);
  margin-bottom: 0.5rem;
}

.tour-welcome-description {
  font-size: 0.875rem;
  color: var(--tour-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.tour-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tour-welcome-btn {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.tour-welcome-btn-primary {
  background: var(--tour-primary);
  color: white;
}

.tour-welcome-btn-primary:hover {
  background: var(--tour-primary-hover);
}

.tour-welcome-btn-secondary {
  background: transparent;
  color: var(--tour-text-muted);
  border: 1px solid var(--tour-border);
}

.tour-welcome-btn-secondary:hover {
  background: var(--tour-secondary);
}

.tour-welcome-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--tour-text-muted);
  cursor: pointer;
}

.tour-welcome-dismiss input {
  margin: 0;
}

.tour-welcome-dismiss:hover {
  color: var(--tour-text);
}

/* ======================================
 * Tour Button (Take a Tour)
 * ====================================== */
.tour-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #1f2937; /* gray-800 - dark bg for visibility */
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tour-trigger-btn:hover {
  background: #111827; /* gray-900 */
  border-color: #111827;
}

.tour-trigger-btn i {
  font-size: 1rem;
  color: white;
}

/* Icon-only variant (just the ? button) */
.tour-trigger-btn.tour-trigger-btn-icon-only {
  padding: 0.5rem 0.75rem;
  min-width: 2.5rem;
  justify-content: center;
}

.tour-trigger-btn.tour-trigger-btn-icon-only i {
  font-size: 1.125rem;
}

/* Pulsating animation for tour buttons to draw attention */
.tour-trigger-btn {
  animation: tour-btn-pulse 2s ease-in-out infinite;
}

@keyframes tour-btn-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(31, 41, 55, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(31, 41, 55, 0);
  }
}

/* Stop pulsing on hover - user found it */
.tour-trigger-btn:hover {
  animation: none;
}

/* Tour progress badge */
.tour-progress-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  color: #1f2937;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  margin-left: 0.25rem;
}

.tour-progress-badge.completed {
  background: #10b981; /* green-500 */
  color: white;
}

/* Help icon button (for simple view) */
.tour-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: white;
  border: 1px solid var(--tour-border);
  border-radius: 50%;
  color: var(--tour-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tour-help-btn:hover {
  background: var(--tour-secondary);
  border-color: var(--tour-primary);
  color: var(--tour-primary);
}

/* ======================================
 * Mobile Responsiveness
 * ====================================== */
@media (max-width: 640px) {
  .shepherd-element {
    max-width: calc(100vw - 2rem);
    margin: 0 1rem;
  }

  .shepherd-text {
    padding: 0.75rem;
  }

  .shepherd-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .shepherd-button {
    width: 100%;
    text-align: center;
  }

  .tour-welcome-modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }
}

/* ======================================
 * Animations
 * ====================================== */
.shepherd-element {
  animation: tour-fade-in 0.2s ease-out;
}

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

/* ======================================
 * Utility Classes
 * ====================================== */
.tour-hidden {
  display: none !important;
}

.tour-visible {
  display: block !important;
}
