
/* ==========================================================================
   ZOKOANIME EMBED PLAYER UI
   ========================================================================== */

/* The wrap (not the iframe) owns fullscreen so episode swaps keep it. */
#player-wrap {
  aspect-ratio: 16 / 9;
  background: #000;
}

#player-wrap:fullscreen {
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
}

#player-wrap iframe {
  border: none;
  display: block;
  width: 100%;
  height: 100%;
}

/* Loading spinner over the player */
.zoko-player-spinner {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background: rgba(6, 7, 11, 0.72);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--text-sub, #b9bdc9);
}

.zoko-player-spinner[hidden] {
  display: none;
}

.zoko-spinner-ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(202, 233, 98, 0.18);
  border-top-color: var(--zoro-lime);
  animation: zoko-spin 0.9s linear infinite;
}

@keyframes zoko-spin {
  to { transform: rotate(360deg); }
}

/* Error / finished overlay */
.zoko-player-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(6, 7, 11, 0.86);
  backdrop-filter: blur(8px);
}

.zoko-player-overlay[hidden] {
  display: none;
}

.zoko-overlay-card {
  text-align: center;
  max-width: 460px;
  background: var(--bg-surface, #14161f);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.09));
  border-radius: 14px;
  padding: 1.6rem 1.9rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.zoko-overlay-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}

.zoko-overlay-card p {
  font-size: 0.875rem;
  color: var(--text-sub, #b9bdc9);
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

/* "Resumed from 12:34" note */
.zoko-resume-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--zoro-lime);
  background: rgba(202, 233, 98, 0.1);
  border: 1px solid rgba(202, 233, 98, 0.35);
}

.zoko-resume-note[hidden] {
  display: none;
}

/* Toasts */
.zoko-toasts {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}

.zoko-toast {
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: rgba(18, 20, 27, 0.94);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.09));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: zoko-toast-in 0.24s ease;
}

.zoko-toast-info {
  border-color: rgba(202, 233, 98, 0.45);
  color: var(--zoro-lime);
}

.zoko-toast-error {
  border-color: rgba(255, 96, 96, 0.55);
  color: #ff8f8f;
}

.zoko-toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s ease;
}

@keyframes zoko-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Track switcher + settings toggles */
.zoko-control-bar {
  gap: 0.75rem;
}

/* Server switcher (Zoko primary | TVplus backup | MegaPlay alternate).
   Compact enough to fit a 390px-wide screen: label + three pills, wraps
   with the bar. */
.zoko-server-bar {
  margin-top: 0.75rem;
  padding: 0.5rem 0.9rem;
  gap: 0.6rem;
}

.zoko-server-bar .zoko-bar-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.zoko-server-bar .server-pill {
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
}

/* Track pills / settings the backup player cannot serve: greyed, honest
   tooltip, and hover must NOT light them up like an active pill. */
.server-pill.is-disabled,
.server-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.server-pill.is-disabled:hover,
.server-pill:disabled:hover {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: inherit;
  box-shadow: none;
}

.zoko-toggle.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zoko-toggle.is-disabled input {
  cursor: not-allowed;
}

/* Failure offer / backup status notice (inline, below the player). Amber
   alert styling distinct from the lime resume note; wraps on narrow screens. */
.zoko-fallback-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  font-size: 0.8rem;
  color: #ffd9a0;
  background: rgba(255, 176, 32, 0.08);
  border: 1px solid rgba(255, 176, 32, 0.4);
}

.zoko-fallback-note[hidden] {
  display: none;
}

.zoko-fallback-note .zoko-fallback-text {
  font-weight: 600;
}

.zoko-fallback-note .btn-zoro-primary {
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
}

.zoko-fallback-note .fallback-dismiss {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 4px;
}

.zoko-bar-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub, #b9bdc9);
}

.zoko-track-switcher {
  display: flex;
  gap: 0.4rem;
}

.zoko-setting-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-left: 0.35rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.09));
}

.zoko-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-sub, #b9bdc9);
  cursor: pointer;
  user-select: none;
}

.zoko-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--zoro-lime);
  cursor: pointer;
}

.zoko-toggle:hover {
  color: #fff;
}

@media (max-width: 720px) {
  .zoko-setting-toggles {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }
}

/* Episode grid status text (loading / empty) */
.ep-grid-status {
  grid-column: 1 / -1;
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--text-muted, #8b8f9c);
}

/* Note: the watch-page data-error banner styles live in zoro-aizen.css, which
   is the stylesheet every page actually loads. */

/* Continue Watching row (home page) */
.zoko-continue-section {
  margin-bottom: 2.5rem;
}

.zoko-continue-card {
  display: block;
  text-decoration: none;
}

.zoko-continue-card .zoro-card-poster {
  position: relative;
}

.zoko-continue-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #0c0d12;
  background: var(--zoro-lime);
}

.zoko-continue-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.65);
}

.zoko-continue-bar span {
  display: block;
  height: 100%;
  background: var(--zoro-lime);
}
