/* Custom Styles for Allo-Electricien.pro */

/* Leaflet Marker Cluster Customization */
.marker-cluster-small {
  background-color: rgba(0, 102, 255, 0.6);
}

.marker-cluster-small div {
  background-color: rgba(0, 102, 255, 0.8);
}

.marker-cluster-medium {
  background-color: rgba(255, 215, 0, 0.6);
}

.marker-cluster-medium div {
  background-color: rgba(255, 215, 0, 0.8);
}

.marker-cluster-large {
  background-color: rgba(255, 0, 0, 0.6);
}

.marker-cluster-large div {
  background-color: rgba(255, 0, 0, 0.8);
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.leaflet-popup-content {
  margin: 12px;
  font-family: 'Inter', sans-serif;
}

/* Smooth Transitions - Optimized for performance */
/* Only transition specific properties to avoid paint/layout issues */
a, button, input, select, textarea, .transition-all {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Skip transitions on page load */
.no-transition * {
  transition: none !important;
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus {
  outline: 2px solid #0066FF;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  nav,
  footer,
  #homepage-map,
  #map {
    display: none;
  }
}

/* Loading State */
.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #0066FF;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0052CC;
}

/* ========================================
   ENHANCED MICRO-INTERACTIONS (2025 UX)
   ======================================== */

/* Haptic-style Button Feedback */
.button,
button,
a[class*="btn"],
a[class*="cta"] {
  position: relative;
  overflow: hidden;
}

.button::after,
button::after,
a[class*="btn"]::after,
a[class*="cta"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
  pointer-events: none;
}

.button:active::after,
button:active::after,
a[class*="btn"]:active::after,
a[class*="cta"]:active::after {
  width: 300px;
  height: 300px;
  transition: width 0s, height 0s;
}

/* Elevation Shadows (Material Design Evolution) */
.elevation-1 { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08); }
.elevation-2 { box-shadow: 0 3px 6px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08); }
.elevation-3 { box-shadow: 0 10px 20px rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.10); }
.elevation-4 { box-shadow: 0 15px 25px rgba(0,0,0,0.15), 0 5px 10px rgba(0,0,0,0.10); }

/* Smooth State Transitions */
.hover-scale:hover {
  transform: scale(1.05);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Skeleton Loading Animation */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pulse Animation (Attention Grabber) */
.pulse {
  animation: pulse-animation 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-animation {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Shimmer Effect - DISABLED for performance */
/* Heavy animation causing layout recalculations removed */
.shimmer {
  position: relative;
  overflow: hidden;
  /* Shimmer animation disabled - too expensive for main-thread */
}

/* Magnetic Button Effect (Subtle) */
@media (hover: hover) {
  .magnetic {
    transition: transform 0.2s ease;
  }

  .magnetic:hover {
    transform: scale(1.02);
  }
}

/* ========================================
   THUMB-ZONE OPTIMIZATIONS (Mobile-First)
   ======================================== */

/* Safe Area Insets for Modern Devices */
@supports (padding: env(safe-area-inset-bottom)) {
  .safe-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .h-safe-bottom {
    height: env(safe-area-inset-bottom);
  }

  .safe-top {
    padding-top: env(safe-area-inset-top);
  }
}

/* Large Touch Targets (Min 44x44px) */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Bottom Navigation Bar (Thumb-Friendly) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 1000;
}

/* Floating Action Button (Thumb Zone) */
.fab {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.fab:active {
  transform: scale(0.95);
}

/* ========================================
   ADVANCED ANIMATIONS
   ======================================== */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Slide In From Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Rotate In */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

.rotate-in {
  animation: rotateIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   LOADING STATES & PROGRESS
   ======================================== */

/* Spinner */
.spinner {
  border: 3px solid rgba(0, 102, 255, 0.1);
  border-top-color: #0066FF;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-bar {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0066FF, #0052CC);
  animation: progress 2s ease-in-out;
}

@keyframes progress {
  from { width: 0%; }
  to { width: 100%; }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Focus Visible (Better than :focus) */
*:focus-visible {
  outline: 3px solid #0066FF;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor;
  }

  .button,
  button {
    border: 2px solid currentColor;
  }
}

/* ========================================
   GLASS MORPHISM (2025 Trend)
   ======================================== */

.glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   GRADIENT TEXT
   ======================================== */

.gradient-text {
  background: linear-gradient(135deg, #0066FF 0%, #00CCFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-emergency {
  background: linear-gradient(135deg, #FF0000 0%, #FF6600 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   CARD HOVER EFFECTS
   ======================================== */

.card-hover {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ========================================
   MOBILE-SPECIFIC OPTIMIZATIONS
   ======================================== */

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Improve tap highlight on iOS */
* {
  -webkit-tap-highlight-color: rgba(0, 102, 255, 0.1);
}

/* Smooth scroll on iOS */
.scroll-smooth {
  -webkit-overflow-scrolling: touch;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.backdrop-blur { backdrop-filter: blur(8px); }
.backdrop-blur-lg { backdrop-filter: blur(16px); }

.transition-fast { transition-duration: 150ms; }
.transition-base { transition-duration: 300ms; }
.transition-slow { transition-duration: 500ms; }

.ease-bounce { transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
.ease-smooth { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* No Select (for buttons/interactive elements) */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ========================================
   DARK MODE SUPPORT (Future-Ready)
   ======================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --text-primary: #ffffff;
    --border-color: #333333;
  }

  /* Enable when dark mode is implemented */
  /* body.dark-mode { ... } */
}

/* ========================================
   NAVBAR ENHANCEMENTS (5 Variants Support)
   ======================================== */

/* Sticky Navbar with Smooth Transitions */
nav.sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navbar Scroll Shadow Enhancement */
nav.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Navbar Hide on Scroll Down */
nav.hide-on-scroll {
  transform: translateY(-100%);
}

/* Navbar Show on Scroll Up */
nav.show-on-scroll {
  transform: translateY(0);
}

/* ========================================
   MEGA MENU STYLES (Variant 3)
   ======================================== */

.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.mega-menu.active,
.mega-menu-trigger:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Mega Menu Items Stagger Animation */
.mega-menu-item {
  opacity: 0;
  transform: translateX(-10px);
  animation: megaMenuItemSlide 0.3s ease-out forwards;
}

.mega-menu.active .mega-menu-item:nth-child(1) { animation-delay: 0.05s; }
.mega-menu.active .mega-menu-item:nth-child(2) { animation-delay: 0.1s; }
.mega-menu.active .mega-menu-item:nth-child(3) { animation-delay: 0.15s; }
.mega-menu.active .mega-menu-item:nth-child(4) { animation-delay: 0.2s; }
.mega-menu.active .mega-menu-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes megaMenuItemSlide {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   BOTTOM NAVIGATION (Variant 4)
   ======================================== */

/* Bottom Nav Ripple Effect */
.bottom-nav-item {
  position: relative;
  overflow: hidden;
}

.bottom-nav-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 102, 255, 0.15);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.bottom-nav-item:active::before {
  width: 100%;
  height: 100%;
}

/* Bottom Nav Icon Bounce */
.bottom-nav-item.active svg {
  animation: iconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ========================================
   GLASS MORPHISM NAVBAR (Variant 5)
   ======================================== */

/* Enhanced Glass Effect for Navbar */
.glass-navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.glass-navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Gradient Glow Effect */
.gradient-glow {
  position: relative;
}

.gradient-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, #0066FF, #00CCFF, #FF00FF, #0066FF);
  /* gradientRotate animation DISABLED - too expensive */
  /* background-size: 300% 300%; */
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(10px);
  /* animation: gradientRotate 4s ease infinite; DISABLED */
  transition: opacity 0.3s ease;
}

.gradient-glow:hover::after {
  opacity: 0.6;
}

/* @keyframes gradientRotate - DISABLED for performance */

/* ========================================
   MOBILE MENU ANIMATIONS
   ======================================== */

/* Slide-In from Right (Variant 1) */
.mobile-menu-slide-right {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-slide-right.active {
  transform: translateX(0);
}

/* Bottom Sheet (Variant 2) */
.mobile-menu-bottom-sheet {
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-menu-bottom-sheet.active {
  transform: translateY(0);
}

/* Full Screen Overlay (Variant 3) */
.mobile-menu-fullscreen {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-fullscreen.active {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer Menu (Variant 4) */
.drawer-menu {
  backdrop-filter: blur(0px);
  transition: backdrop-filter 0.3s ease;
}

.drawer-menu.active {
  backdrop-filter: blur(8px);
}

.drawer-menu .drawer-content {
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.drawer-menu.active .drawer-content {
  transform: translateY(0);
}

/* Glass Menu (Variant 5) */
.mobile-menu-glass {
  backdrop-filter: blur(0px);
  transition: backdrop-filter 0.5s ease, opacity 0.3s ease;
}

.mobile-menu-glass.active {
  backdrop-filter: blur(24px) saturate(180%);
}

/* ========================================
   HAMBURGER MENU TRANSFORMATIONS
   ======================================== */

/* Classic Hamburger to X */
.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: currentColor;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Morphing Hamburger */
.hamburger-morph {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hamburger-morph.active {
  transform: rotate(90deg);
}

/* Arrow Hamburger */
.hamburger-arrow .hamburger-line {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hamburger-arrow.active .hamburger-line:nth-child(1) {
  transform: translateX(-5px) rotate(-40deg);
}

.hamburger-arrow.active .hamburger-line:nth-child(3) {
  transform: translateX(-5px) rotate(40deg);
}

/* ========================================
   NAVBAR LOGO ANIMATIONS
   ======================================== */

/* Logo Fade In */
.logo-fade-in {
  animation: logoFadeIn 0.6s ease-out;
}

@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo Scale on Scroll */
.logo-scale-scroll {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav.scrolled .logo-scale-scroll {
  transform: scale(0.9);
}

/* Logo Glow Hover Effect */
.logo-glow-hover {
  position: relative;
  transition: filter 0.3s ease;
}

.logo-glow-hover::before {
  content: '';
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(0, 102, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.logo-glow-hover:hover::before {
  opacity: 1;
}

/* ========================================
   GRADIENT BORDERS & EFFECTS
   ======================================== */

/* Animated Gradient Border - DISABLED for performance */
.gradient-border-animated {
  position: relative;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(45deg, #0066FF, #00CCFF, #FF00FF, #0066FF) border-box;
  /* gradientBorderFlow animation DISABLED - too expensive */
  /* background-size: 300% 300%; */
  border: 2px solid transparent;
  border-radius: 8px;
  /* animation: gradientBorderFlow 4s ease infinite; DISABLED */
}

/* @keyframes gradientBorderFlow - DISABLED for performance */

/* Gradient Underline */
.gradient-underline {
  background: linear-gradient(90deg, #0066FF, #00CCFF, #FF00FF);
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gradient-underline.active,
a:hover .gradient-underline {
  transform: scaleX(1);
}

/* ========================================
   CTA BUTTON ENHANCEMENTS
   ======================================== */

/* Pulsing CTA Ring */
.cta-pulse-ring {
  position: relative;
}

.cta-pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid currentColor;
  border-radius: inherit;
  opacity: 0.6;
  animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseRing {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0;
  }
}

/* Gradient CTA with Shine - DISABLED for performance */
.cta-gradient-shine {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0066FF 0%, #00CCFF 100%);
}

/* Shine animation DISABLED - causes heavy layout recalculations */
/* .cta-gradient-shine::before removed for performance */

/* @keyframes shine - DISABLED for performance */

/* ========================================
   PARALLAX EFFECTS
   ======================================== */

/* Subtle Parallax on Scroll */
.parallax-navbar {
  transition: transform 0.1s ease-out;
}

/* Applied via JavaScript based on scroll position */
.parallax-navbar.scrolling {
  transform: translateY(-2px);
}

/* ========================================
   TRUST BADGES ANIMATIONS
   ======================================== */

/* Badge Float Animation */
.badge-float {
  animation: badgeFloat 3s ease-in-out infinite;
}

@keyframes badgeFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Badge Tooltip */
.badge-tooltip {
  position: relative;
}

.badge-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  padding: 6px 12px;
  background: #1a1a1a;
  color: white;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
}

.badge-tooltip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1a1a;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.badge-tooltip:hover::after,
.badge-tooltip:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   TOP BAR STYLES (Variant 2)
   ======================================== */

/* Top Bar Slide Animation */
.top-bar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-bar.hidden {
  transform: translateY(-100%);
}

/* Top Bar Stats Counter Animation */
.stat-counter {
  animation: countUp 1s ease-out;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   FAB (Floating Action Button) - Variant 4
   ======================================== */

/* FAB Extended (with label) */
.fab-extended {
  border-radius: 28px;
  padding: 0 20px;
  min-width: 56px;
  height: 56px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-extended:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* FAB Pulse for Emergency */
.fab-emergency-pulse {
  position: relative;
  animation: fabEmergencyBounce 2s ease-in-out infinite;
}

@keyframes fabEmergencyBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.fab-emergency-pulse::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 3px solid #DC2626;
  border-radius: 50%;
  animation: fabPulseWave 2s ease-out infinite;
  pointer-events: none;
}

@keyframes fabPulseWave {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ========================================
   SCROLL PROGRESS BAR
   ======================================== */

.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0066FF, #00CCFF);
  transform-origin: left;
  z-index: 10000;
  transition: transform 0.1s ease-out;
}

/* ========================================
   MOBILE-SPECIFIC NAVBAR ENHANCEMENTS
   ======================================== */

/* Prevent Scroll When Mobile Menu Open */
body.mobile-menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

/* Swipe Indicator for Drawer */
.swipe-indicator {
  width: 40px;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  margin: 12px auto 8px;
}

/* ========================================
   RESPONSIVE NAVBAR UTILITIES
   ======================================== */

/* Desktop Only */
@media (min-width: 1024px) {
  .mobile-only { display: none !important; }
}

/* Mobile Only */
@media (max-width: 1023px) {
  .desktop-only { display: none !important; }
}

/* Tablet Breakpoint */
@media (min-width: 768px) and (max-width: 1023px) {
  nav {
    padding: 0 20px;
  }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU Acceleration for Smooth Animations */
.gpu-accelerated,
nav,
.mobile-menu,
.mega-menu,
.fab,
.bottom-nav {
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

/* Prevent Layout Shift */
nav img {
  display: block;
}

/* ========================================
   NAVBAR VARIANT 4 (Mobile-First Bottom Nav)
   Only Variant 4 is used - Others removed for performance
   ======================================== */

/* Variant 4: Mobile-First Bottom Nav */
.navbar-v4 .bottom-nav-item.active {
  color: #0066FF;
}

/* Top Nav Smart Hide (Variant 4) */
.top-nav-v4.hide {
  transform: translateY(-100%);
}

/* Bottom Nav Item Transitions (Variant 4) */
.bottom-nav-item svg {
  transition: transform 0.2s ease;
}

.bottom-nav-item:active svg {
  transform: scale(0.9);
}

/* FAB Emergency Inline (Variant 4) */
.fab-emergency-inline {
  position: absolute;
  animation: fabBounceInline 2s ease-in-out infinite;
}

@keyframes fabBounceInline {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.fab-pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 3px solid #DC2626;
  border-radius: 50%;
  animation: pulseFab 2s ease-out infinite;
  pointer-events: none;
}

@keyframes pulseFab {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }
}

.fab-emergency-inline:active {
  transform: translateY(0) scale(0.95);
}

/* Drawer Menu (Variant 4) */
.drawer-menu-v4.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.drawer-menu-v4.active .drawer-content {
  transform: translateY(0);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Drawer Link Hover (Variant 4) */
.drawer-link {
  transition: all 0.2s ease;
}

.drawer-link:active {
  transform: scale(0.98);
}

/* Desktop Bottom Nav Hide (Variant 4) */
@media (min-width: 768px) {
  .bottom-nav-v4,
  .fab-emergency {
    display: none !important;
  }
}

/* Ripple Effect on Bottom Nav (Variant 4) */
.bottom-nav-item {
  position: relative;
  overflow: hidden;
}

.bottom-nav-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 102, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.bottom-nav-item:active::before {
  width: 100px;
  height: 100px;
}

/* Smooth Scroll (Global) */
html {
  scroll-behavior: smooth;
}

/* Prevent Body Scroll when Drawer Open (Variant 4) */
body.drawer-open {
  overflow: hidden;
}

/* WhatsApp Button Colors (Variant 4) */
.bg-whatsapp {
  background-color: #25D366;
}

.bg-whatsapp:hover {
  background-color: #1ea952;
}

/* ============================================
   Electrician Profile Card Enhancements
   ============================================ */

/* Fallback gradient for cards without images */
.electrician-card .fallback-gradient {
  background: linear-gradient(to bottom right, #dbeafe, #bfdbfe) !important;
}

.electrician-card .fallback-gradient img {
  display: none !important;
}

/* Card hover effects */
.electrician-card:hover .card-header-overlay {
  opacity: 0.85;
}

/* Smooth loading state for lazy images */
.electrician-card img[loading="lazy"] {
  background: linear-gradient(to bottom right, #eff6ff, #dbeafe);
}

/* Enhanced text shadow for better readability on images */
.electrician-card h3 {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Badge shadows for depth */
.electrician-card span[class*="bg-"] {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Smooth transitions */
.electrician-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .electrician-card h3 {
    font-size: 1.125rem;
    line-height: 1.5;
  }
}

/* Print styles */
@media print {
  .electrician-card .absolute {
    position: relative !important;
  }
}

/* ========================================
   SERVICE PAGES COMPREHENSIVE REDESIGN (2025)
   ======================================== */

/* Service Intro Accordion Styles */
.service-intro-accordion {
  transform-origin: top;
  animation: slideInDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-intro-accordion button[aria-expanded="true"] {
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
}

.service-intro-accordion [x-show] {
  overflow: hidden;
}

/* Alpine.js x-collapse support */
[x-cloak] {
  display: none !important;
}

/* Service Content Prose Styling */
.service-content {
  line-height: 1.75;
}

.service-content h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #000000;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.service-content h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.3;
  border-bottom: 3px solid #0066FF;
  padding-bottom: 0.5rem;
}

.service-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #374151;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.service-content p {
  margin-bottom: 1.25rem;
  color: #4b5563;
}

.service-content strong {
  font-weight: 600;
  color: #111827;
}

.service-content ul,
.service-content ol {
  margin: 1.5rem 0;
  padding-left: 1.75rem;
}

.service-content li {
  margin-bottom: 0.75rem;
  color: #4b5563;
}

.service-content a {
  color: #0066FF;
  text-decoration: underline;
  transition: color 0.2s;
}

.service-content a:hover {
  color: #0052CC;
}

/* Enhanced Feature Grid System */
.feature-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-grid.columns-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.feature-grid.columns-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.feature-card {
  position: relative;
  background: white;
  border-radius: 0.75rem;
  padding: 1.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.feature-card.color-blue {
  border-left-color: #0066FF;
}

.feature-card.color-red {
  border-left-color: #EF4444;
}

.feature-card.color-green {
  border-left-color: #10B981;
}

.feature-card.color-purple {
  border-left-color: #8B5CF6;
}

.feature-card-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: white;
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover .feature-card-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.feature-card.color-blue .feature-card-icon {
  background: white;
  color: #0066FF;
  border-color: #0066FF;
}

.feature-card.color-red .feature-card-icon {
  background: white;
  color: #EF4444;
  border-color: #EF4444;
}

.feature-card.color-green .feature-card-icon {
  background: white;
  color: #10B981;
  border-color: #10B981;
}

.feature-card.color-purple .feature-card-icon {
  background: white;
  color: #8B5CF6;
  border-color: #8B5CF6;
}

/* Enhanced Step Process with Progress Indicators */
.step-process {
  position: relative;
  margin: 2.5rem 0;
  padding: 0;
}

.step-item {
  position: relative;
  padding: 2rem;
  background: white;
  border-radius: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item:hover {
  transform: translateX(8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.step-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: white;
  font-weight: bold;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
  margin-right: 1rem;
}

.step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.step-content {
  margin-left: 3.5rem;
  color: #4b5563;
  line-height: 1.75;
}

/* Mobile optimization for steps */
@media (max-width: 768px) {
  .step-item {
    margin-left: 2rem;
    padding: 1.5rem;
  }

  .step-item::before {
    left: -32px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    line-height: 40px;
  }

  .step-content {
    margin-left: 0;
  }
}

/* Enhanced Pricing Tables */
.pricing-table {
  display: grid;
  gap: 2rem;
  margin: 2.5rem 0;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pricing-card {
  position: relative;
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid #e5e7eb;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.pricing-card.featured {
  border-color: #0066FF;
  background: linear-gradient(to bottom, #ffffff 0%, #eff6ff 100%);
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 10px 40px -5px rgba(0, 102, 255, 0.3);
}

.pricing-card.featured::before {
  content: 'Recommandé';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: white;
  padding: 0.375rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

.pricing-card.featured:hover {
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 25px 50px -12px rgba(0, 102, 255, 0.4);
}

.pricing-tier {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
}

.pricing-amount {
  font-size: 3rem;
  font-weight: 800;
  color: #0066FF;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.pricing-card.featured .pricing-amount {
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pricing-period {
  font-size: 0.875rem;
  color: #6b7280;
  text-transform: lowercase;
}

.pricing-features {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e5e7eb;
}

.pricing-cta {
  margin-top: 2rem;
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: white;
  font-weight: 600;
  border-radius: 0.5rem;
  text-align: center;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.pricing-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 102, 255, 0.4);
}

/* Mobile pricing table optimization */
@media (max-width: 768px) {
  .pricing-table {
    grid-template-columns: 1fr;
  }

  .pricing-card.featured {
    transform: scale(1);
  }

  .pricing-amount {
    font-size: 2.5rem;
  }
}

/* Enhanced FAQ Accordion */
.faq-accordion {
  margin: 2.5rem 0;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid #e5e7eb;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.5rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}

.faq-question:hover {
  background: #f9fafb;
  color: #0066FF;
}

.faq-question[aria-expanded="true"] {
  background: #eff6ff;
  color: #0066FF;
}

.faq-icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 2rem 1.5rem 2rem;
  color: #4b5563;
  line-height: 1.75;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Callout Boxes Enhancement */
.callout {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border-left: 4px solid;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.callout.type-info {
  border-left-color: #0066FF;
  background: linear-gradient(to right, #eff6ff 0%, #ffffff 100%);
}

.callout.type-success {
  border-left-color: #10B981;
  background: linear-gradient(to right, #f0fdf4 0%, #ffffff 100%);
}

.callout.type-warning {
  border-left-color: #F59E0B;
  background: linear-gradient(to right, #fffbeb 0%, #ffffff 100%);
}

.callout.type-error {
  border-left-color: #EF4444;
  background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
}

.callout-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout.type-info .callout-title {
  color: #0066FF;
}

.callout.type-success .callout-title {
  color: #10B981;
}

.callout.type-warning .callout-title {
  color: #F59E0B;
}

.callout.type-error .callout-title {
  color: #EF4444;
}

/* Enhanced Typography Scale */
.text-display {
  font-size: 3.75rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
}

.text-hero {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* Improved Focus Indicators for Accessibility */
.service-intro-accordion button:focus-visible,
.faq-question:focus-visible,
.pricing-cta:focus-visible {
  outline: 3px solid #0066FF;
  outline-offset: 3px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  .service-content {
    color: #e5e7eb;
  }

  .service-content h1,
  .service-content h2,
  .service-content h3 {
    color: #111112;
  }

  .feature-card,
  .step-item,
  .pricing-card,
  .faq-accordion {
    background: #f9f9f9;
  }
}

/* Print Optimization for Service Pages */
@media print {
  .service-intro-accordion button {
    display: none;
  }

  .service-intro-accordion [x-show] {
    display: block !important;
  }

  .pricing-cta {
    display: none;
  }

  .step-item:hover {
    transform: none;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .service-intro-accordion,
  .feature-card,
  .step-item,
  .pricing-card,
  .faq-question,
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced Mobile Experience */
@media (max-width: 640px) {
  .service-content h1 {
    font-size: 1.875rem;
  }

  .service-content h2 {
    font-size: 1.5rem;
  }

  .service-content h3 {
    font-size: 1.25rem;
  }

  .faq-question {
    padding: 1.25rem 1rem;
    font-size: 1rem;
  }

  .faq-answer {
    padding: 0 1rem 1.25rem 1rem;
  }
}

/* Loading States */
.service-content.loading {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Micro-interactions for Service Elements */
.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0066FF;
  transition: all 0.3s;
}

.service-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

/* Service Type Color Variants */
.service-type-emergency {
  --service-color: #EF4444;
  --service-bg: #FEF2F2;
  --service-border: #FEE2E2;
}

.service-type-planned {
  --service-color: #0066FF;
  --service-bg: #EFF6FF;
  --service-border: #DBEAFE;
}

.service-type-hybrid {
  --service-color: #8B5CF6;
  --service-bg: #FAF5FF;
  --service-border: #F3E8FF;
}


/* ========================================
   PERFORMANCE & CORE WEB VITALS OPTIMIZATIONS
   ======================================== */

/* Critical Rendering Path Optimization */
/* Prevent layout shifts (CLS) */
img, video, iframe {
  max-width: 100%;
  height: auto;
  aspect-ratio: attr(width) / attr(height);
}

/* Reserve space for images to prevent layout shift */
img[width][height] {
  height: auto;
}

/* Optimize font loading to prevent FOUT/FOIT */
.font-loaded body {
  font-family: 'Inter', sans-serif;
}

/* Reduce Repaints & Reflows */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Hardware Acceleration for Animations */
.hardware-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Lazy Loading Placeholder */
.lazy-load-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: lazy-loading 1.5s ease-in-out infinite;
}

@keyframes lazy-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Optimize Mobile Performance */
@media (max-width: 768px) {
  /* Disable hover effects on mobile */
  .hover\:scale-105:hover {
    transform: none;
  }

  /* Reduce animation complexity on mobile */
  .animate-pulse {
    animation: none;
    opacity: 1;
  }

  /* Optimize touch targets */
  button, a, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Optimize Print Styles */
@media print {
  .no-print,
  nav,
  .mobile-sticky-cta,
  .callback-form,
  .price-calculator,
  .before-after-gallery,
  footer {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: black;
    background: white;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a[href^="tel:"]:after {
    content: " (" attr(href) ")";
  }
}

/* Optimize Scroll Performance */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Optimize Input Delay (FID) */
input, select, textarea, button {
  touch-action: manipulation;
}

/* Content Visibility for Long Pages */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

/* Optimize Image Loading */
.image-loading {
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.image-loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: image-skeleton 1.5s ease-in-out infinite;
}

@keyframes image-skeleton {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Optimize Web Font Loading */
@font-face {
  font-family: 'Inter';
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Critical Above-the-Fold Styles */
.above-the-fold {
  contain: layout style;
}

/* Optimize Z-index Layers */
.z-layer-base { z-index: 1; }
.z-layer-dropdown { z-index: 10; }
.z-layer-sticky { z-index: 20; }
.z-layer-fixed { z-index: 30; }
.z-layer-modal-backdrop { z-index: 40; }
.z-layer-modal { z-index: 50; }
.z-layer-notification { z-index: 60; }

/* Intersection Observer Animations */
.fade-in-observe {
  opacity: 0;
  transform: translateY(20px);
}

.fade-in-observe.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Optimize Touch Interactions */
.touch-manipulation {
  touch-action: pan-y pinch-zoom;
}

/* Prevent Text Selection on UI Elements */
.no-select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Optimize Table Scrolling */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Performance Monitoring Debug */
.debug-performance {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px;
  border-radius: 5px;
  font-family: monospace;
  font-size: 12px;
  z-index: 9999;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* CRITICAL: Disable backdrop-filter on mobile devices
   backdrop-filter is extremely expensive on mobile GPUs
   and causes significant rendering performance issues.
   Only enable on desktop (1024px+) where it's less impactful. */
@media (max-width: 1023px) {
  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Fallback solid backgrounds for mobile */
  nav, .navbar, .nav-blur, .glass-effect, .mobile-menu {
    background-color: rgba(255, 255, 255, 0.95) !important;
  }

  .bg-dark, .navbar-dark {
    background-color: rgba(17, 24, 39, 0.95) !important;
  }
}

/* Enable content-visibility for better rendering performance */
.content-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

/* Optimize will-change usage - only apply when needed */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Remove will-change after animation completes */
@media (prefers-reduced-motion: no-preference) {
  .animated:not(:hover):not(:focus) {
    will-change: auto;
  }
}

/* ========================================
   BREADCRUMB & VIDEO TRANSCRIPT ENHANCEMENTS
   ======================================== */

/* Breadcrumb mobile optimization */
@media (max-width: 640px) {
  nav[aria-label="Breadcrumb"] {
    font-size: 14px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }

  nav[aria-label="Breadcrumb"]::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  nav[aria-label="Breadcrumb"] a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem;
  }
}

