/* Performance Optimizations for SoftDecider */

/* 1. Reduce INP - Optimized Interaction Handling */
body {
  transform: translateZ(0);
  will-change: auto;
}

/* 2. FAQ accordion animations */
details > summary {
  cursor: pointer;
  list-style: none;
  transition: background-color 0.15s ease;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

details[open] > summary {
  margin-bottom: 0.5rem;
}

/* 3. Button interactions */
.cta-button,
.btn-primary,
.btn-secondary {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  will-change: transform, box-shadow;
}

.cta-button:active,
.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.98);
}

/* 4. Table interactions */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.table-responsive table {
  transform: translateZ(0);
  will-change: auto;
}

/* 5. Affiliate cards containment */
.AffiliateCard {
  contain: layout style paint;
}

/* 6. Mobile menu transitions */
@media (max-width: 768px) {
  .mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }
  .mobile-menu.open {
    transform: translateX(0);
  }
}

/* 7. Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 8. Critical CSS prioritization */
.critical-cta {
  contain: layout style;
  isolation: isolate;
}

/* 9. Component containment */
.comparison-table,
.faq-section,
.affiliate-card {
  contain: layout style;
}

/* 10. Link hover effects */
a {
  transition: color 0.1s ease, text-decoration 0.1s ease;
}

/* 11. Focus outlines */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* 12. Skip link optimization */
.skip-link {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #4f46e5;
  color: white;
  padding: 0.5rem 1rem;
  z-index: 10000;
  transition: top 0.1s ease;
  will-change: top;
}

.skip-link:focus {
  top: 0;
}