/* Site-wide mobile performance overrides
   Keep this lightweight and safe. Affects small screens only. */

/* 1) Prefer dynamic viewport units to reduce 100vh bugs (opt-in via utility) */
@supports (height: 100dvh) {
  .vh-100dvh { height: 100dvh !important; }
}

/* 2) Reduce motion and paints on mobile */
@media (max-width: 1024px) {
  /* Respect users who prefer reduced motion, and default to less motion on phones */
  *, *::before, *::after {
    transition: none !important;
  }

  /* Stop infinite/background animations that cause constant repaints */
  .animated,
  .animate,
  [class*="animate-"],
  [class*="-animate"],
  [class*="pulse"],
  [class*="spin"],
  [class*="blink"],
  [class*="marquee"],
  [style*="animation"],
  .login-page::before,
  .circuit-pattern,
  .login-card,
  .login-logo {
    animation: none !important;
  }

  /* Allow essential spinners (e.g., Font Awesome) to keep animating */
  .fa-spin { animation: fa-spin 1s linear infinite !important; }

  /* Backdrop blur is very expensive on mobile; remove across common surfaces */
  .glass,
  .glass-card,
  .login-panel,
  .login-card,
  .modal,
  .sheet,
  .drawer,
  .dropdown-panel,
  .sidebar,
  .panel,
  .card,
  [style*="backdrop-filter"] {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  /* Tame big shadows for cheaper composites */
  .card,
  .panel,
  .modal,
  .sheet,
  .dropdown-panel,
  .login-card {
    box-shadow: 0 4px 14px rgba(0,0,0,0.20) !important;
  }

  /* Help long feeds: skip rendering offscreen content where supported */
  img, video, .lazy-content { 
    content-visibility: auto; 
    contain-intrinsic-size: 1px 600px; /* reserve minimal space to avoid jumps */
  }
}

/* 3) Global reduced motion safety net (any device) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
