/* Main Series archive modal — loaded on all pages from base.html */
.series-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.series-modal-overlay.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.series-modal {
  position: relative;
  width: min(380px, 100%);
  max-height: 85vh;
  background: rgba(10, 20, 40, 0.8);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.series-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 2;
}

.series-modal-close:hover {
  border-color: rgba(100, 200, 255, 0.5);
  color: #fff;
  box-shadow: 0 0 16px rgba(100, 200, 255, 0.4);
}

.series-modal-title {
  padding: 16px 40px 12px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200, 225, 255, 0.9);
  margin: 0;
}

.series-modal-body {
  max-height: calc(85vh - 70px);
  overflow-y: auto;
  padding: 0 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 160, 255, 0.25) transparent;
}

.series-modal-body::-webkit-scrollbar {
  width: 5px;
}

.series-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.series-modal-body::-webkit-scrollbar-thumb {
  background: rgba(100, 160, 255, 0.25);
  border-radius: 3px;
}

.series-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 160, 255, 0.4);
}

.series-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: stretch;
}

.series-list > li {
  width: 100%;
  min-width: 0;
}

.series-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s ease;
  cursor: default;
}

a.series-item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.series-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.series-covers {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  align-items: center;
}

.series-covers img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
              0 0 10px color-mix(in srgb, var(--series-neon, #6490ff) 20%, transparent);
  transition: box-shadow 0.25s ease;
}

.series-item:hover .series-covers img {
  box-shadow: 0 0 20px var(--series-neon, #6490ff),
              0 0 36px color-mix(in srgb, var(--series-neon, #6490ff) 40%, transparent);
}

.series-item-dual .series-covers img {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
              0 0 8px color-mix(in srgb, var(--series-neon) 15%, transparent),
              0 0 12px color-mix(in srgb, var(--series-neon-2) 15%, transparent);
}

.series-item-dual:hover .series-covers img {
  box-shadow: 0 0 16px var(--series-neon),
              0 0 28px var(--series-neon-2),
              0 0 40px color-mix(in srgb, var(--series-neon) 40%, var(--series-neon-2) 40%);
}

.series-item-dual:hover .series-name {
  text-shadow: 0 0 8px var(--series-neon), 0 0 14px var(--series-neon-2);
}

.series-name {
  margin-left: auto;
  min-width: 0;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(220, 235, 255, 0.85);
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.series-item:hover .series-name {
  color: #fff;
  text-shadow: 0 0 12px var(--series-neon, #6490ff);
}

/* Touch / mobile: no backdrop-filter (GPU), so use a solid scrim + nearly-opaque panel — page was too visible through glass */
@media (hover: none), (pointer: coarse) {
  .series-modal-overlay.is-open {
    background: rgba(2, 6, 18, 0.82);
  }

  .series-modal {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(6, 12, 28, 0.97);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
      0 24px 64px rgba(0, 0, 0, 0.65),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .series-item {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
  }
}
