/**
 * SUMA Center - Centralized Hover System
 * Global hover effects following DRY principles
 */

/* ========================================
   CSS CUSTOM PROPERTIES FOR HOVER EFFECTS
   ======================================== */
:root {
  /* Hover Transitions */
  --hover-transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --hover-transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --hover-transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Hover Transforms */
  --hover-lift-small: translateY(-4px);
  --hover-lift-medium: translateY(-8px);
  --hover-lift-large: translateY(-12px);
  --hover-scale-small: scale(1.02);
  --hover-scale-medium: scale(1.05);
  --hover-scale-large: scale(1.1);
  
  /* Hover Shadows */
  --hover-shadow-small: 0 8px 25px rgba(227, 30, 36, 0.15);
  --hover-shadow-medium: 0 12px 40px rgba(227, 30, 36, 0.2);
  --hover-shadow-large: 0 20px 60px rgba(227, 30, 36, 0.25);
  --hover-shadow-neutral: 0 8px 32px rgba(0, 0, 0, 0.12);
  --hover-shadow-neutral-large: 0 20px 60px rgba(0, 0, 0, 0.25);
  
  /* Hover Colors */
  --hover-bg-light: rgba(255, 255, 255, 0.98);
  --hover-bg-overlay: rgba(227, 30, 36, 0.1);
  --hover-border-color: rgba(227, 30, 36, 0.3);
}

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

/* Lift Effects */
.hover-lift-sm {
  transition: transform var(--hover-transition-normal), box-shadow var(--hover-transition-normal);
}
.hover-lift-sm:hover {
  transform: var(--hover-lift-small);
  box-shadow: var(--hover-shadow-small);
}

.hover-lift-md {
  transition: transform var(--hover-transition-normal), box-shadow var(--hover-transition-normal);
}
.hover-lift-md:hover {
  transform: var(--hover-lift-medium);
  box-shadow: var(--hover-shadow-medium);
}

.hover-lift-lg {
  transition: transform var(--hover-transition-normal), box-shadow var(--hover-transition-normal);
}
.hover-lift-lg:hover {
  transform: var(--hover-lift-large);
  box-shadow: var(--hover-shadow-large);
}

/* Scale Effects */
.hover-scale-sm {
  transition: transform var(--hover-transition-normal);
}
.hover-scale-sm:hover {
  transform: var(--hover-scale-small);
}

.hover-scale-md {
  transition: transform var(--hover-transition-normal);
}
.hover-scale-md:hover {
  transform: var(--hover-scale-medium);
}

.hover-scale-lg {
  transition: transform var(--hover-transition-normal);
}
.hover-scale-lg:hover {
  transform: var(--hover-scale-large);
}

/* Combined Effects */
.hover-lift-scale-sm {
  transition: all var(--hover-transition-normal);
}
.hover-lift-scale-sm:hover {
  transform: var(--hover-lift-small) var(--hover-scale-small);
  box-shadow: var(--hover-shadow-small);
}

.hover-lift-scale-md {
  transition: all var(--hover-transition-normal);
}
.hover-lift-scale-md:hover {
  transform: var(--hover-lift-medium) var(--hover-scale-medium);
  box-shadow: var(--hover-shadow-medium);
}

.hover-lift-scale-lg {
  transition: all var(--hover-transition-normal);
}
.hover-lift-scale-lg:hover {
  transform: var(--hover-lift-large) var(--hover-scale-large);
  box-shadow: var(--hover-shadow-large);
}

/* Glow Effects */
.hover-glow-sm {
  transition: box-shadow var(--hover-transition-normal);
}
.hover-glow-sm:hover {
  box-shadow: 0 0 20px rgba(227, 30, 36, 0.3);
}

.hover-glow-md {
  transition: box-shadow var(--hover-transition-normal);
}
.hover-glow-md:hover {
  box-shadow: 0 0 30px rgba(227, 30, 36, 0.4);
}

.hover-glow-lg {
  transition: box-shadow var(--hover-transition-normal);
}
.hover-glow-lg:hover {
  box-shadow: 0 0 40px rgba(227, 30, 36, 0.5);
}

/* Tilt Effects */
.hover-tilt-sm {
  transition: transform var(--hover-transition-normal);
}
.hover-tilt-sm:hover {
  transform: perspective(1000px) rotateX(1deg) rotateY(-1deg);
}

.hover-tilt-md {
  transition: transform var(--hover-transition-normal);
}
.hover-tilt-md:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
}

/* Background Effects */
.hover-bg-light {
  transition: background-color var(--hover-transition-normal);
}
.hover-bg-light:hover {
  background-color: var(--hover-bg-light);
}

.hover-bg-overlay {
  transition: background-color var(--hover-transition-normal);
}
.hover-bg-overlay:hover {
  background-color: var(--hover-bg-overlay);
}

/* Opacity Effects */
.hover-opacity-80 {
  transition: opacity var(--hover-transition-normal);
}
.hover-opacity-80:hover {
  opacity: 0.8;
}

.hover-opacity-90 {
  transition: opacity var(--hover-transition-normal);
}
.hover-opacity-90:hover {
  opacity: 0.9;
}

/* ========================================
   COMPONENT-SPECIFIC HOVER CLASSES
   ======================================== */

/* Card Hover Effects */
.smg-card-hover {
  transition: all var(--hover-transition-normal);
  will-change: transform, box-shadow, background;
}
.smg-card-hover:hover {
  transform: var(--hover-lift-medium) var(--hover-scale-small);
  box-shadow: var(--hover-shadow-neutral-large);
  background: var(--hover-bg-light);
}

/* Button Hover Effects */
.smg-btn-hover {
  transition: all var(--hover-transition-normal);
  position: relative;
  overflow: hidden;
}
.smg-btn-hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
  z-index: 1;
}
.smg-btn-hover:hover::before {
  left: 100%;
}
.smg-btn-hover:hover {
  transform: var(--hover-lift-small);
  box-shadow: var(--hover-shadow-medium);
}

/* Hero Card Hover Effects */
.smg-hero-card-hover {
  transition: all var(--hover-transition-normal);
  will-change: transform, box-shadow, background, z-index;
}
.smg-hero-card-hover:hover {
  transform: var(--hover-lift-large) var(--hover-scale-medium);
  box-shadow: var(--hover-shadow-neutral-large);
  background: var(--hover-bg-light);
  z-index: 10;
  animation-play-state: paused;
}

/* Widget Container Hover Effects */
.smg-widget-hover {
  transition: all var(--hover-transition-slow);
}
.smg-widget-hover:hover::before {
  animation-duration: 15s;
  opacity: 1;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Performance hints for hover elements */
.hover-lift-sm,
.hover-lift-md,
.hover-lift-lg,
.hover-scale-sm,
.hover-scale-md,
.hover-scale-lg,
.hover-lift-scale-sm,
.hover-lift-scale-md,
.hover-lift-scale-lg,
.smg-card-hover,
.smg-btn-hover,
.smg-hero-card-hover {
  will-change: transform;
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reset will-change on hover end for performance */
.hover-lift-sm:not(:hover),
.hover-lift-md:not(:hover),
.hover-lift-lg:not(:hover),
.hover-scale-sm:not(:hover),
.hover-scale-md:not(:hover),
.hover-scale-lg:not(:hover),
.hover-lift-scale-sm:not(:hover),
.hover-lift-scale-md:not(:hover),
.hover-lift-scale-lg:not(:hover),
.smg-card-hover:not(:hover),
.smg-btn-hover:not(:hover),
.smg-hero-card-hover:not(:hover) {
  will-change: auto;
}

/* ========================================
   ACCESSIBILITY & REDUCED MOTION
   ======================================== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .hover-lift-sm:hover,
  .hover-lift-md:hover,
  .hover-lift-lg:hover,
  .hover-scale-sm:hover,
  .hover-scale-md:hover,
  .hover-scale-lg:hover,
  .hover-lift-scale-sm:hover,
  .hover-lift-scale-md:hover,
  .hover-lift-scale-lg:hover,
  .smg-card-hover:hover,
  .smg-btn-hover:hover,
  .smg-hero-card-hover:hover {
    transform: none;
    transition: box-shadow var(--hover-transition-fast), background-color var(--hover-transition-fast);
  }
  
  .hover-tilt-sm:hover,
  .hover-tilt-md:hover {
    transform: none;
  }
}

/* Focus states for accessibility */
.hover-lift-sm:focus-visible,
.hover-lift-md:focus-visible,
.hover-lift-lg:focus-visible,
.hover-scale-sm:focus-visible,
.hover-scale-md:focus-visible,
.hover-scale-lg:focus-visible,
.smg-card-hover:focus-visible,
.smg-btn-hover:focus-visible,
.smg-hero-card-hover:focus-visible {
  outline: 2px solid var(--suma-600);
  outline-offset: 2px;
}
