/**
 * Utility Classes
 * Common utility classes for component styling
 * Extracted from components.css for better organization
 */

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/**
 * Common utility classes for component styling
 */

/* Accessibility improvements */
.focus-ring:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.smooth-transition {
  transition: all 0.2s ease;
}

/* ============================================================================
   ANIMATION UTILITIES
   ============================================================================ */

/* Animation delay utilities from list-spot-3step.css */
.animation-delay-50 { animation-delay: 0.05s; }
.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }

/* ============================================================================
   ACCESSIBILITY UTILITIES FROM CUSTOM.CSS
   ============================================================================ */

/* Screen reader only content */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Avatar visibility fix */
.rounded-full img,
.rounded-full div {
  display: block !important;
  visibility: visible !important;
}

/* ============================================================================
   IMAGE OVERLAY FIXES
   ============================================================================ */

/* Prevents Chrome/Edge image overlays (Lens, Visual Search, etc.) */
img::before,
img::after {
  content: none !important;
  display: none !important;
}

[jsname][role="button"],
div[aria-label="Visual search"] {
  display: none !important;
}

/* ============================================================================
   ENHANCED FOCUS STATES
   ============================================================================ */

/* Enhanced focus states from custom.css */
.focus-enhanced:focus {
  outline: 2px solid var(--color-primary-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 10%);
}

/* ============================================================================
   TRANSITION UTILITIES
   ============================================================================ */

/* Smooth transitions for interactive elements */
.transition-smooth {
  transition: all var(--transition-smooth);
}

.transition-smooth:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

/* Loading states from custom.css */
.loading-pulse {
  animation: loading-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================================
   GRADIENT UTILITIES
   ============================================================================ */

/* Gradient text utilities from custom.css */
.text-gradient-primary {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-gradient-secondary {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Background gradient utilities */
.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-secondary { background: var(--gradient-secondary); }
.bg-gradient-success { background: var(--gradient-success); }
.bg-gradient-warm { background: var(--gradient-warm); }
.bg-gradient-cool { background: var(--gradient-cool); }

/* ============================================================================
   SHADOW UTILITIES
   ============================================================================ */

/* Shadow utilities from custom.css */
.shadow-glow { box-shadow: var(--shadow-glow); }
.shadow-glow-purple { box-shadow: var(--shadow-glow-purple); }

/* ============================================================================
   BORDER UTILITIES
   ============================================================================ */

/* Border gradient utility from custom.css */
.border-gradient {
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box, var(--gradient-primary) border-box;
}

html.dark .border-gradient {
  background: linear-gradient(var(--color-dark-surface), var(--color-dark-surface)) padding-box, var(--gradient-primary) border-box;
}

/* ============================================================================
   HOVER UTILITIES
   ============================================================================ */

/* Hover utilities from custom.css */
.hover-lift {
  transition: transform var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-scale {
  transition: transform var(--transition-base);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* ============================================================================
   ICON SIZE SYSTEM
   ============================================================================ */

/* Comprehensive solution for consistent icon sizing across the application */

/* Universal icon sizing utility */
.icon-size-override {
  width: var(--size) !important;
  height: var(--size) !important;
  min-width: var(--size) !important;
  min-height: var(--size) !important;
  max-width: var(--size) !important;
  max-height: var(--size) !important;
}

/* Specific Tailwind class overrides for SVG elements */
svg.w-3.h-3, svg.w-3, svg.h-3 { --size: var(--icon-xs); }
svg.w-4.h-4, svg.w-4, svg.h-4 { --size: var(--icon-sm); }
svg.w-5.h-5, svg.w-5, svg.h-5 { --size: var(--icon-base); }
svg.w-6.h-6, svg.w-6, svg.h-6 { --size: var(--icon-lg); }
svg.w-8.h-8, svg.w-8, svg.h-8 { --size: var(--icon-xl); }
svg.w-10.h-10, svg.w-10, svg.h-10 { --size: var(--icon-2xl); }

/* Apply the override using the custom property */
svg[class*="w-"][class*="h-"] {
  width: var(--size, inherit) !important;
  height: var(--size, inherit) !important;
  min-width: var(--size, inherit) !important;
  min-height: var(--size, inherit) !important;
  max-width: var(--size, inherit) !important;
  max-height: var(--size, inherit) !important;
}

/* Utility class overrides for non-SVG elements */
.w-3 { width: var(--icon-xs) !important; }
.h-3 { height: var(--icon-xs) !important; }
.w-4 { width: var(--icon-sm) !important; }
.h-4 { height: var(--icon-sm) !important; }
.w-5 { width: var(--icon-base) !important; }
.h-5 { height: var(--icon-base) !important; }
.w-6 { width: var(--icon-lg) !important; }
.h-6 { height: var(--icon-lg) !important; }
.w-8 { width: var(--icon-xl) !important; }
.h-8 { height: var(--icon-xl) !important; }
.w-10 { width: var(--icon-2xl) !important; }
.h-10 { height: var(--icon-2xl) !important; }

/* Reset for unspecified SVGs */
svg:not([width], [height], [class*="w-"], [class*="h-"]) {
  width: auto !important;
  height: auto !important;
}

/* Specific override for Location & Photos heading icon */
.wizard-step header h2 svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

/* Navigation specific icon inheritance */
.dropdown-button svg,
nav svg,
#user-menu-button svg {
  width: inherit !important;
  height: inherit !important;
}

/* Checkbox sizing (ensure it doesn't affect SVGs) */
input[type="checkbox"]:not(svg) {
  width: 16px !important;
  height: 16px !important;
}

.spot-type-checkbox {
  width: 16px !important;
  height: 16px !important;
}

/* ============================================================================
   REMOVE NUMBER INPUT SPINNER BUTTONS
   ============================================================================ */

/* Remove spinner buttons from number inputs - WebKit browsers (Chrome, Safari, Edge) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  margin: 0;
}

/* Remove spinner buttons from number inputs - Firefox */
input[type="number"] {
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ============================================================================
   LISTSPOT UNIFIED ACCESSIBILITY STYLES
   ============================================================================ */

/* Skip Link for keyboard navigation */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  z-index: 9999;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--primary-color);
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 600;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  /* Enhanced contrast support for listspot unified components */
  .skip-link:focus {
    outline: 3px solid currentColor;
    outline-offset: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .mobile-step-dot,
  .mobile-back-btn {
    transition: none;
  }
}
