/* =========================================
   AnimeEXT — Index page styles
   ========================================= */

html,
body {
  overflow-x: hidden !important;
}

/* ── Page loader ── */
#loader {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  z-index: 9999;
  transition: opacity 0.6s ease;
}

#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

#loader.fade-once {
  opacity: 0;
  display: none;
  transition: opacity 0.5s ease;
}

#loader.fade-once.fade-in {
  opacity: 1;
  display: flex;
}

#loader.fade-once.fade-out {
  opacity: 0;
}

/* ── Loader visual: katana slash ── */
.loader-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: logoReveal 0.6s ease forwards;
  opacity: 0;
  animation-delay: 0.1s;
}

.loader-logo-text {
  font-family: var(--font-body);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.loader-logo-text span {
  color: var(--accent);
}

.loader-logo-sub {
  font-family: var(--font-jp);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
}

@keyframes logoReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress bar */
.loader-bar-wrap {
  width: 200px;
  height: 3px;
  background: var(--bg-4);
  border-radius: 999px;
  overflow: hidden;
  animation: logoReveal 0.4s ease 0.4s forwards;
  opacity: 0;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #58a6ff);
  border-radius: 999px;
  box-shadow: 0 0 8px var(--accent);
  transition: width 0.3s ease-out;
}

@keyframes loadProgress {
  0% {
    width: 0%;
  }

  40% {
    width: 55%;
  }

  70% {
    width: 75%;
  }

  90% {
    width: 92%;
  }

  100% {
    width: 100%;
  }
}

/* Three dots fallback */
.dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: dotBounce 1s infinite ease-in-out;
  display: none;
}

.dot:nth-child(2) {
  animation-delay: 0.18s;
}

.dot:nth-child(3) {
  animation-delay: 0.36s;
}

.dot:nth-child(4) {
  animation-delay: 0.54s;
}

@keyframes dotBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

/* ── Fade utilities ── */
.fade-out {
  animation: fadeOutAnim 0.35s forwards;
}

.fade-in {
  animation: fadeInAnim 0.35s forwards;
}

@keyframes fadeOutAnim {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes fadeInAnim {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
    visibility: visible;
  }
}

/* ── Page transition animations ── */
.slide-in-right {
  animation: slideInRight 0.4s ease forwards;
}

.slide-in-left {
  animation: slideInLeft 0.4s ease forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Card container (old class kept for compat) ── */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/* ── Home feed cards (últimos episodios) ── */
.anime-card-init {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    border-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.anime-card-init:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent);
  border-color: var(--accent);
}

.card-img {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 140px;
  object-fit: cover;
  display: block;
  transition: filter 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  color: transparent;
}

.anime-card-init:hover .card-img {
  filter: brightness(0.85);
  transform: scale(1.06);
}

.card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 36px 16px 16px;
  background: linear-gradient(to top, rgba(8, 12, 16, 0.98) 0%, rgba(8, 12, 16, 0.5) 65%, transparent 100%);
  z-index: 2;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 3px 0 0;
  font-weight: 500;
}

/* Long-press progress bar */
.longpress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 10;
  border-radius: 0 2px 2px 0;
}

/* ── Anime modal ── */
#animeModal {
  backdrop-filter: blur(10px);
  padding-left: 0;
}

/* ════════════════════════════════════════════════════
   FEATURED BANNER — SIN PIXELADO (usa imágenes de calidad)
   ════════════════════════════════════════════════════ */

.featured-banner {
  position: relative;
  min-height: 620px;
  margin-bottom: 48px;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  /* ← cambiado de "center" */
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.4s ease;
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

.featured-banner:hover {
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 217, 192, 0.15);
}

/* ── Halo de fondo (blur) ── */
.banner-blur {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  /* 🔥 BLUR MEJORADO */
  filter: blur(80px) brightness(0.2) saturate(1.2);
  transform: scale(1.1);
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.6s ease;
  /* 🔥 ANTI-PIXELADO */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.featured-banner:hover .banner-blur {
  opacity: 0.7;
}

.banner-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

.featured-banner:hover .banner-background {
  transform: scale(1.03) translateZ(0);
}

/* ── Gradiente mejorado ── */
.banner-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(135deg,
      rgba(8, 12, 16, 0.95) 0%,
      rgba(8, 12, 16, 0.85) 15%,
      rgba(8, 12, 16, 0.50) 40%,
      rgba(8, 12, 16, 0.20) 60%,
      rgba(8, 12, 16, 0.10) 75%,
      rgba(8, 12, 16, 0.40) 100%),
    linear-gradient(180deg,
      rgba(8, 12, 16, 0.05) 0%,
      transparent 30%,
      rgba(8, 12, 16, 0.95) 100%);
}

/* ── Brillo sutil en esquina ── */
.banner-background::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 20% 20%,
      rgba(0, 217, 192, 0.08) 0%,
      transparent 60%);
  pointer-events: none;
}

/* ── Contenido ── */
.banner-content {
  position: relative;
  z-index: 3;
  max-width: 680px;
  padding: 56px 48px 64px;
  /* ← más padding abajo (era 56px 48px) */
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: bannerFadeIn 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes bannerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Título ── */
.banner-title {
  font-family: var(--font-body);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.08;
  color: #fff;
  margin: 0;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 16px 48px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.02em;
  text-rendering: optimizeLegibility;
}

/* ── Highlight para palabras clave ── */
.banner-title .highlight {
  background: linear-gradient(135deg, var(--accent), #58a6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Meta info ── */
.banner-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
}

.banner-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

/* ── Badge de estado ── */
.banner-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 217, 192, 0.15);
  color: var(--accent);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 217, 192, 0.15);
}

.banner-status-badge.finalizado {
  background: rgba(255, 78, 100, 0.15);
  color: #ff4e64;
  border-color: rgba(255, 78, 100, 0.15);
}

.banner-status-badge i {
  font-size: 0.7rem;
}

/* ── Tags ── */
.banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.banner-tag {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.banner-tag:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* ── Descripción ── */
.banner-description {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  max-width: 90%;
}

/* ── Botones ── */
.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
}

.banner-actions .btn {
  padding: 14px 32px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  width: fit-content;
  position: relative;
  overflow: hidden;
}

/* ── Efecto shine en botones ── */
.banner-actions .btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.banner-actions .btn:hover::after {
  opacity: 1;
}

/* ── Botón primario (play) ── */
.banner-actions .btn-primary {
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%) !important;
  color: #0d1117 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.banner-actions .btn-primary:hover {
  background: linear-gradient(135deg, var(--accent) 0%, #00c4b0 100%) !important;
  color: var(--bg-0) !important;
  border-color: var(--accent) !important;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 32px rgba(0, 217, 192, 0.4) !important;
}

.banner-actions .btn-primary i {
  transition: transform 0.3s ease;
}

.banner-actions .btn-primary:hover i {
  transform: translateX(4px);
}

/* ── Botón secundario (info) ── */
.banner-actions .btn-outline-light {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(12px) !important;
}

.banner-actions .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.08) !important;
}

/* ════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .featured-banner {
    min-height: 380px;
    margin-left: -16px;
    margin-right: -16px;
    margin-top: -24px;
    border-radius: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  }

  .banner-background {
    border-radius: 0;
  }

  .banner-blur {
    border-radius: 0;
  }

  .banner-content {
    padding: 32px 24px;
    gap: 14px;
    max-width: 100%;
  }

  .banner-title {
    font-size: 2.2rem;
  }

  .banner-description {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
    max-width: 100%;
  }

  .banner-actions .btn {
    padding: 12px 24px;
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .featured-banner {
    min-height: 320px;
  }

  .banner-content {
    padding: 24px 20px;
  }

  .banner-title {
    font-size: 1.8rem;
  }

  .banner-meta {
    font-size: 0.78rem;
    gap: 6px;
  }

  .banner-description {
    font-size: 0.82rem;
    -webkit-line-clamp: 2;
  }

  .banner-tag {
    font-size: 0.7rem;
    padding: 3px 10px;
  }

  .banner-actions {
    gap: 10px;
  }

  .banner-actions .btn {
    padding: 10px 20px;
    font-size: 0.8rem;
  }
}