.retro-font {
  font-family: "Press Start 2P", monospace;
}

.lazy-img {
  filter: blur(0);
  transition: opacity 0.3s ease-in-out;
  position: relative;
  z-index: 1;
}

.lazy-img:not(.loaded) {
  opacity: 0;
}

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

/* Hide skeleton loader when image is loaded */
.lazy-img.loaded+.skeleton-loader {
  display: none;
}

/* Error state for failed images */
.lazy-img.error {
  opacity: 0.7;
  background-color: #fee2e2;
  border: 1px solid #fecaca;
}

/* Mod image error handling */
.lazy-img.error.mod-logo {
  background: #fed7aa;
  border: 1px solid #fdba74;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lazy-img.error.mod-logo::after {
  content: '📱';
  font-size: 1.5em;
  opacity: 0.6;
}

/* Tldr image error handling */
.lazy-img.error.tldr-logo {
  background: #fed7aa;
  border: 1px solid #fdba74;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lazy-img.error.tldr-logo::after {
  content: '📱';
  font-size: 1.5em;
  opacity: 0.6;
}

/* Masonry Grid Styles */
.masonry-grid {
  columns: 1;
  column-gap: 1.5rem;
  margin: 0;
}

@media (max-width: 639px) {
  .masonry-grid {
    columns: 1;
  }
}

@media (min-width: 640px) {
  .masonry-grid {
    columns: 2;
  }
}

/* @media (min-width: 768px) {
  .masonry-grid {
    columns: 2;
  }
} */

@media (min-width: 1024px) {
  .masonry-grid {
    columns: 3;
  }
}

/* @media (min-width: 1280px) {
  .masonry-grid {
    columns: 3;
  }
} */

.masonry-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 1.5rem;
  break-inside: avoid;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #fed7aa;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  position: relative;
}

.masonry-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.masonry-item a {
  display: block;
  position: relative;
  text-decoration: none;
}

.meme-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  border-radius: 0.5rem;
}

.masonry-item:hover .meme-overlay {
  opacity: 1;
}

.meme-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.meme-detail-img {
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0.5rem;
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease-in-out;
}

.meme-detail-img:not(.loaded) {
  opacity: 0;
}

.meme-detail-img.loaded {
  opacity: 1;
}

.hentai-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  border-radius: 0.5rem;
}

.masonry-item:hover .hentai-overlay {
  opacity: 1;
}

.hentai-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hentai-detail-img {
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0.5rem;
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease-in-out;
}

.hentai-detail-img:not(.loaded) {
  opacity: 0;
}

.hentai-detail-img.loaded {
  opacity: 1;
}

.ecchi-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  border-radius: 0.5rem;
}

.masonry-item:hover .ecchi-overlay {
  opacity: 1;
}

.ecchi-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ecchi-detail-img {
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0.5rem;
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease-in-out;
}

.ecchi-detail-img:not(.loaded) {
  opacity: 0;
}

.ecchi-detail-img.loaded {
  opacity: 1;
}



.image-container {
  position: relative;
  min-height: 200px;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Detail Page Styles */
.image-container-detail {
  position: relative;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}





.aspect-square {
  aspect-ratio: 1;
  overflow: hidden;
}

.skeleton-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      #f1f5f9 0%,
      #e2e8f0 20%,
      #f1f5f9 40%,
      #f1f5f9 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.masonry-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease-in-out;
}

.masonry-img:not(.loaded) {
  opacity: 0;
}

.masonry-img.loaded {
  opacity: 1;
}

.masonry-img.loaded+.skeleton-loader {
  display: none;
}

/* Pagination Styles */
.pagination-info {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Loading state for pagination */
.pagination-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Error state for failed images */
.masonry-img.error {
  opacity: 0.7;
  background-color: #fee2e2;
  border: 1px solid #fecaca;
}

/* Responsive skeleton heights */
@media (max-width: 640px) {
  .image-container {
    min-height: 150px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .image-container {
    min-height: 180px;
  }
}

@media (min-width: 1025px) {
  .image-container {
    min-height: 200px;
  }
}

/* Enhanced skeleton loading animation */
.skeleton-loader::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e2e8f0;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {

  0%,
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.8);
  }

  50% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Cookie Consent Styles */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 20px;
  z-index: 10000;
  border-top: 3px solid #f97316;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.cookie-consent-banner.show {
  transform: translateY(0);
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cookie-consent-text h4 {
  margin: 0 0 8px 0;
  font-size: 1.2em;
  font-weight: 600;
  color: #f97316;
}

.cookie-consent-text p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.4;
  opacity: 0.9;
}

.cookie-consent-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: #f97316;
  color: white;
}

.cookie-btn-accept:hover {
  background: #ea580c;
  transform: translateY(-2px);
}

.cookie-btn-customize {
  background: transparent;
  color: #f97316;
  border: 2px solid #f97316;
}

.cookie-btn-customize:hover {
  background: #f97316;
  color: white;
}

.cookie-btn-reject {
  background: #6b7280;
  color: white;
}

.cookie-btn-reject:hover {
  background: #4b5563;
}

/* Cookie Modal Styles */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cookie-modal.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.cookie-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.cookie-modal-header h3 {
  margin: 0;
  font-size: 1.5em;
  color: #1f2937;
}

.cookie-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.cookie-close-btn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.cookie-modal-body {
  padding: 24px;
}

.cookie-category {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f3f4f6;
}

.cookie-category:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cookie-category-header h4 {
  margin: 0;
  font-size: 1.1em;
  color: #1f2937;
}

.cookie-required {
  background: #f3f4f6;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 500;
}

.cookie-category p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Cookie Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 12px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked+.cookie-slider {
  background-color: #f97316;
}

input:checked+.cookie-slider:before {
  transform: translateX(26px);
}

.cookie-modal-footer {
  padding: 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cookie-consent-content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .cookie-consent-buttons {
    justify-content: center;
  }

  .cookie-btn {
    flex: 1;
  }

  .cookie-modal-content {
    margin: 20px;
    max-height: calc(100vh - 40px);
  }

  .cookie-modal-footer {
    flex-direction: column;
  }

  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
}

/* Hide class for JavaScript */
.hidden {
  display: none !important;
}

/* Mod-specific styles */
.mod-logo-skeleton {
  background: linear-gradient(90deg,
      #fed7aa 0%,
      #fdba74 20%,
      #fed7aa 40%,
      #fed7aa 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Small logo skeleton loader */
.skeleton-loader.mod-small {
  border-radius: 0.375rem;
  /* rounded */
}

.skeleton-loader.mod-large {
  border-radius: 0.5rem;
  /* rounded-lg */
}

/* TLDR logo skeleton loader */
.tldr-logo-skeleton {
  background: linear-gradient(90deg,
      #fed7aa 0%,
      #fdba74 20%,
      #fed7aa 40%,
      #fed7aa 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Small logo skeleton loader */
.skeleton-loader.tldr-logo-small {
  border-radius: 0.375rem;
  /* rounded */
}

.skeleton-loader.tldr-logo-large {
  border-radius: 0.5rem;
  /* rounded-lg */
}