body.anime-layout {
  background: radial-gradient(120% 120% at 50% 0%, rgba(0, 170, 255, 0.12), transparent 65%),
              radial-gradient(140% 140% at 0% 100%, rgba(0, 227, 205, 0.10), transparent 70%),
              linear-gradient(135deg, #101820 0%, #0b1218 100%);
  min-height: 100vh;
}

.anime-main {
  display: flex;
  justify-content: center;
  padding: 40px 20px 80px;
}

.anime-wrapper {
  width: 100%;
  max-width: 1100px;
  background: rgba(17, 24, 31, 0.85);
  border: 1px solid rgba(0, 227, 205, 0.16);
  border-radius: 20px;
  padding: 32px 40px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 170, 255, 0.08);
  backdrop-filter: blur(8px);
}

.anime-title {
  text-align: center;
  margin: 0 0 24px;
  font-size: 2.2rem;
  letter-spacing: 0.05em;
  color: #a8f0ff;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .anime-wrapper {
    padding: 28px 24px;
  }

  .anime-title {
    font-size: 1.6rem;
  }
}

/* Anime list gallery */
.anime-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.anime-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
  padding: 18px 18px 22px;
  background: linear-gradient(160deg, rgba(0, 227, 205, 0.10), rgba(0, 170, 255, 0.08) 40%, rgba(22, 27, 32, 0.9) 100%);
  border: 1px solid rgba(0, 227, 205, 0.18);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  box-sizing: border-box;
}

.anime-card::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 14px;
  border: 1px solid rgba(124, 231, 219, 0.12);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.anime-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.55);
  border-color: rgba(0, 227, 205, 0.35);
}

.anime-card:hover::after {
  opacity: 1;
}

.anime-card__image-wrapper {
  position: relative;
  width: 100%;
  max-width: 150px;
  margin: 0 auto;
  aspect-ratio: 210 / 297; /* A4 portrait */
  border-radius: 12px;
  overflow: hidden;
  background: rgba(12, 18, 22, 0.8);
  box-shadow: inset 0 0 0 1px rgba(0, 227, 205, 0.10);
  isolation: isolate;
}

.anime-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.anime-card:hover .anime-card__image {
  transform: scale(1.05);
}

.anime-card__title {
  margin-top: 16px;
  text-align: center;
  font-size: 1rem;
  line-height: 1.4;
  color: #e1f6ff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}

.anime-card__title::first-letter {
  color: #7ce7db;
}

details {
  margin-bottom: 1.5rem;
  border-left: 2px solid rgba(0, 227, 205, 0.2);
  padding-left: 1.5rem;
}

summary {
  cursor: pointer;
  font-size: 1.8rem;
  font-weight: 600;
  color: #a8f0ff;
  margin-bottom: 1rem;
  outline: none;
}

summary:focus-visible {
  outline: 2px solid #7ce7db;
  outline-offset: 4px;
}

summary:hover {
  color: #7ce7db;
}

.details-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.details-controls button {
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 227, 205, 0.35);
  background-color: transparent;
  color: #a8f0ff;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.details-controls button:hover {
  background-color: rgba(0, 227, 205, 0.1);
  color: #7ce7db;
}

.search-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: #a8f0ff;
  opacity: 0.7;
}

#anime-search {
  width: 50%;
  padding: 0.75rem 1rem 0.75rem 3rem; /* Add padding to the left for the icon */
  border: 1px solid rgba(0, 227, 205, 0.35);
  background-color: rgba(17, 24, 31, 0.85);
  color: #e1f6ff;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Add transition */
  box-sizing: border-box;
}

#anime-search:focus {
  outline: none;
  border-color: #7ce7db;
  box-shadow: 0 0 0 3px rgba(0, 227, 205, 0.2);
}

#anime-search::placeholder {
  color: #a8f0ff;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .anime-card {
    padding: 16px 16px 20px;
  }

  .anime-card__title {
    font-size: 0.95rem;
  }
}

html[data-theme="light"] body.anime-layout {
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(7, 95, 174, 0.09), transparent 65%),
    radial-gradient(140% 140% at 0% 100%, rgba(33, 143, 128, 0.08), transparent 70%),
    linear-gradient(135deg, #f6fafc 0%, #edf4f7 100%);
}

html[data-theme="light"] .anime-wrapper {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(33, 143, 128, 0.25);
  box-shadow: 0 18px 40px rgba(25, 45, 62, 0.14), inset 0 0 0 1px rgba(7, 95, 174, 0.06);
}

html[data-theme="light"] .anime-title,
html[data-theme="light"] .anime-card__title,
html[data-theme="light"] summary,
html[data-theme="light"] .details-controls button,
html[data-theme="light"] .search-icon {
  color: #075b68;
}

html[data-theme="light"] .anime-card {
  background: linear-gradient(160deg, rgba(72, 187, 170, 0.13), rgba(7, 95, 174, 0.07) 40%, #ffffff 100%);
  border-color: rgba(33, 143, 128, 0.28);
  box-shadow: 0 10px 24px rgba(25, 45, 62, 0.13);
}

html[data-theme="light"] .anime-card:hover {
  box-shadow: 0 18px 32px rgba(25, 45, 62, 0.18);
}

html[data-theme="light"] .anime-card__image-wrapper {
  background: #e7edf3;
}

html[data-theme="light"] .anime-card__title::first-letter,
html[data-theme="light"] summary:hover,
html[data-theme="light"] .details-controls button:hover {
  color: #075f54;
}

html[data-theme="light"] #anime-search {
  background: #ffffff;
  color: #1d2935;
}

html[data-theme="light"] #anime-search::placeholder {
  color: #5d6c7a;
}
