/* Player AJAX de episÃ³dios */
.ajm-episode-watch-shell {
    position: relative;
    min-height: 100vh;
}

.ajm-episode-watch-shell .ajm-section-video {
    position: relative;
    padding: 24px 0 44px;
    overflow: hidden;
}

.ajm-episode-watch-shell .ajm-relative {
    position: relative;
}

.ajm-episode-watch-shell .prebreadcrumb {
    margin-bottom: 16px;
}

.ajm-episode-watch-shell .anis-watch-wrap {
    position: relative;
    min-height: 620px;
}

.ajm-episode-watch-shell .anis-watch {
    width: calc(75% - 8px);
    transition: width .24s ease;
}

.ajm-episode-watch-shell .anis-watch-tv {
    position: relative;
    padding-left: 310px;
    background: #08090b;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 18px 55px rgba(0,0,0,.22);
}

.ajm-episode-watch-shell .anis-watch-tv .player-frame,
.ajm-episode-watch-shell .player-frame {
    position: relative;
    width: 100%;
    height: 0;
    min-height: 0;
    padding-bottom: 56.25%;
    margin: 0;
    overflow: hidden;
    background: #000;
}

.ajm-episode-watch-shell .player-frame iframe,
.ajm-episode-watch-shell .player-frame video,
.ajm-episode-watch-shell .ajm-watch-iframe,
.ajm-episode-watch-shell .ajm-native-player {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    background: #000;
}

.ajm-episode-watch-shell .player-frame .loading-relative.loading-box {
    z-index: 3;
    background: #050607;
}

.ajm-player-message,
.ajm-watch-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 90px;
    padding: 22px;
    color: #9da6ad;
    text-align: center;
    font-size: 13px;
}

.ajm-player-message {
    position: absolute;
    inset: 0;
    min-height: 0;
    background: #050607;
}

.ajm-episode-watch-shell .player-controls {
    min-height: 48px;
    padding: 6px 10px;
    background: #121315;
    border-top: 1px solid rgba(255,255,255,.05);
    flex-wrap: wrap;
}

.ajm-episode-watch-shell .player-controls .pc-item {
    margin: 3px 5px;
}

.ajm-episode-watch-shell .player-controls a,
.ajm-episode-watch-shell .player-controls .toggle-basic {
    color: #d8dde1;
    cursor: pointer;
    user-select: none;
    transition: color .18s ease, opacity .18s ease;
}

.ajm-episode-watch-shell .player-controls a:hover,
.ajm-episode-watch-shell .player-controls .toggle-basic:hover {
    color: #fff;
}

.ajm-episode-watch-shell .quick-settings.off {
    opacity: .52;
}

.ajm-episode-watch-shell .quick-settings.active .tb-result {
    color: #69d38c;
}

.ajm-episode-watch-shell .quick-settings.off .tb-result {
    color: #8a9298;
}

.ajm-episode-watch-shell #watch-list-content .ajm-favorite-button {
    min-height: 32px;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    background: rgba(255,255,255,.07);
    color: #fff;
}

.ajm-episode-watch-shell #watch-list-content .ajm-favorite-button.is-favorite {
    background: rgba(255,5,6,.15);
    color: #ff4f50;
}

.ajm-episode-watch-shell #episodes-content {
    position: absolute;
    z-index: 5;
    top: 0;
    bottom: 0;
    left: 0;
    width: 310px;
    margin: 0;
    overflow: hidden;
    /* background: #111315; */
    border-right: 1px solid rgba(255,255,255,.07);
}

.ajm-watch-episodes,
.ajm-watch-episodes .detail-seasons,
.ajm-watch-episodes .detail-infor-content {
    height: 100%;
}

.ajm-watch-episodes .detail-infor-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ajm-watch-episodes .ss-choice {
    flex: 0 0 auto;
    padding: 13px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.ajm-watch-episodes .ssc-label {
    margin-bottom: 9px;
    color: #e6e9eb;
    font-size: 12px;
    font-weight: 600;
}

.ajm-season-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.ajm-season-item,
.ep-page-item {
    appearance: none;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 7px;
    background: #0c0e10;
    color: #9ca5ac;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    transition: .18s ease;
}

.ajm-season-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
}

.ajm-season-item small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(255,255,255,.08);
    font-size: 9px;
}

.ajm-season-item:hover,
.ajm-season-item.active,
.ep-page-item:hover,
.ep-page-item.active {
    border-color: rgb(255 171 5 / 48%);
    color: #fff;
    background: rgb(255 160 5 / 12%);
}

.ajm-watch-episodes .ssc-quick {
    position: relative;
    margin-top: 10px;
}

.ajm-watch-episodes .sscq-icon {
    position: absolute;
    z-index: 2;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #747d84;
    font-size: 11px;
}

.ajm-watch-episodes #search-ep {
    width: 100%;
    height: 36px;
    padding: 0 11px 0 32px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 7px;
    outline: 0;
    background: #0a0c0e;
    color: #fff;
    font-size: 11px;
}

.ajm-watch-episodes #search-ep:focus {
    border-color: rgba(255,5,6,.55);
}

.ajm-season-panel {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.ajm-season-panel.active {
    display: flex;
    flex-direction: column;
}

.ajm-episode-pages {
    display: flex;
    gap: 5px;
    flex: 0 0 auto;
    padding: 8px 10px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.ep-page-item {
    flex: 0 0 auto;
    padding: 6px 8px;
    font-size: 9px;
}

.ajm-watch-episodes .ss-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.ajm-watch-episodes .ss-list-min {
    display: none;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #3b4044 #111315;
}

.ajm-watch-episodes .ss-list-min.active {
    display: block;
}

.ajm-watch-episodes .ssl-item {
    display: flex;
    align-items: center;
    min-height: 49px;
    padding: 7px 9px;
    color: #b7bec3;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.045);
    transition: background .16s ease, color .16s ease;
}

.ajm-watch-episodes .ssl-item:hover,
.ajm-watch-episodes .ssl-item.highlight {
    background: rgba(255,255,255,.055);
    color: #fff;
}

.ajm-watch-episodes .ssl-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgb(31 31 31 / 18%), rgb(139 139 139 / 4%));
    box-shadow: inset 3px 0 0 #ff0506;
}

.ajm-watch-episodes .ssli-order {
    flex: 0 0 32px;
    color: #ff5b5c;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.ajm-watch-episodes .ssli-detail {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 8px;
}

.ajm-watch-episodes .ep-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
    line-height: 1.4;
}

.ajm-watch-episodes .ssli-btn {
    flex: 0 0 26px;
}

.ajm-watch-episodes .ssli-btn .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: #a9b0b5;
    font-size: 9px;
}

.ajm-watch-episodes .ssl-item.active .ssli-btn .btn {
    color: #fff;
    background: #3c3c3c;
}

#servers-content {
    background: #121315;
    border-top: 1px solid rgba(255,255,255,.06);
}

.ajm-server-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 13px;
}

.ajm-server-title {
    flex: 0 0 auto;
    color: #7f8990;
    font-size: 11px;
    font-weight: 600;
}

.ajm-server-list {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.server-item {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.server-item .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 6px;
    background: #15181b;
    color: #aeb5ba;
    font-size: 10px;
    font-weight: 600;
    transition: .16s ease;
}

.server-item .btn:hover,
.server-item .btn.active {
    border-color: rgb(255 171 5 / 48%);
    color: #fff;
    background: rgb(255 171 5 / 14%);
}

/*
* MantÃ©m o modelo visual original de .anis-watch-detail definido no style.css.
* Aqui entram apenas os complementos funcionais adicionados pela pÃ¡gina dinÃ¢mica.
*/
.ajm-watch-detail-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.ajm-watch-detail-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ajm-watch-report-open {
    cursor: pointer;
}

.ajm-watch-after {
    position: relative;
    z-index: 1;
    padding-top: 28px;
    padding-bottom: 50px;
}

#comment-block {
    position: relative;
    min-height: 80px;
    margin-bottom: 34px;
    scroll-margin-top: 95px;
}

#comment-block.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(2,4,5,.58);
    backdrop-filter: blur(2px);
}

.ajm-related-watch .block_area-header {
    margin-bottom: 14px;
}

.ajm-related-watch .ajm-grid {
    gap: 18px;
}

#mask-overlay {
    display: none;
    position: fixed;
    z-index: 9990;
    inset: 0;
    background: rgba(0,0,0,.88);
}

#mask-overlay.active {
    display: block;
}

.anis-watch-wrap.is-lights-off .anis-watch {
    position: relative;
    z-index: 9991;
}

.anis-watch-wrap.extend .anis-watch {
    width: 100%;
}

.anis-watch-wrap.extend .anis-watch-detail {
    display: none;
}

.ajm-watch-toast-stack {
    position: fixed;
    z-index: 99999;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.ajm-watch-toast {
    max-width: 340px;
    padding: 11px 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: #15191c;
    color: #fff;
    box-shadow: 0 12px 35px rgba(0,0,0,.35);
    opacity: 0;
    transform: translateY(8px);
    transition: .2s ease;
    font-size: 12px;
}

.ajm-watch-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ajm-watch-toast.is-error {
    border-color: rgba(255,77,79,.4);
}

@media (max-width: 1250px) {
    .ajm-episode-watch-shell .anis-watch {
        width: 100%;
    }

    .ajm-episode-watch-shell .anis-watch-wrap {
        min-height: 0;
    }

    .ajm-episode-watch-shell .anis-watch-detail {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        min-width: 0;
        margin-top: 18px;
    }

}

@media (max-width: 820px) {
    .ajm-episode-watch-shell .ajm-section-video {
        padding-top: 14px;
    }

    .ajm-episode-watch-shell .anis-watch-tv {
        display: flex;
        flex-direction: column;
        padding-left: 0;
        overflow: visible;
    }

    .ajm-episode-watch-shell .watch-player {
        order: 1;
    }

    .ajm-episode-watch-shell #servers-content {
        order: 2;
    }

    .ajm-episode-watch-shell #episodes-content {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        order: 3;
        width: 100%;
        height: min(470px, 68vh);
        border-top: 1px solid rgba(255,255,255,.07);
        border-right: 0;
    }

    .ajm-episode-watch-shell .player-controls {
        align-items: flex-start;
    }

    .ajm-episode-watch-shell .pc-right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .ajm-watch-detail-buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .ajm-watch-detail-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .ajm-episode-watch-shell .player-controls .pc-toggle.pc-autoskipintro {
        display: none;
    }

    .ajm-server-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

}


/* Engines de player */
.ajm-jw-shell,
.ajm-plyr-shell,
.ajm-videojs-shell,
.ajm-simple-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.ajm-jw-target,
.ajm-jw-shell > .jwplayer,
.ajm-jw-shell .jwplayer,
.ajm-plyr-shell .plyr,
.ajm-plyr-shell video,
.ajm-videojs-shell .video-js,
.ajm-simple-player > video {
    width: 100% !important;
    height: 100% !important;
}

.ajm-jw-target {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.ajm-jw-fallback {
    z-index: 1;
}

.ajm-jw-shell.is-jw-ready .ajm-jw-fallback,
.ajm-jw-shell.is-fallback .ajm-jw-target {
    display: none !important;
}

.ajm-jw-shell.is-fallback .ajm-jw-fallback {
    display: block !important;
}

/* MP4 / Plyr: visual limpo, responsivo e coerente com o tema */
.ajm-plyr-shell {
    overflow: hidden;
    background: #000;
    --plyr-color-main: #0569ff;
    --plyr-video-background: #000;
    --plyr-video-controls-background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.92));
    --plyr-video-control-color: #fff;
    --plyr-video-control-color-hover: #fff;
    --plyr-video-control-background-hover: #0569ff;
    --plyr-range-thumb-background: #fff;
    --plyr-menu-background: rgba(17,20,23,.98);
    --plyr-menu-color: #fff;
}

.ajm-plyr-shell .plyr {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.ajm-plyr-shell .plyr__video-wrapper {
    width: 100%;
    height: 100%;
    background: #000;
}

.ajm-plyr-shell .plyr video {
    object-fit: contain;
    background: #000;
}

.ajm-plyr-shell .plyr__control--overlaid {
    width: 72px;
    height: 72px;
    padding: 22px;
    border-radius: 50%;
    background: #0569ff;
    box-shadow: 0 12px 34px rgba(0,0,0,.32);
}

.ajm-plyr-shell .plyr__controls {
    padding: 18px 16px 12px;
}

/* Video.js compartilhado */
.ajm-videojs-shell {
    overflow: hidden;
}

.ajm-videojs-shell .video-js {
    position: absolute;
    inset: 0;
    font-family: inherit;
    background: #000;
}

.ajm-videojs-shell .video-js .vjs-control-bar {
    height: 4em;
}

.ajm-videojs-shell .video-js .vjs-big-play-button {
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    border: 0;
    border-radius: 50%;
    line-height: 72px;
}


/* Ajustes especÃ­ficos para toque, iPhone/iPad e telas pequenas */
@media (max-width: 820px), (pointer: coarse) {
    .ajm-episode-watch-shell .player-frame,
    .ajm-episode-watch-shell .player-frame * {
        -webkit-tap-highlight-color: transparent;
    }

    .ajm-plyr-shell .plyr__controls {
        gap: 2px;
        padding: 14px 10px max(10px, env(safe-area-inset-bottom));
    }

    .ajm-plyr-shell .plyr__control {
        min-width: 38px;
        min-height: 38px;
    }

    .ajm-plyr-shell .plyr__control--overlaid {
        width: 62px;
        height: 62px;
        padding: 19px;
    }
}

@supports (-webkit-touch-callout: none) {
    .ajm-plyr-shell video,
    .ajm-videojs-shell video,
    .ajm-jw-shell video {
        object-fit: contain;
    }

    .ajm-episode-watch-shell .player-frame {
        transform: translateZ(0);
    }
}

/* Popup de report do episÃ³dio */
body.ajm-report-modal-open {
    overflow: hidden;
}

.ajm-watch-report-modal[hidden] {
    display: none !important;
}

.ajm-watch-report-modal {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ajm-watch-report-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(5px);
}

.ajm-watch-report-dialog {
    position: relative;
    z-index: 2;
    width: min(100%, 540px);
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px;
    background: #111417;
    color: #fff;
    box-shadow: 0 26px 80px rgba(0,0,0,.55);
}

.ajm-watch-report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.ajm-watch-report-head .ajm-kicker {
    color: #ff5657;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.ajm-watch-report-head h3 {
    margin: 4px 0;
    color: #fff;
    font-size: 21px;
}

.ajm-watch-report-head p {
    margin: 0;
    color: #929ba2;
    font-size: 12px;
}

.ajm-watch-report-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    color: #fff;
    cursor: pointer;
}

.ajm-watch-report-form {
    display: grid;
    gap: 15px;
    padding: 22px;
}

.ajm-watch-report-form label > span {
    display: block;
    margin-bottom: 6px;
    color: #aab1b6;
    font-size: 11px;
    font-weight: 600;
}

.ajm-watch-report-form select,
.ajm-watch-report-form input,
.ajm-watch-report-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 9px;
    outline: 0;
    background: #090b0d;
    color: #fff;
}

.ajm-watch-report-form select,
.ajm-watch-report-form input {
    height: 42px;
    padding: 0 11px;
}

.ajm-watch-report-form textarea {
    min-height: 125px;
    padding: 11px;
    resize: vertical;
}

.ajm-watch-report-form select:focus,
.ajm-watch-report-form input:focus,
.ajm-watch-report-form textarea:focus {
    border-color: rgba(255,5,6,.55);
    box-shadow: 0 0 0 3px rgba(255,5,6,.08);
}

.ajm-watch-report-form footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 3px;
}

.ajm-watch-report-feedback {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
}

.ajm-watch-report-feedback.is-error {
    border: 1px solid rgba(239,68,68,.28);
    background: rgba(239,68,68,.09);
    color: #fca5a5;
}

.ajm-watch-report-feedback.is-success {
    border: 1px solid rgba(34,197,94,.28);
    background: rgba(34,197,94,.09);
    color: #86efac;
}

@media (max-width: 620px) {
    .ajm-watch-report-modal {
        align-items: flex-end;
        padding: 0;
    }

    .ajm-watch-report-dialog {
        width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }

    .ajm-watch-report-form footer {
        flex-direction: column-reverse;
    }

    .ajm-watch-report-form footer .btn {
        width: 100%;
    }
}

/* Parte 3.3.1: fallback JW -> Video.js */
.ajm-jw-shell.is-videojs-fallback {
    overflow: hidden;
}

.ajm-jw-shell.is-videojs-fallback .ajm-jw-target {
    display: none !important;
}

.ajm-jw-shell.is-videojs-fallback .video-js,
.ajm-jw-shell.is-videojs-fallback .ajm-jw-fallback {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background: #000;
}

.ajm-jw-shell--native.is-videojs-fallback .vjs-play-progress,
.ajm-jw-shell--native.is-videojs-fallback .vjs-volume-level {
    background: #ff0506;
}

.ajm-jw-shell--blue.is-videojs-fallback .vjs-play-progress,
.ajm-jw-shell--blue.is-videojs-fallback .vjs-volume-level {
    background: #38a7ff;
}
