/* -------------------------------------------------------------------------------------
   Custom additions on top of DooPlay core styles
   ------------------------------------------------------------------------------------- */

/* Collection archive cover banner (taxonomy.php, is_tax('dtcollection')) */
.dt-collection-cover{
    width:100%;
    height:220px;
    background-size:cover;
    background-position:center;
    border-radius:8px;
    margin-bottom:16px;
}

/* -------------------------------------------------------------------------------------
   Poster badges: quality (fixed, unchanged spot) + genre (hover-only, bottom-center,
   yellow/black) + tvshow latest episode. Quality position: top-right on RTL sites
   (Arabic), automatically top-left when the site language is LTR - uses the CSS
   logical property so it flips with the site language, no extra code needed per
   language.
   ------------------------------------------------------------------------------------- */
.item .poster{
    position:relative;
    overflow:hidden;
}
.item .dt-poster-link{
    display:block;
    color:inherit;
    text-decoration:none;
}
.item .poster .dt-badges{
    position:absolute;
    top:6px;
    inset-inline-end:6px;
    inset-inline-start:auto;
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:4px;
    z-index:2;
    max-width:75%;
    pointer-events:none;
}
.rtl .item .poster .dt-badges{
    align-items:flex-start;
}
/* Latest-episode badge (tvshows): the OPPOSITE corner from quality/genre */
.item .poster .dt-badges.dt-badges-opposite{
    inset-inline-end:auto;
    inset-inline-start:6px;
}
.rtl .item .poster .dt-badges.dt-badges-opposite{
    align-items:flex-end;
}
.item .poster .dt-badge{
    display:inline-block;
    padding:3px 8px;
    font-size:11px;
    font-weight:600;
    border-radius:3px;
    line-height:1.6;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:100%;
}
.item .poster .dt-badge-quality{
    background:#e50914;
    color:#fff;
}
.item .poster .dt-badge-episode{
    background:#1e88e5;
    color:#fff;
}

/* Genre badge: same spot as quality (in the .dt-badges stack), but hidden by
   default and revealed only on hover, black text on yellow background */
.item .poster .dt-badge-genre{
    background:#ffc107;
    color:#111;
    opacity:0;
    visibility:hidden;
    transition:opacity .2s ease, visibility .2s ease;
}
.item .poster:hover .dt-badge-genre{
    opacity:1;
    visibility:visible;
}

/* Fixed bottom-center badge: always visible (episode S/E number, collection count) */
.item .poster .dt-badges-bottom-fixed{
    position:absolute;
    bottom:8px;
    left:50%;
    transform:translateX(-50%);
    z-index:2;
    pointer-events:none;
}
.item .poster .dt-badges-bottom-fixed .dt-badge-episode,
.item .poster .dt-badges-bottom-fixed .dt-badge-count{
    background:rgba(0,0,0,.75);
    color:#fff;
    padding:4px 12px;
    font-size:12px;
    font-weight:700;
    border-radius:3px;
    white-space:nowrap;
}

/* Title reveal: hidden by default, appears on hover only, centered over the poster
   (episode title / collection name). pointer-events:none is critical here - without
   it this full-cover layer sits on top of the real poster link and swallows clicks. */
.item .poster .dt-title-hover{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:10px;
    background:rgba(0,0,0,.55);
    z-index:4;
    opacity:0;
    visibility:hidden;
    transition:opacity .2s ease, visibility .2s ease;
    pointer-events:none;
}
.item .poster:hover .dt-title-hover{
    opacity:1;
    visibility:visible;
}
.item .poster .dt-title-hover span{
    color:#fff;
    font-weight:700;
    font-size:14px;
    line-height:1.4;
}

/* Rating badge: force the yellow/black IMDb-style treatment everywhere in the grid */
.item .poster .rating{
    background:#ffc107 !important;
    color:#111 !important;
    text-shadow:none !important;
    font-weight:700 !important;
}

/* Touch devices have no real ":hover" - show the hover-only elements
   permanently there instead of hiding this info from mobile visitors */
@media (hover:none){
    .item .poster .dt-badge-genre,
    .item .poster .dt-title-hover{
        opacity:1;
        visibility:visible;
    }
}

/* -------------------------------------------------------------------------------------
   Watch/download servers: side by side instead of stacked
   ------------------------------------------------------------------------------------- */
.options ul#playeroptionsul{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin:25px 0;
}
.options ul#playeroptionsul li.dooplay_player_option{
    float:none;
    width:auto;
    flex:1 1 160px;
    max-width:240px;
    padding:12px 15px;
    border-radius:4px;
}
.options ul#playeroptionsul li.dooplay_player_option span.title{
    float:none;
    display:block;
}
.options ul#playeroptionsul li.dooplay_player_option span.server{
    float:none;
    display:block;
    margin-left:0;
}
.options ul#playeroptionsul li.dooplay_player_option span.loader{
    float:none;
    position:absolute;
    top:10px;
    inset-inline-end:10px;
    margin:0;
}
.options ul#playeroptionsul li.dooplay_player_option{
    position:relative;
}
.options ul#playeroptionsul li.dooplay_player_option{
    transition:background-color .2s ease, box-shadow .2s ease;
}
.options ul#playeroptionsul li.dooplay_player_option:hover{
    background-color:rgba(255,255,255,.10);
    box-shadow:0 0 14px rgba(255,255,255,.18);
}
@media (max-width:600px){
    .options ul#playeroptionsul li.dooplay_player_option{
        flex:1 1 45%;
        max-width:none;
    }
}

/* -------------------------------------------------------------------------------------
   Season tabs: headers side by side in one row instead of stacked, whichever
   season is expanded shows its episodes full-width below the tab row.
   Uses display:contents on .se-c so its two children (.se-q the header,
   .se-a the episode panel) become direct flex items of #seasons - "order"
   then keeps every header together first, and the (one, visible) open
   panel is a full-width row underneath, regardless of source order.
   ------------------------------------------------------------------------------------- */
#seasons{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}
#seasons .se-c{
    display:contents;
}
#seasons .se-c .se-q{
    order:1;
    flex:0 0 auto;
    width:auto !important;
    padding:10px 18px !important;
    margin:0 !important;
    background:rgba(255,255,255,.06);
    border-radius:4px;
    display:flex;
    align-items:center;
    gap:8px;
    transition:background-color .2s ease, color .2s ease;
}
/* Active season tab: red highlight, moves to whichever season is open */
#seasons .se-c.dt-season-open .se-q{
    background:#e50914;
    color:#fff;
}
#seasons .se-c.dt-season-open .se-q .se-t{
    color:#fff;
}
#seasons .se-c .se-q .se-t{
    position:static !important;
    width:auto !important;
    padding:0 !important;
    font-size:16px !important;
}
#seasons .se-c .se-q .title{
    white-space:nowrap;
}
#seasons .se-c .se-q .title i{
    display:none; /* air date - only room for the season label in a compact tab */
}
#seasons .se-c .se-a{
    order:2;
    flex:0 0 100%;
    width:100% !important;
    margin-top:14px;
}

/* -------------------------------------------------------------------------------------
   "Seasons and episodes" list on the TV show page: side by side cards instead of
   stacked rows, clear thumbnail with the episode number overlaid on it.
   NOTE: the parent theme's own selector is "#seasons .se-c .se-a ul.episodios ..."
   (with .se-c) - the override below must match that exact chain or it loses on
   CSS specificity and silently does nothing.
   ------------------------------------------------------------------------------------- */
#seasons .se-c .se-a ul.episodios{
    width:100% !important;
    float:none !important;
    display:flex !important;
    flex-wrap:wrap !important;
    gap:14px !important;
}
#seasons .se-c .se-a ul.episodios li{
    width:calc(20% - 12px) !important;
    float:none !important;
    border-bottom:0 !important;
    padding:0 !important;
    position:relative !important;
}
#seasons .se-c .se-a ul.episodios li .imagen{
    width:100% !important;
    float:none !important;
    margin:0 !important;
    position:relative !important;
    border-radius:4px;
    overflow:hidden;
    aspect-ratio:16/9;
    cursor:pointer;
}
#seasons .se-c .se-a ul.episodios li .imagen img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
#seasons .se-c .se-a ul.episodios li .numerando{
    position:absolute !important;
    top:6px;
    inset-inline-start:50%;
    transform:translateX(-50%);
    float:none !important;
    width:auto !important;
    margin:0 !important;
    border:none !important;
    background:rgba(0,0,0,.75);
    color:#fff;
    padding:3px 10px;
    border-radius:3px;
    font-size:12px;
    font-weight:700;
    text-align:center;
    z-index:2;
}
#seasons .se-c .se-a ul.episodios li .episodiotitle{
    position:static !important;
    float:none !important;
    width:100% !important;
    padding:8px 2px !important;
    white-space:normal !important;
}
#seasons .se-c .se-a ul.episodios li .episodiotitle a{
    font-size:13px;
}
#seasons .se-c .se-a ul.episodios li .episodiotitle span.date{
    font-size:11px;
}
@media (max-width:900px){
    #seasons .se-c .se-a ul.episodios li{
        width:calc(33.333% - 10px) !important;
    }
}
@media (max-width:600px){
    #seasons .se-c .se-a ul.episodios li{
        width:calc(50% - 7px) !important;
    }
}

/* -------------------------------------------------------------------------------------
   Hero slider close button - dismissing it hides it site-wide (persisted in
   localStorage) until the visitor clears their browser data.
   ------------------------------------------------------------------------------------- */
.dt-hero-slider-wrap{
    position:relative;
}
#dt-hero-slider-close{
    position:absolute;
    top:10px;
    inset-inline-end:10px;
    z-index:999;
    width:32px;
    height:32px;
    line-height:30px;
    text-align:center;
    padding:0;
    border:0;
    border-radius:50%;
    background:rgba(0,0,0,.55);
    color:#fff;
    font-size:20px;
    cursor:pointer;
    transition:background-color .2s ease;
}
#dt-hero-slider-close:hover{
    background:rgba(0,0,0,.8);
}
html.dt-slider-dismissed .dt-hero-slider-wrap{
    display:none !important;
}

/* -------------------------------------------------------------------------------------
   Placeholder image (doo_child_card_image() 4th fallback tier) - just dims the plain
   dark rectangle slightly so it doesn't look identical to a real loaded poster/backdrop.
   ------------------------------------------------------------------------------------- */
img.dt-noimg{
    opacity:.6;
}

/* -------------------------------------------------------------------------------------
   Language switcher (doo_child_language_switcher()) - both the floating badge and the
   [dt_lang_switch] shortcode/menu-item placement share this. Uses logical properties so
   the floating badge's corner automatically follows the current reading direction.
   ------------------------------------------------------------------------------------- */
#dt-lang-float{
    position:fixed;
    bottom:14px;
    inset-inline-end:14px;
    z-index:9999;
    background:rgba(0,0,0,.75);
    border-radius:20px;
    padding:6px 14px;
    backdrop-filter:blur(4px);
}
.dt-lang-switch{
    display:flex;
    align-items:center;
    gap:6px;
}
.dt-lang-switch a{
    color:#ccc;
    text-decoration:none;
    font-size:12px;
    font-weight:600;
    transition:color .2s ease;
}
.dt-lang-switch a:hover{
    color:#e50914;
}
.dt-lang-switch a.active{
    color:#fff;
}
.dt-lang-switch .dt-lang-sep{
    color:#555;
    font-size:11px;
}

/* Placement inside DooPlay's own header menu (desktop .main-header and
   mobile .resp share the same 'header' menu location - see
   doo_lang_switch.php). Each list's own <li>/<a> rules (float, full-width,
   large padding) are meant for real menu links, not this widget, so
   they're reset here and replaced with sizing that fits each context. */
.main-header .dt-lang-switch-item,
.resp .dt-lang-switch-item{
    list-style:none;
}
.main-header .dt-lang-switch-item{
    float:none;
    display:flex;
    align-items:center;
}
.main-header .dt-lang-switch-item .dt-lang-switch{
    padding-inline:20px;
}
.resp .dt-lang-switch-item .dt-lang-switch{
    padding:17px 15px;
}
.dt-lang-switch-item .dt-lang-switch a{
    float:none !important;
    padding:0 !important;
    width:auto !important;
}
