/* Import Driver.js base styles */
@import 'driver.js/dist/driver.css';

/* Custom theme for BakeryIA tour */
.driver-popover.bakery-tour-popover {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  border-radius: 12px;
  max-width: 400px;
}

.driver-popover.bakery-tour-popover .driver-popover-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.driver-popover.bakery-tour-popover .driver-popover-description {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.driver-popover.bakery-tour-popover .driver-popover-progress-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.driver-popover.bakery-tour-popover .driver-popover-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.driver-popover.bakery-tour-popover .driver-popover-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  /* Ensure crisp text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Prevent blur from transforms */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
  /* Ensure no opacity issues */
  opacity: 1;
  /* Force hardware acceleration for crisp rendering */
  transform: translate3d(0, 0, 0);
  will-change: transform;
  /* Additional text clarity */
  text-shadow: none;
  filter: none;
}

.driver-popover.bakery-tour-popover .driver-popover-next-btn {
  background: var(--color-primary);
  color: #ffffff;
  flex: 1;
  /* Ensure text is fully opaque */
  opacity: 1;
  /* WHITE TEXT ON COLORED BG FIX: Use antialiased, not subpixel */
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  /* Slight letter spacing helps with clarity */
  letter-spacing: 0.01em;
  /* Prevent any blur from transforms */
  transform: translate3d(0, 0, 0);
  /* NO text-shadow - can cause blur */
  text-shadow: none;
  /* Ensure proper line height */
  line-height: 1.5;
}

.driver-popover.bakery-tour-popover .driver-popover-next-btn:hover {
  background: var(--color-primary-dark);
  transform: translate3d(0, -1px, 0);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.driver-popover.bakery-tour-popover .driver-popover-prev-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  /* Ensure text is fully opaque */
  opacity: 1;
  /* Same crisp text rendering as next button */
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  letter-spacing: 0.01em;
  transform: translate3d(0, 0, 0);
  text-shadow: none;
  line-height: 1.5;
}

.driver-popover.bakery-tour-popover .driver-popover-prev-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  transform: translate3d(0, 0, 0);
}

.driver-popover.bakery-tour-popover .driver-popover-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  padding: 0;
}

.driver-popover.bakery-tour-popover .driver-popover-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.driver-popover.bakery-tour-popover .driver-popover-arrow-side-top.driver-popover-arrow {
  border-top-color: var(--bg-primary);
}

.driver-popover.bakery-tour-popover .driver-popover-arrow-side-bottom.driver-popover-arrow {
  border-bottom-color: var(--bg-primary);
}

.driver-popover.bakery-tour-popover .driver-popover-arrow-side-left.driver-popover-arrow {
  border-left-color: var(--bg-primary);
}

.driver-popover.bakery-tour-popover .driver-popover-arrow-side-right.driver-popover-arrow {
  border-right-color: var(--bg-primary);
}

/*
 * Driver.js Overlay Styling
 * Driver.js v1.3.6 uses SVG with a cutout path for the spotlight effect
 * DO NOT override position, width, height, or other layout properties
 * Only customize visual appearance
 */

/* SVG Overlay - only customize the fill color */
.driver-overlay svg {
  /* The SVG path fill color for the dark overlay */
  fill: rgba(0, 0, 0, 0.75);
}

/* Prevent backdrop-filter from interfering */
.driver-overlay {
  backdrop-filter: none !important;
}

/* Visual emphasis for highlighted element - adds outline */
.driver-active-element {
  outline: 4px solid var(--color-primary) !important;
  outline-offset: 4px !important;
}

/* Prevent theme glass effects from interfering */
.driver-overlay.glass-effect,
.driver-popover.glass-effect,
.driver-active-element.glass-effect {
  backdrop-filter: none !important;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .driver-popover.bakery-tour-popover {
    max-width: calc(100vw - 2rem);
    margin: 0 1rem;
  }

  .driver-popover.bakery-tour-popover .driver-popover-title {
    font-size: 1rem;
  }

  .driver-popover.bakery-tour-popover .driver-popover-description {
    font-size: 0.875rem;
  }

  .driver-popover.bakery-tour-popover .driver-popover-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Last step special styling (CTA) */
.driver-popover.bakery-tour-popover:has(.driver-popover-next-btn:contains("Crear Cuenta")) .driver-popover-next-btn {
  background: linear-gradient(135deg, var(--color-primary) 0%, #d97706 100%);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2);
  font-weight: 700;
  padding: 0.75rem 1.5rem;
}

.driver-popover.bakery-tour-popover:has(.driver-popover-next-btn:contains("Crear Cuenta")) .driver-popover-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
}
