/* SEO and Performance Optimization CSS */
/* Critical CSS for above-the-fold content */

/* Font optimization */
@font-face {
  font-family: "Inter";
  font-display: swap;
  src: url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap")
    format("woff2");
}

/* Critical rendering path optimizations */
.critical-content {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* Lazy loading styles */
.lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy.loaded {
  opacity: 1;
}

/* Performance optimizations for images */
img {
  max-width: 100%;
  height: auto;
  will-change: transform;
}

/* Optimize animations for performance */
@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;
  }
}

/* Print styles for better SEO */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
  }

  a {
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for better accessibility */
*:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #6366f1;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* Performance optimizations for large lists */
.game-list {
  contain: layout style paint;
}

/* Optimize for mobile performance */
@media (max-width: 768px) {
  .mobile-optimized {
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}

/* Reduce layout shift */
.aspect-ratio-box {
  position: relative;
  height: 0;
  overflow: hidden;
}

.aspect-ratio-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Optimize for Core Web Vitals */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* Reduce paint complexity */
.simple-transition {
  transition: opacity 0.3s ease, transform 0.3s ease;
  will-change: opacity, transform;
}

/* Optimize for Largest Contentful Paint (LCP) */
.hero-image {
  width: 100%;
  height: auto;
  max-width: 1200px;
  display: block;
}

/* Optimize for First Input Delay (FID) */
.interactive-element {
  touch-action: manipulation;
}

/* Optimize for Cumulative Layout Shift (CLS) */
.stable-layout {
  min-height: 200px;
  width: 100%;
}

/* Preload critical resources */
.preload-critical {
  font-display: swap;
}

/* Optimize for SEO-friendly loading */
.seo-friendly-loading {
  opacity: 0;
  animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Optimize for search engine crawlers */
.seo-content {
  color: #333;
  line-height: 1.6;
  font-size: 16px;
}

/* Schema.org friendly styling */
.schema-content {
  display: block;
  margin: 0;
  padding: 0;
}

/* Optimize for social media sharing */
.social-share-optimized {
  max-width: 1200px;
  max-height: 630px;
  object-fit: cover;
}

/* Performance monitoring styles */
.performance-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 9999;
  display: none;
}

/* Optimize for AMP compatibility */
.amp-compatible {
  max-width: 100%;
  height: auto;
}

/* Reduce bundle size optimizations */
.optimized-icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  fill: currentColor;
}

/* Critical CSS for above-the-fold content */
.above-the-fold {
  display: block;
  width: 100%;
  height: auto;
}

/* Optimize for mobile-first indexing */
.mobile-first {
  width: 100%;
  max-width: 100%;
}

/* SEO-friendly heading hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
  font-weight: 600;
  line-height: 1.2;
}

/* Optimize for voice search */
.voice-search-friendly {
  font-size: 16px;
  line-height: 1.5;
  color: #333;
}

/* Reduce JavaScript dependency */
.no-js-fallback {
  display: block;
}

.js-enabled .no-js-fallback {
  display: none;
}

/* Optimize for Core Web Vitals */
.web-vitals-optimized {
  contain: layout style paint;
  content-visibility: auto;
}

/* Reduce layout shift for images */
.image-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Optimize for search engine crawlers */
.crawler-friendly {
  text-indent: 0;
  white-space: normal;
  word-wrap: break-word;
}

/* Performance optimizations for animations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduce paint complexity for better performance */
.paint-optimized {
  transform: translateZ(0);
  will-change: transform;
}

/* Optimize for mobile performance */
.mobile-optimized {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* SEO-friendly loading states */
.loading-state {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
