/**
 * PERFORMANCE OPTIMIZATION CSS
 * Optimierungen für schwache Geräte
 *
 * @fileoverview CSS-Optimierungen für bessere Performance auf schwachen Geräten
 * @version 20250201
 */

/* Deaktiviere Animationen komplett auf schwachen Geräten */
[data-low-end="true"] *,
[data-low-end="true"] *::before,
[data-low-end="true"] *::after {
  animation: none !important;
  animation-duration: 0s !important;
  animation-iteration-count: 1 !important;
  animation-delay: 0s !important;
  transition: none !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

/* Reduziere Parallax-Effekte auf schwachen Geräten */
[data-low-end="true"] .hero {
  --hero-bg-shift: 0px;
  --hero-man-shift: 0px;
  --hero-content-shift: 0px;
}

/* GPU-Beschleunigung für kritische Elemente (nur auf starken Geräten) */
[data-performance="high"] .hero {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Deaktiviere will-change auf schwachen Geräten (spart Ressourcen) */
/* AUSNAHME: Glasplatte und Sonnenaufgang behalten will-change für bessere Performance */
[data-low-end="true"] *:not(#glass-overlay):not(#sunrise-overlay),
[data-low-end="true"] *:not(#glass-overlay):not(#sunrise-overlay)::before,
[data-low-end="true"] *:not(#glass-overlay):not(#sunrise-overlay)::after {
  will-change: auto !important;
}

/* Deaktiviere Filter-Effekte komplett auf schwachen Geräten */
/* AUSNAHME: Glasplatte und Sonnenaufgang bleiben aktiv */
[data-low-end="true"] *:not(#glass-overlay):not(#sunrise-overlay),
[data-low-end="true"] *:not(#glass-overlay):not(#sunrise-overlay)::before,
[data-low-end="true"] *:not(#glass-overlay):not(#sunrise-overlay)::after {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Reduziere Box-Shadow auf schwachen Geräten */
[data-low-end="true"] .glass-card,
[data-low-end="true"] .sidebar-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Optimiere Scroll-Performance */
[data-low-end="true"] {
  scroll-behavior: auto;
}

/* Reduziere komplexe CSS-Selektoren auf schwachen Geräten */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
