/*
 * nineanime-bridge.css — shared additions to 9anime's stylesheet.
 *
 * styles.css is 9animetv.to's /css/styles.min.css?v=0.1, copied byte for byte
 * from reference/assets/styles.min.css. It has NOT been edited. Its three
 * url()s (../images/dub-icon.png, dub-icon-02.png, share-icon.gif) were 404
 * on 9animetv.to itself (never archived); public/assets/nineanime/images/
 * holds same-family copies from the earlier build so no request 404s. The
 * logo is Admin › SEO › Site Logo, falling back to the bundled 9anime logo
 * (SeoHelper::logoUrl(), public/images/nineanime/logo.png).
 *
 * This file is for what the CMS has and 9anime never drew, and for the few
 * places the CMS engine's markup contract differs from 9anime's. Everything
 * page-specific belongs in nineanime-<area>.css. Comment each block with why.
 * 9anime's palette, for reference: page #0e0e0e, text #aaa, links #525252 →
 * #fff, accent #5a2e98 (hover #3e2166), panels #1c1c1c / #212121 / #262626 /
 * #343434, alternate rows #181818, hover rows #242424.
 */

/* Icons: Font Awesome 6 then Font Awesome 5.3.1 are both linked from the
   layout (see the comment there), so no family shim is needed here. */

/* ── Tooltip ──────────────────────────────────────────────────────────────
   9anime used qTip2 (`.qtip.qtip-default` around `.pre-qtip-content`); the
   CMS engine uses tooltipster (main.js Tooltip on [data-tip]), which wraps
   the fragment in `.tooltipster-base > .tooltipster-box > .tooltipster-content`.
   The box takes 9anime's qtip-default look from styles.css: #171717, 7px
   radius, a soft shadow, 13px/1.3em. main.js fixes tooltipster's width at
   310px (9anime's qTip was 340px) — engine, not editable. The fragment is
   partials/anime-tooltip. 9anime hid the card below 1280px; main.js opens it
   from 1024px. */
.tooltipster-sidetip .tooltipster-box {
    border: none;
    border-radius: 7px;
    background: #171717;
    box-shadow: 0 0 20px rgba(0, 0, 0, .1);
}
.tooltipster-sidetip .tooltipster-content {
    padding: 0;
    color: #525252;
    font-size: 13px;
    line-height: 1.3em;
    overflow: visible;
}
.tooltipster-sidetip .tooltipster-arrow { display: none; }
.tooltipster-content .pre-qtip-line a { color: #b082e6; }
.tooltipster-content .pre-qtip-line a:hover { color: #fff; }
/* The add-to-list plus (main.js UserFavourite): its folder menu, dark. */
.pre-qtip-content .qtip-fav > a { display: block; line-height: 30px; }
.pre-qtip-content .qtip-fav .dropdown-menu { top: 100%; right: 0; left: auto; min-width: 160px; z-index: 5; }
.dropdown-menu.folders { background: #212121; border: none; box-shadow: 0 2px 10px #171717; padding: 5px 0; font-size: 13px; }
.dropdown-menu.folders .dropdown-item { color: #aaa; padding: 5px 15px; }
.dropdown-menu.folders .dropdown-item:hover { color: #fff; background: #2e2e2e; }
.dropdown-menu.folders .dropdown-item.active { color: #fff; background: #5a2e98; }

/* ── Sign-in modal extras ─────────────────────────────────────────────────
   Social sign-in (Admin › Social login) and reCAPTCHA have no counterpart in
   the archived modal; they sit in its white panel in its purples. */
#sign .na-captcha:empty, #sign .na-captcha > .captcha:empty { display: none; }
#sign .na-captcha { margin-top: 15px; }
#sign .na-social-login { margin-top: 20px; }
#sign .na-social-sep { position: relative; text-align: center; margin-bottom: 15px; font-size: 12px; color: #999; }
#sign .na-social-sep::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #e5dbf4; }
#sign .na-social-sep span { position: relative; padding: 0 10px; background: #fff; }
#sign .btn-social {
    display: flex; align-items: center; justify-content: center;
    background: #ebe3f6; color: #5a2e98; border: 1px solid transparent;
    font-size: 14px; font-weight: 500; border-radius: 0; padding: .6rem 1rem;
}
#sign .btn-social:hover { border-color: var(--na-brand, #5a2e98); color: #5a2e98; }
#sign .btn-social + .btn-social { margin-top: 10px; }
/* main.js AjaxForm prepends a Bootstrap `.alert` with a close button into the
   form. styles.css gives every .close inside .premodal .modal-content the
   modal's corner button; the alert's own close is put back inline. */
#sign .alert { position: relative; padding-right: 2.5rem; }
#sign .modal-content .alert .close {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    width: auto; height: auto; line-height: 1; padding: 0;
    background: none; color: inherit; opacity: .6; font-size: 20px;
}
#sign .modal-content .alert .close:hover { opacity: 1; }
/* The loader row under the button while main.js's request is out. */
#sign .login-btn .loading-relative { min-height: 40px; margin-top: 10px; }
#sign .login-btn .loading-relative .loading { position: absolute; }

/* ── Member header (partials/user-panel) ─────────────────────────────────
   main.js's dropdown plugin shows a menu by sliding it down (inline
   display:block) and puts `.show` on its parent. The name pill is 9anime's
   `.btn-user` (styles.css; a 40px caret button ≤768px). The bell is a CMS
   feature: a round 50px button beside the pill (40px ≤768px), its menu
   9anime's `.dropdown-menu-noti`, with the CMS bell's tabs, panes and
   mark-as-read links (notifications-bell.js contract). 9anime's archived
   pages are a guest's, so none of this could be measured. */
#user .d-none { display: none !important; }
#user .top-profile { display: flex; align-items: center; }
#user .na-noti { position: relative; margin-left: 5px; }
#user .na-noti-btn {
    position: relative; width: 50px; height: 50px; line-height: 50px; border-radius: 50%;
    text-align: center; cursor: pointer; background: #1c1c1c; color: #aaa; font-size: 18px;
}
#user .na-noti-btn:hover, #user .na-noti.show .na-noti-btn { color: #fff; background: #262626; }
#user .na-noti-btn .number {
    position: absolute; top: 6px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; background: #5a2e98; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px;
}
#user .na-noti-btn .number[hidden] { display: none; }
#user .header_right-user.logged .btn-user { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
@media screen and (max-width: 768px) {
    #user .na-noti-btn { width: 40px; height: 40px; line-height: 40px; font-size: 16px; }
    #user .na-noti-btn .number { top: 0; right: -4px; }
}
/* The name pill's menu: 9anime's dark panel colours (the header menu flyout). */
#user_menu {
    min-width: 240px; padding: 0; border: none; border-radius: 6px; overflow: hidden;
    background: #212121; box-shadow: 0 2px 10px #171717; color: #aaa; font-size: 13px;
}
#user_menu .dropdown-item { color: #aaa; padding: 8px 15px; background: none; }
#user_menu .dropdown-item:hover { color: #fff; background: #2e2e2e; }
#user_menu .dropdown-item i { width: 16px; text-align: center; color: #666; }
#user_menu .dropdown-item-user { display: flex; align-items: center; padding: 12px 15px; background: #1c1c1c; cursor: default; white-space: normal; }
#user_menu .dropdown-item-user:hover { background: #1c1c1c; color: #aaa; }
#user_menu .profile-avatar { flex: 0 0 40px; width: 40px; height: 40px; margin-right: 10px; border-radius: 50%; overflow: hidden; }
#user_menu .profile-avatar img { width: 40px; height: 40px; object-fit: cover; }
#user_menu .user-detail { min-width: 0; }
#user_menu .user-detail .name { color: #fff; }
#user_menu .user-detail .mail { font-size: 12px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#user_menu .na-logout { border-top: 1px solid #2e2e2e; color: #aaa; }
/* The bell menu: tabs as 9anime's `.pre-tabs-min` pills in the menu
   (`.dropdown-menu-noti .pre-tabs-min .nav-link`: 5px 6px, 12px/1.5em, 500,
   #4c4f57, purple when active). The engine needs bare `span`s directly under
   `.noti-bell-tabs`, so the look is restated on them. */
.user-notification .nnl-head strong { color: #fff; font-weight: 500; }
.user-notification .noti-bell-tabs { display: flex; gap: 5px; margin-top: 8px; }
.user-notification .noti-bell-tabs > span[data-bell-tab] {
    flex: 1 1 0; min-width: 0; padding: 5px 6px; font-size: 12px; line-height: 1.5em;
    font-weight: 500; text-align: center; cursor: pointer; color: #ddd;
    background: #3c3e48; border-radius: 4px; text-transform: capitalize;
}
.user-notification .noti-bell-tabs > span[data-bell-tab]:hover { color: #fff; }
.user-notification .noti-bell-tabs > span[data-bell-tab].active { background: #5a2e98; color: #fff; }
.user-notification .noti-bell-tabs .badge { display: none; }
.user-notification .noti-bell-pane { display: none; }
.user-notification .noti-bell-pane.active { display: block; }
.user-notification .body-box { max-height: 350px; overflow-y: auto; }
.user-notification .noti-bell-actions { padding: 8px 15px; background: rgba(0, 0, 0, .15); overflow: hidden; text-align: right; }
.user-notification .noti-bell-actions a { font-size: 12px; color: #ccc; }
.user-notification .noti-bell-actions a:hover { color: #fff; }
.user-notification .nnl-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 15px; border-bottom: 1px solid #4a4d59; color: #ccc; font-size: 12px; line-height: 1.4em; }
.user-notification a.nnl-item:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.user-notification .nnl-item strong { display: block; color: #fff; font-weight: 500; font-size: 13px; }
.user-notification .nnl-item p { margin: 2px 0; color: #aaa; }
.user-notification .nnl-item .time { color: #888; font-size: 11px; }
.user-notification .nnl-item .film-poster { position: relative; flex: 0 0 36px; width: 36px; padding-bottom: 47px; border-radius: 3px; overflow: hidden; }
.user-notification .nnl-item .film-poster .film-poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-notification .nnl-item .user-avatar { position: relative; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; }
.user-notification .nnl-item.old { opacity: .5; }
.user-notification .nnl-item.new { opacity: 1; }
.user-notification .no-result { display: block; padding: 12px 15px; text-align: center; font-size: 12px; line-height: 1.5em; color: #fff; opacity: .4; border-bottom: 1px solid #4a4d59; }
.user-notification .system-noti-icon { height: 36px; line-height: 36px; text-align: center; background: rgba(255, 255, 255, .1); color: #aaa; }
.user-notification .user-avatar .user-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.user-notification > .nnl-more { display: block; padding: 10px 15px; text-align: center; font-size: 13px; background: #5a2e98; color: #fff; border: none; }
.user-notification > .nnl-more:hover { background: #3e2166; color: #fff; }

/* ── Toasts ───────────────────────────────────────────────────────────────
   9anime used toastr, top right (`#toast-container.toast-top-right > div`,
   styled in styles.css: 300px, 3px radius, 15px padding, #51a351 success /
   #bd362f error / #2f96b4 info, .8 opacity). The CMS engines write their
   own: main.js `#toast > .alert.alert-*`, comments.js
   `#toast-container > .alert`, member/community `.ak-toast`. All three are
   drawn as that toast. */
#toast, #toast-container {
    position: fixed; right: 12px; top: 12px; bottom: auto; z-index: 999999;
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
    pointer-events: none;
}
#toast > .alert, #toast-container > .alert, .ak-toast {
    pointer-events: auto; position: relative; margin: 0;
    width: 300px; max-width: calc(100vw - 24px);
    padding: 15px 35px 15px 15px; border: none; border-radius: 3px;
    font-size: 14px; line-height: 1.4; opacity: .8;
    box-shadow: 0 0 12px #999;
    background: #2f96b4; color: #fff;
}
#toast > .alert:hover, #toast-container > .alert:hover { opacity: 1; box-shadow: 0 0 12px #000; }
#toast > .alert-success, #toast-container > .alert-success, .ak-toast-success { background: #51a351; color: #fff; }
#toast > .alert-danger, #toast-container > .alert-danger, .ak-toast-error { background: #bd362f; color: #fff; }
#toast .alert .close, #toast-container .alert .close { position: absolute; top: 8px; right: 10px; padding: 0; color: #fff; text-shadow: none; opacity: .8; font-size: 20px; }
.ak-toast { position: fixed; right: 12px; top: 12px; z-index: 999999; transform: translateY(-20px); opacity: 0; transition: all .2s; }
.ak-toast.is-on { transform: none; opacity: .8; }

/* ── Site alert (partials/site-alert, Admin › Settings › Site alert) ─────
   Not a 9anime component; drawn as one of its #1c1c1c panels with the
   purple accent. */
.na-site-alert {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 20px; padding: 12px 15px; border: none; border-radius: 6px;
    background: #1c1c1c; color: #aaa; font-size: 13px;
}
.na-site-alert[hidden] { display: none; }
.na-site-alert-icon { color: #b082e6; font-size: 16px; flex-shrink: 0; }
.na-site-alert--critical .na-site-alert-icon, .na-site-alert--critical .na-site-alert-kicker { color: #ff3c1f; }
.na-site-alert-body { flex: 1; min-width: 0; }
.na-site-alert-kicker { display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #b082e6; }
.na-site-alert-text strong { color: #fff; font-weight: 600; }
.na-site-alert-link { background: #5a2e98; color: #fff; flex-shrink: 0; }
.na-site-alert-link:hover { background: #3e2166; color: #fff; }
.na-site-alert .close { color: #fff; text-shadow: none; opacity: .5; }
.na-site-alert .close:hover { opacity: 1; color: #fff; }

/* ── Empty states in 9anime lists (the CMS can have none) ───────────────── */
.na-empty { padding: 30px 15px; text-align: center; font-size: 13px; color: #666; width: 100%; }

/* ── Ad slots (<x-frontend.ad>) in 9anime's positions ─────────────────────
   9anime centred a leaderboard under "Recently Updated" (its "pizza-x" box,
   800px) and could put a 400px box atop the sidebar; the admin's snippet
   decides its own size inside. Nothing is drawn when a slot is empty. */
.ak-ad.na-ad-x { margin: 2rem auto; width: calc(100% - 32px); max-width: 800px; text-align: center; }
.ak-ad.na-ad-y { margin: 0 auto 20px; max-width: 400px; text-align: center; }
.ak-ad.ak-ad--footer { margin: 2rem auto; text-align: center; }

/* ── Footer extras ────────────────────────────────────────────────────────
   Footer friends (Admin › Settings) under the disclaimer; the Discord button
   (9anime had twitter / telegram / reddit only). */
#footer .na-friends { margin-top: 8px; }
#footer .na-friends a { color: #888; }
#footer .na-friends a:hover { color: #fff; }
.socials-group .scg-list .item .sc-social-button.na-dsc-btn { background: #5865f2; color: #fff; }

/* ── Share links (no ShareThis property set) ─────────────────────────────
   9anime's `.show-share` row held ShareThis inline buttons; without a
   property the CMS draws plain round links in the same row. */
.na-share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.na-share-link { display: inline-block; width: 36px; height: 36px; line-height: 36px; border-radius: 4px; text-align: center; font-size: 16px; color: #fff !important; }
.na-share-link:hover { opacity: .85; }
.na-share-facebook { background: #4267b2; }
.na-share-twitter { background: #6f85d5; }
.na-share-reddit { background: #ff3c1f; }
.na-share-whatsapp { background: #25d366; }

/* ── Loaders ──────────────────────────────────────────────────────────────
   9anime drew every loading state the same way: styles.css's three
   bouncing purple dots (18px, #5a2e98, sk-bouncedelay 1.4s) centred inside a
   `.loading-relative` box (block, min-height 50px):

     <div class="loading-relative"><div class="loading">
         <div class="span1"></div><div class="span2"></div><div class="span3"></div>
     </div></div>

   The gap between the dots is the whitespace between the divs, so the box is
   pinned to 16px Poppins wherever the CMS puts it (some sit in 13px blocks);
   nowrap keeps an absolutely placed box from wrapping in a narrow button.
   Markup the CMS engine injects:
     - main.js (player, AjaxForm) and comments.js (edit composer) write an
       empty `<div class="loading">`; resources/js/nineanime/app.js fills every
       empty one with the three dots, so it is the same markup.
     - main.js AjaxForm appends that `.loading` as the form's last child and
       shows it while the request is out: drawn here as a 50px row under the
       submit button. */
.loading {
    font-family: Poppins, Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: normal;
    word-spacing: normal;
    white-space: nowrap;
    text-align: left;
}
form > .loading {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    height: 50px;
    padding-top: 12.5px;
    text-align: center;
}
/* A busy button: where the CMS has a small inline action with no room for a
   row, the same dots cover the button's label instead
   (`.loading-relative.na-btn-loading` inside the button). */
.na-btn-loading { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: auto; height: auto; min-height: 0; }
button:has(> .na-btn-loading:not(.hidden):not([hidden])) { position: relative; color: transparent !important; }
button:has(> .na-btn-loading:not(.hidden):not([hidden])) > :not(.na-btn-loading) { visibility: hidden; }

/* ── Dropdown plugin (main.js) ────────────────────────────────────────────
   On touch devices outside `.navbar-nav` the plugin appends a
   `.dropdown-backdrop` to the open menu's parent; it must sit under the menu
   and catch the outside tap. */
.dropdown-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 990; }

/* ── Quick filter pills (partials/nineanime/sidebar-filter) ──────────────
   The pill shows the ticked value ("Slice of Life", "3 selected"); 9anime's
   sidebar pills were one line, so there a long value is cut rather than
   wrapping the two-column grid. The listing box wraps, as 9anime's did. */
.block_area_sidebar .sidebar-filter .item .btn-filter { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The CMS offers every year since 1980 (9anime listed 25): the Year menu
   scrolls instead of running off the screen. */
.sidebar-filter .dropdown-menu.na-menu-scroll { max-height: 320px; overflow-y: auto; }

/* Phones (≤480px): 9anime's bar holds the menu, the logo, the search button
   and one 40px account button — there is no room for the CMS bell beside
   them without wrapping the header. The bell is hidden there (its menu is
   still in the page for notifications-bell.js; /member/notifications is in
   the account menu) and an unread dot marks the account button instead. */
@media screen and (max-width: 480px) {
    #user .na-noti { display: none; }
    #user .header_right-user.logged .dropdown { position: relative; }
    #user .top-profile:has(.na-noti-btn.active) .header_right-user.logged .dropdown::after {
        content: ""; position: absolute; top: 0; right: 0; z-index: 2; width: 10px; height: 10px;
        border-radius: 50%; background: #ff3c1f; box-shadow: 0 0 0 2px #0e0e0e; pointer-events: none;
    }
}
