/* SEO Optimized CSS for Ragdoll Hit - 使用特定类名前缀避免冲突 */

/* Performance optimizations */
.seo-optimized * {
  box-sizing: border-box;
}

/* Critical CSS for above-the-fold content */
.seo-critical-content {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* Lazy loading for images */
.seo-lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

.seo-lazy.loaded {
  opacity: 1;
}

/* Accessible focus states - 只针对特定元素 */
.seo-focus:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content link for accessibility */
.seo-skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #3b82f6;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.seo-skip-link:focus {
  top: 6px;
}

/* SEO-friendly link styles - 只针对特定类 */
.seo-link {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.seo-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.seo-link:visited {
  color: #7c3aed;
}

/* Image optimization */
.seo-img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive images */
.seo-responsive-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Print styles for better SEO */
@media print {
  .seo-no-print {
    display: none !important;
  }

  .seo-print-content {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }

  .seo-print-content a {
    color: #000;
    text-decoration: underline;
  }

  .seo-print-content a[href]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }
}

/* Dark mode support for better accessibility */
@media (prefers-color-scheme: dark) {
  .seo-dark-mode {
    color: #f3f4f6;
    background-color: #1f2937;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .seo-high-contrast {
    text-decoration: underline;
  }

  .seo-high-contrast button {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .seo-reduced-motion,
  .seo-reduced-motion::before,
  .seo-reduced-motion::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* SEO-friendly grid system - 使用特定类名避免冲突 */
.seo-grid {
  display: grid;
  gap: 1rem;
}

.seo-grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .seo-grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .seo-grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .seo-grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Performance optimizations for animations */
.seo-animate-fade-in {
  animation: seoFadeIn 0.3s ease-in-out;
}

@keyframes seoFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading states for better UX */
.seo-loading {
  position: relative;
  overflow: hidden;
}

.seo-loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: seoLoading 1.5s infinite;
}

@keyframes seoLoading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* SEO-friendly button styles - 使用特定类名 */
.seo-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #3b82f6;
  color: white;
}

.seo-btn:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
}

.seo-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.seo-btn:active {
  transform: translateY(0);
}

/* Screen reader only content */
.seo-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;
}

/* SEO-friendly card styles - 使用特定类名 */
.seo-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.seo-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.seo-card-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.seo-card-body {
  padding: 1.5rem;
}

.seo-card-footer {
  padding: 1rem 1.5rem;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

/* SEO优化特定的工具类 */
.seo-text-optimized {
  line-height: 1.6;
  color: #374151;
}

.seo-heading-optimized {
  font-weight: 600;
  line-height: 1.3;
  color: #1f2937;
}

.seo-link-optimized {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.seo-link-optimized:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* 确保与Tailwind CSS兼容的样式 */
.seo-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .seo-container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .seo-container {
    padding: 0 2rem;
  }
}
