/* ============================================================
   TORONITES CUSTOM FIXES (added separately, does not touch pub.min.css)
   ============================================================ */

/* ---------- 0. Menu button: keep plain icon look after removing npd/lnk/aa-lnk classes ---------- */
.hd .menu-btn.btn {
  background-color: transparent;
  padding: 0;
  min-width: auto;
  color: inherit;
}
.hd .menu-btn.btn:hover { background-color: transparent; color: var(--primary); }


.hd .search.on,
.hd .search { z-index: 20; }
.hd .search input {
  color: var(--light);
  background-color: rgba(20, 20, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.hd .search input::placeholder { color: var(--light-3); opacity: 1; }
.hd .search button.btn { color: var(--light) !important; opacity: .8; }
@media (max-width: 991px) {
  .hd .search.on { background-color: transparent; padding: .5rem 0; }
}

/* ---------- 2. Watch History image size fix (desktop) ---------- */
@media (min-width: 992px) {
  #watch-history-grid.post-lst { display: flex; flex-wrap: wrap; }
  #watch-history-grid.post-lst > li {
    flex: 0 0 calc(100% / 6);
    max-width: calc(100% / 6);
  }
  #watch-history-grid .post-thumbnail figure { padding-bottom: 140%; }
}
@media (min-width: 1600px) {
  #watch-history-grid.post-lst > li {
    flex: 0 0 calc(100% / 8);
    max-width: calc(100% / 8);
  }
}
#watch-history-grid .post.movies .entry-title {
  font-size: .8rem;
  line-height: 1.1rem;
}

/* ---------- 3. Network & Language homepage widgets (matches animesalt.cx reference) ---------- */
.aa-nl-widget { margin-bottom: 2.5rem; }
.aa-nl-widget .aa-nl-head {
  text-align: center;
  margin-bottom: 1rem;
  font-size: .95rem;
  color: var(--light-3);
}
.aa-nl-widget .aa-nl-head .aa-nl-active {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: .5rem;
  padding: .15rem .8rem;
  border-radius: 3rem;
  background-color: rgba(106, 61, 232, 0.25);
  border: 1px solid rgba(106, 61, 232, 0.4);
  color: var(--primary-light, var(--primary));
  font-weight: 700;
  font-size: .8rem;
}
.aa-nl-widget .aa-nl-active::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background-color: var(--secondary, var(--danger));
  display: inline-block;
}
.aa-nl-lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 2rem;
}
.aa-nl-lang-btn {
  background-color: rgba(20, 20, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: .6rem;
  color: var(--light);
  padding: .8rem .5rem;
  text-align: center;
  transition: .2s ease;
  position: relative;
  overflow: hidden;
}
.aa-nl-lang-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  color: var(--light);
}
.aa-nl-lang-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: rotate(45deg) translateX(-100%);
  transition: transform .5s ease;
  pointer-events: none;
}
.aa-nl-lang-btn:hover::after {
  transform: rotate(45deg) translateX(100%);
}
.aa-nl-lang-btn.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.aa-nl-lang-name { font-weight: 700; font-size: .9rem; margin-bottom: .1rem; }
.aa-nl-lang-native { font-size: .75rem; opacity: .65; }

/* Language selection overlay animation */
.aa-lang-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease;
}
.aa-lang-overlay.on { opacity: 1; visibility: visible; }
.aa-lang-overlay-content {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--gray-dark), #0a0a0a);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 22rem;
  width: 85%;
  transform: translateY(15px);
  opacity: 0;
  transition: all .4s ease-out;
}
.aa-lang-overlay.on .aa-lang-overlay-content { transform: translateY(0); opacity: 1; }
.aa-lang-overlay-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: .8rem;
  background: linear-gradient(to right, var(--primary-light, var(--primary)), var(--secondary, var(--danger)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.aa-lang-wave {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: .2rem;
  margin: 1rem auto;
  height: 40px;
}
.aa-lang-wave span {
  width: 4px;
  background-color: var(--primary);
  border-radius: 2px;
  animation: aa-lang-sound .8s linear infinite alternate;
}
.aa-lang-wave span:nth-child(1) { animation-delay: .1s; height: 15px; }
.aa-lang-wave span:nth-child(2) { animation-delay: .2s; height: 25px; }
.aa-lang-wave span:nth-child(3) { animation-delay: .3s; height: 35px; }
.aa-lang-wave span:nth-child(4) { animation-delay: .4s; height: 40px; }
.aa-lang-wave span:nth-child(5) { animation-delay: .5s; height: 30px; }
.aa-lang-wave span:nth-child(6) { animation-delay: .6s; height: 20px; }
.aa-lang-wave span:nth-child(7) { animation-delay: .7s; height: 10px; }
@keyframes aa-lang-sound {
  0% { transform: scaleY(.5); }
  100% { transform: scaleY(1); }
}
.aa-lang-overlay-selected { font-size: 1.4rem; font-weight: 700; margin-bottom: .8rem; }
.aa-lang-overlay-msg { font-size: .85rem; opacity: .7; }

.aa-nl-networks-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-underline-offset: .3rem;
}
.aa-nl-network-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  justify-items: center;
  gap: 1.2rem;
}
.aa-nl-network-item {
  width: 100%;
  max-width: 110px;
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  overflow: hidden;
  display: block;
  transition: transform .2s ease;
}
.aa-nl-network-item:hover { transform: translateY(-3px); }
.aa-nl-network-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
@media (max-width: 991px) {
  .aa-nl-network-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 575px) {
  .aa-nl-widget .aa-nl-head { font-size: .8rem; margin-bottom: .8rem; }
  .aa-nl-lang-grid { grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: 1.5rem; }
  .aa-nl-lang-btn { padding: .45rem .25rem; border-radius: .5rem; }
  .aa-nl-lang-name { font-size: .68rem; margin-bottom: .05rem; }
  .aa-nl-lang-native { font-size: .58rem; }
  .aa-nl-networks-title { font-size: 1rem; margin-bottom: 1rem; }
  .aa-nl-network-grid { grid-template-columns: repeat(4, 1fr); gap: .7rem; }
  .aa-nl-network-item { max-width: 80px; border-radius: .7rem; }
}

/* ---------- 8. /episode/ player: minor visual polish ---------- */
body.aa-episode-page .player.movie {
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4);
}
body.aa-episode-page .player.movie .video {
  aspect-ratio: 16 / 9;
  min-height: 0;
  height: auto;
  background-color: #000;
}
body.aa-episode-page .bx.options {
  background-color: var(--gray-dark);
}
body.aa-episode-page .bx-lst a.on {
  background-color: var(--primary);
  color: var(--dark);
}
body.aa-episode-page .episodes__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: .5rem;
  flex-wrap: wrap;
}
body.aa-episode-page .episodes__btn {
  font-size: .8rem;
}

.section.most-watched .section-title span.tag {
  font-size: .7rem;
  vertical-align: middle;
  margin-left: .5rem;
  padding: .1rem .6rem;
  border-radius: 3rem;
  background-color: var(--light-2);
  color: var(--light-3);
  font-weight: 400;
}

/* ---------- 5. Footer: Navigate A to Z ---------- */
.ft .atoz { padding: var(--fluid-s) 0; background-color: var(--gray-dark); }
.ft .atoz-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.ft .atoz-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ft .atoz-grid li { list-style: none; }
.ft .atoz-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: .3rem;
  background-color: var(--light-1);
  color: var(--light-3);
  font-weight: 700;
}
.ft .atoz-grid a:hover { background-color: var(--primary); color: var(--dark); }

/* ---------- 6. Bottom mobile navigation bar: replaced with the animesalt.cx
   style widget (self-contained markup + <style> printed directly in
   footer.php), so no rules are needed here anymore. ---------- */

/* ---------- 7. Episode page: hide top bar permanently, floating search only ---------- */
body.aa-episode-page .hd {
  display: none !important;
}
body.aa-episode-page .bd {
  padding-top: 1.5rem;
}
.aa-ep-search {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 998;
  display: flex;
  align-items: center;
}
.aa-ep-search-toggle {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background-color: rgba(20, 20, 25, 0.85);
  color: var(--light);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0;
  min-width: auto;
}
.aa-ep-search-form {
  width: 0;
  overflow: hidden;
  transition: width .25s ease;
  margin-left: 0;
}
.aa-ep-search.on .aa-ep-search-form {
  width: 14rem;
  margin-left: .5rem;
}
.aa-ep-search-form input {
  width: 14rem;
  border-radius: 2rem;
  background-color: rgba(20, 20, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--light);
}

/* Episode floating search live-results panel */
.aa-ep-search-form {
  position: relative;
}
.aa-ep-search-results {
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  width: 20rem;
  max-width: min(90vw, 20rem);
  max-height: 60vh;
  overflow: auto;
  display: none;
  z-index: 1000;
  background: rgba(15,15,18,.98);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .4rem;
  box-shadow: 0 1rem 3rem rgba(0,0,0,.45);
}
.aa-ep-search-results.on { display: block; }
.aa-ep-search-results a { display: block; }

@media (max-width: 575px) {
  .aa-ep-search.on .aa-ep-search-form { width: min(15rem, 72vw); }
  .aa-ep-search-form input { width: 100%; }
}

/* ---------- Hide swiper pagination dots + next/prev chevron arrows everywhere ---------- */
.swiper-pagination,
.swiper-pagination-bullets,
.swiper-pagination-clickable,
.swiper-pagination-horizontal {
  display: none !important;
}
.swiper-button-next,
.swiper-button-prev {
  display: none !important;
}

/* ---------- Hide the homepage genre-tab nav (Ongoing/Completed/Upcoming) ---------- */
.movies-tbs-nav.aa-tbs {
  display: none !important;
}

/* ---------- Card language badge (visible on thumbnail) ---------- */
.entry-meta .lang-badge {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: .35rem;
  margin-left: 0;
  padding: .15rem .5rem;
  background-color: rgba(147, 51, 234, 0.35);
  border: 1px solid rgba(147, 51, 234, 0.5);
  color: #fff;
  border-radius: 1rem;
  font-size: .65rem;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}

