/* Lena Manga — anime-style theme */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(168,85,247,0.35); }
  50% { box-shadow: 0 0 22px rgba(236,72,153,0.55); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeInUp 0.35s ease-out both; }

/* Gradient text for headings/logo */
.text-gradient {
  background: linear-gradient(90deg, #a855f7, #ec4899, #22d3ee);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

/* Glass header */
.glass-header {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(11, 11, 23, 0.72);
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
}
.dark .glass-header { background: rgba(11, 11, 23, 0.72); }
html:not(.dark) .glass-header {
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

/* Manga card */
.manga-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30,27,55,0.6), rgba(15,13,30,0.9));
  border: 1px solid rgba(168,85,247,0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
html:not(.dark) .manga-card {
  background: #ffffff;
  border: 1px solid rgba(168,85,247,0.12);
}
.manga-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(236,72,153,0.6);
  box-shadow: 0 12px 30px -8px rgba(168,85,247,0.45);
}
.manga-card .cover-wrap { position: relative; overflow: hidden; }
.manga-card .cover-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}
.manga-card img { transition: transform 0.4s ease; }
.manga-card:hover img { transform: scale(1.08); }

/* Pill badges */
.badge {
  font-size: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-ongoing { background: linear-gradient(90deg,#22d3ee,#3b82f6); color: #fff; }
.badge-completed { background: linear-gradient(90deg,#22c55e,#16a34a); color: #fff; }
.badge-genre {
  background: rgba(168,85,247,0.12);
  color: #c084fc;
  border: 1px solid rgba(168,85,247,0.3);
}
html:not(.dark) .badge-genre { color: #9333ea; background: rgba(168,85,247,0.08); }

/* Gradient action button */
.btn-primary {
  background: linear-gradient(90deg, #a855f7, #ec4899);
  color: white;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  transition: filter 0.2s ease, transform 0.15s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }

.btn-ghost {
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(168,85,247,0.35);
  background: rgba(168,85,247,0.06);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-ghost:hover { background: rgba(168,85,247,0.16); border-color: rgba(236,72,153,0.5); }
.btn-ghost.active {
  background: linear-gradient(90deg, #a855f7, #ec4899);
  color: white; border-color: transparent;
}

/* Fav star glow */
.fav-btn {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  transition: transform 0.15s ease, background 0.2s ease;
}
.fav-btn:hover { transform: scale(1.15); background: rgba(236,72,153,0.75); }
.fav-btn.is-fav { animation: glowPulse 2s ease-in-out infinite; }

/* Hero banner on home */
.hero-banner {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, rgba(168,85,247,0.35), transparent 55%),
              radial-gradient(circle at 80% 30%, rgba(236,72,153,0.3), transparent 55%),
              radial-gradient(circle at 50% 90%, rgba(34,211,238,0.25), transparent 55%),
              #12101f;
  border: 1px solid rgba(168,85,247,0.25);
}

/* Section divider with glow line */
.section-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
}
.section-title::before {
  content: '';
  width: 5px; height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg,#a855f7,#ec4899);
  display: inline-block;
}

/* Reader area — dark immersive */
.reader-shell { background: #05040a; }
.reader-topbar {
  background: rgba(10,8,20,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(168,85,247,0.25);
}
.reader-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 8px;
  color: #e9d5ff;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,#a855f7,#ec4899);
  border-radius: 999px;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, rgba(168,85,247,0.08) 25%, rgba(236,72,153,0.15) 37%, rgba(168,85,247,0.08) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 0.75rem;
}

/* Ad slot styling — clearly separated, low visual weight */
.ad-slot {
  border: 1px dashed rgba(168,85,247,0.35);
  border-radius: 12px;
  color: rgba(168,85,247,0.55);
  background: rgba(168,85,247,0.03);
}

/* Search input focus glow */
.search-input:focus {
  outline: none;
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236,72,153,0.25);
}

/* Toast notifications */
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  background: rgba(15,13,30,0.95);
  color: #f3e8ff;
  border: 1px solid rgba(168,85,247,0.4);
  box-shadow: 0 8px 24px -6px rgba(168,85,247,0.5);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-success { border-color: rgba(34,197,94,0.5); }
.toast-error { border-color: rgba(239,68,68,0.5); }

/* Accessibility: visible focus rings everywhere (keyboard nav) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #ec4899;
  outline-offset: 2px;
  border-radius: 6px;
}

/* Skip link for keyboard/screen-reader users */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: #ec4899;
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Smooth SPA route transitions */
#app {
  transition: opacity 0.18s ease, transform 0.22s ease;
  opacity: 1;
  transform: translateY(0);
}
#app.route-leaving { opacity: 0; transform: translateY(6px); }
#app.route-entering { opacity: 0; transform: translateY(-6px); }
