/* =========================================================
 * ธีม anime — ลอกหน้าตามาจากเว็บ anime (assets/css/common.css)
 * ปรับให้ใช้กับ Bootstrap 5 ของ global
 * ========================================================= */

:root {
    --an-pink: #ffc0cb;
    --an-pink-soft: #fcd3e5;
    --an-pink-bg: #ffe5ef;
    --an-pink-ring: #ffd6e6;
    --an-coral: rgb(230, 132, 129);
    --an-red: #ff5b5b;
    --an-blue: #16adff;
    --an-cyan: #00c2ff;
    --an-sky: #2cafec;
    --an-green: #16a402;
    --an-text: #444;
    --an-muted: #8a8a8a;
    --an-card: #fff;
}

html, html.app--dark { color-scheme: light; }

body {
    font-family: "Varela Round", Itim, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    color: var(--an-text);
    background: #fff url(../img/bgBodyL.jpg) repeat center;
    min-height: 100vh;
}

a { color: #e0457b; text-decoration: none; }
a:hover { color: #1293d8; }

h1, h2, h3, h4, h5, h6 { font-family: inherit; }

img { vertical-align: middle; }
.min-w-0 { min-width: 0; }

/* ---------- Header / Logo ---------- */
.header-wrapper {
    padding: 15px 0;
    margin-bottom: -1px;
    background: #000 url(../img/header.jpg) center center;
    background-size: cover;
}
.site-brand { display: inline-block; }
.logo-page {
    max-width: 100%;
    max-height: 170px;
    height: auto;
}
.logo-text {
    display: inline-block;
    padding: 30px 10px;
    font-family: Itim, "Varela Round", sans-serif;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
    color: #fff;
    letter-spacing: .5px;
    text-shadow: 0 0 2px #ff6f9c, 0 0 8px #ff8fb1, 3px 3px 0 #2cafec;
}

/* ---------- Navbar ---------- */
.navbar-s {
    font-size: 14px;
    border-color: transparent;
    background-color: transparent;
    background-image: linear-gradient(to bottom, var(--an-coral), rgba(230, 132, 129, .15));
    box-shadow: 0 1px 2px rgba(255, 255, 255, .3);
    padding: .5rem 1rem;
}
.navbar-s .navbar-brand {
    font-family: Itim, sans-serif;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.navbar-s .nav-link {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    border-radius: 18px;
    padding: .4rem .8rem !important;
    transition: background-color .15s ease;
}
.navbar-s .nav-item.active > .nav-link,
.navbar-s .nav-link:hover,
.navbar-s .nav-link:focus {
    background-color: rgba(255, 255, 255, .25);
}
.navbar-s .navbar-toggler { border-color: rgba(255, 255, 255, .6); }
.navbar-s .dropdown-menu {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 0 6px var(--an-sky);
    padding: .35rem;
}
.navbar-s .dropdown-item { border-radius: 8px; color: var(--an-text); }
.navbar-s .dropdown-item:hover { background: var(--an-pink-bg); color: #e0457b; }
.dropdown-submenu { position: relative; }
.dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -6px; }
.dropdown-submenu:hover > .dropdown-menu { display: block; }
@media (max-width: 991.98px) {
    .navbar-s { background-image: linear-gradient(to bottom, var(--an-coral), rgba(230, 132, 129, .85)); }
    .dropdown-submenu > .dropdown-menu { position: static; display: block; box-shadow: none; }
}

.anime-announce {
    padding: 8px 14px;
    border-radius: 16px;
    color: #fff;
    background-image: linear-gradient(-225deg, #00c2ff 0%, #7fd7f5 50%, #ffbac3 100%);
    box-shadow: 0 0 5px var(--an-sky);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

/* ---------- Breadcrumb ---------- */
.anime-breadcrumb {
    background-color: transparent;
    margin: 6px 0 4px !important;
    padding: .6rem 0;
    font-size: 14px;
}
.anime-breadcrumb a { color: #e0457b; }
.anime-breadcrumb .sep { color: var(--an-sky); margin: 0 4px; }
.anime-breadcrumb [aria-current] { color: var(--an-muted); }

.movie-container { min-height: 40vh; }

/* ---------- Card ---------- */
.card {
    background: var(--an-card);
    color: var(--an-text);
    box-shadow: 0 0 5px var(--an-sky);
    border-radius: 16px;
    border-width: 0;
}
.card.border-primary { border-width: 0; }
.border-primary { border-color: var(--an-sky) !important; }
.border-primary > .card-header {
    color: #fff;
    padding: .6rem 1rem;
    border-color: #2196f3;
    background-color: #2196f3 !important;
    background-image: linear-gradient(-225deg, #00c2ff 0%, #e9f8f7 56%, #ffbac3 100%);
    border-top-right-radius: 16px;
    border-top-left-radius: 16px;
    text-shadow: 0 1px 2px rgba(0, 80, 120, .45);
}
.card-title { margin-bottom: 0; }
.style-page {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
    color: inherit;
    font-weight: 600;
}
.padding { padding: .8rem; }
.padding-m { padding: .6rem; }
.padding-p { padding: .15rem .15rem .6rem; }

/* ---------- Poster grid ---------- */
.center_anime { margin: 0; padding: 0 6px; }
.anime_grid {
    position: relative;
    margin-bottom: 20px;
}
.anime_col { display: block; position: relative; overflow: visible; }
.anime_col:hover { text-decoration: none; }

.img_anime {
    display: block;
    width: 100%;
    height: 225px;
    object-fit: cover;
    transition: transform .25s ease;
}
.anime-frame {
    padding: 2px;
    background-color: var(--an-pink-soft);
    border: 1px dashed #fff;
    box-shadow: var(--an-pink-soft) 0 0 0 2px;
    border-radius: 28px;
}
.title_anime {
    position: relative;
    margin-top: -36px;
    width: 100%;
    height: 36px;
    padding: 0 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    color: #fff;
    border-radius: 0 0 26px 26px;
    background: rgba(255, 192, 203, .92);
    text-shadow: 0 1px 1px rgba(200, 60, 100, .5);
    transition: opacity .2s ease;
}
.anime_spaceit {
    position: absolute;
    left: 0;
    bottom: 36px;
    max-width: calc(100% - 30px);
    padding: 3px 6px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    background-color: rgba(0, 194, 255, .75);
    transition: opacity .2s ease;
    pointer-events: none;
}
.anime_spaceit::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 24px solid rgba(0, 194, 255, .75);
    border-top: 24px solid transparent;
}
.anime_cate {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 1px 8px;
    font-size: 11px;
    color: #fff;
    border-radius: 10px;
    background: rgba(255, 91, 91, .85);
    pointer-events: none;
    transition: opacity .2s ease;
}
.anime_today {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 1px 8px;
    font-size: 11px;
    color: #fff;
    border-radius: 10px;
    background: rgba(22, 164, 2, .9);
}
.anime_grid:hover .img_anime { transform: scale(1.05); }
.anime_grid:hover .title_anime,
.anime_grid:hover .anime_spaceit,
.anime_grid:hover .anime_cate { opacity: 0; }

@media (max-width: 1200px) { .img_anime { height: 245px; } }
@media (max-width: 1024px) { .img_anime { height: 215px; } }
@media (max-width: 992px)  { .img_anime { height: 210px; } }
@media (max-width: 767px)  { .img_anime { height: 220px; } }
@media (max-width: 480px)  { .img_anime { height: 200px; } }

.anime-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--an-muted);
    background: #fff7fa;
    border: 1px dashed var(--an-pink-soft);
    border-radius: 14px;
    margin: 6px;
}

/* ---------- Buttons ---------- */
.btn-anime,
.btn-anime-outline,
.btn-player,
.btn-season,
.btn-report {
    border-radius: 18px;
    font-size: 14px;
    transition: all .15s ease;
}
.btn-anime {
    color: #fff;
    border: 0;
    background-image: linear-gradient(90deg, #ff8fb1, #ff6f9c);
    box-shadow: 0 2px 6px rgba(255, 111, 156, .35);
}
.btn-anime:hover, .btn-anime:focus { color: #fff; filter: brightness(1.05); transform: translateY(-1px); }
.btn-anime-outline {
    color: #e0457b;
    background: #fff;
    border: 1px solid #ff8fb1;
}
.btn-anime-outline:hover, .btn-anime-outline.active { color: #fff; background: #ff8fb1; }
.btn-report { color: #fff; background: #ff5151; border: 0; }
.btn-report:hover { color: #fff; background: #e94141; }
.btn-season {
    color: var(--an-blue);
    background: #fff;
    border: 1px solid #9fdcff;
    padding: 2px 12px;
    margin: 0 4px 4px 0;
}
.btn-season.active, .btn-season:hover { color: #fff; background: var(--an-blue); border-color: var(--an-blue); }

/* ---------- Poster on detail page ---------- */
.anime_img_view {
    display: block;
    width: 100%;
    max-width: 280px;
    height: 380px;
    margin: 0 auto 12px;
    object-fit: cover;
    border-radius: 28px;
    box-shadow: 0 0 10px hsla(199, 67%, 50%, .7);
}
@media (max-width: 767px) { .anime_img_view { height: 340px; } }
.anime-subtitle { color: var(--an-muted); font-size: 14px; }
.story-movie { max-height: 220px; overflow-y: auto; padding-right: 4px; line-height: 1.7; }
.story-movie p:last-child { margin-bottom: 0; }

.anime-tabs { border-bottom: 2px solid var(--an-pink-soft); }
.anime-tabs .nav-link {
    color: #e0457b;
    border: 0;
    border-radius: 12px 12px 0 0;
    padding: .4rem .8rem;
    font-size: 14px;
}
.anime-tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, #ff8fb1, #ffbac3);
}
.anime-tab-pane { padding: 4px 0; }
.anime-tab-pane .badge { min-width: 26px; }

.genre-badges { line-height: 2; }
.badge-anime {
    display: inline-block;
    margin: 0 4px 6px 0;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #fff !important;
    border-radius: 12px;
    background: #2cafec;
    transition: background .15s ease;
}
.badge-anime:nth-child(3n+2) { background: #ff8fb1; }
.badge-anime:nth-child(3n+3) { background: #7cc576; }
.badge-anime:hover { background: #e0457b; }

.bl_tags { font-size: 14px; color: var(--an-muted); }

/* ---------- WATCH ONLINE box ---------- */
.watch {
    position: relative;
    background: var(--an-pink-bg);
    margin: 28px 5px 12px;
    padding-top: 10px;
    border-radius: 6px;
    border: 2px dashed #fff;
    box-shadow: 0 0 0 5px var(--an-pink-ring);
}
.watch-title { position: absolute; top: -18px; left: 8px; z-index: 1; }
.watch-view { position: absolute; top: -18px; right: 8px; z-index: 1; }
.watch-title span,
.watch-view span {
    display: inline-block;
    font-size: .85em;
    letter-spacing: normal;
    padding: 5px 15px 5px 30px;
    color: #fff;
    border-radius: 4px;
    background: url(../img/play.png) no-repeat #16adff;
    background-size: 18px 18px;
    background-position: 6px center;
}
.watch-view span { background-image: url(../img/view.png); }
.watch-ul { margin: 8px 8px 8px; }

.ep-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 4px 6px;
}
.watch-li {
    display: flex;
    align-items: center;
    min-height: 32px;
    padding-right: 8px;
    background: #fff;
    border-radius: 4px;
    color: var(--an-green);
    font-weight: 500;
    font-size: 14px;
    overflow: hidden;
    transition: background .15s ease, transform .15s ease;
}
.watch-li:hover { background: #fff2f7; color: var(--an-red); transform: translateX(2px); }
.watch-li.active { background: var(--an-red); color: #fff; }
.watch-li.active .watch-icon { background-color: #c73232; }
.watch-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 4px;
    background: url(../img/play.png) center center no-repeat #ff5151;
    background-size: 20px;
}
.watch-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ปุ่มเลือกเครื่องเล่น */
.player-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0 8px;
    border-bottom: 2px solid #fff;
    padding-bottom: 6px;
}
.btn-player {
    color: var(--an-red);
    background: #fff;
    border: 0;
    border-radius: 14px 14px 4px 4px;
    padding: 4px 12px;
}
.btn-player:hover { color: #fff; background: #ff8fb1; }
.btn-player.current, .btn-player.active { color: #fff; background: var(--an-blue); }
.player { background: #000; border-radius: 6px; overflow: hidden; }

.tools-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 10px 8px 0;
}
.tools-container .btn { border-radius: 18px; font-size: 14px; }

/* ---------- Sidebar ---------- */
.list-group-item { border-color: #f6e3ea; font-size: 14px; color: var(--an-text); }
.list-group-item-action:hover { background: #fff3f7; color: #e0457b; }
.list-group-item:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.list-group-item:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.list-trendin { border: none; padding: .45rem .4rem; }
.image-trendin {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    object-fit: cover;
    border: 2px solid var(--an-pink-soft);
    border-radius: 50%;
}
.title-trending {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 600;
}
.app-social {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 12px;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    border-radius: 10px;
    background-color: rgba(58, 85, 159, 1);
}
.app-social:last-child { margin-bottom: 0; }
.app-social i { font-size: 20px; }
.app-social:hover { filter: brightness(1.08); }

/* ---------- Pagination ---------- */
.pagination { flex-wrap: wrap; gap: 4px; }
.pagination .page-link {
    color: #e0457b;
    border: 0;
    border-radius: 50% !important;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 4px var(--an-sky);
}
.pagination .page-item.active .page-link { color: #fff; background: linear-gradient(135deg, #00c2ff, #ff8fb1); }
.pagination .page-item.dot .page-link { box-shadow: none; background: transparent; }

/* ---------- Forms ---------- */
.form-control, .form-select, .input-group-text {
    border-color: var(--an-pink-soft);
    border-radius: 14px;
}
.input-group > .input-group-text { background: #fff3f7; color: #e0457b; }
.form-control:focus, .form-select:focus {
    border-color: #ff8fb1;
    box-shadow: 0 0 0 .2rem rgba(255, 143, 177, .25);
}
.form-floating > label { color: var(--an-muted); }

/* ---------- 404 ---------- */
.anime-404 { padding: 30px 10px; }
.anime-404__code {
    font-family: Itim, sans-serif;
    font-size: 96px;
    line-height: 1;
    color: #ff8fb1;
    text-shadow: 4px 4px 0 #b9ecff;
    margin-bottom: 12px;
}
.anime-404 .btn { margin: 4px; }

.blog-content { line-height: 1.8; }
.blog-content img { max-width: 100%; height: auto; }

/* ---------- Footer ---------- */
.footer-text { font-size: 14px; color: var(--an-muted); }
.footer-anime {
    margin-top: 24px;
    padding: 12px 0;
    color: #3a5f74;
    box-shadow: 0 0 10px #75ddfb;
    background-color: #fff;
    background-image: linear-gradient(rgba(0, 194, 255, .32), #daf8f8 60%, rgba(252, 195, 203, .36));
}
.footer-anime__name { font-family: Itim, sans-serif; font-size: 18px; color: #e0457b; }
.footer-anime__desc { font-size: 13px; }
.footer-anime__copy { font-size: 12px; opacity: .8; }
.btn-backtop {
    display: inline-block;
    padding: 4px 14px;
    font-size: 13px;
    color: #fff !important;
    border-radius: 14px;
    background: #2cafec;
}

/* ---------- Modal ---------- */
.modal-content { border: 0; border-radius: 16px; box-shadow: 0 0 8px var(--an-sky); }
.modal-header {
    color: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background-image: linear-gradient(-225deg, #00c2ff 0%, #e9f8f7 56%, #ffbac3 100%);
    text-shadow: 0 1px 2px rgba(0, 80, 120, .45);
}

/* ---------- Ads ---------- */
.ad-zone { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ad-zone .item { flex: 1 1 100%; text-align: center; }
.img-ad { max-width: 100%; height: auto; border-radius: 10px; }
.ads-fixed { position: fixed; z-index: 1030; background: #fff; border-radius: 10px; box-shadow: 0 0 6px var(--an-sky); padding: 4px; }
.ads-fixed .img-ad { max-height: 600px; }
.ads-left { left: 4px; top: 120px; max-width: 160px; }
.ads-right { right: 4px; top: 120px; max-width: 160px; }
.ads-bottom { left: 50%; bottom: 4px; transform: translateX(-50%); max-width: 740px; width: calc(100% - 8px); }
.ads-bottom .img-ad { max-height: 110px; }
.ads-close { cursor: pointer; font-size: 12px; padding-bottom: 2px; }
@media (max-width: 991.98px) { .ads-left, .ads-right { display: none; } }

#p9fe {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 20px; text-align: center;
    background: rgba(255, 229, 239, .97);
}
.p9fe-title { font-size: 22px; color: #e0457b; }

/* ---------- Placeholder (load more) ---------- */
.placeholder.img_anime { background-color: var(--an-pink-soft); opacity: .6; cursor: default; }

@media (max-width: 480px) {
    .header-wrapper { padding: 6px 0; }
    .logo-page { max-height: 110px; }
    .logo-text { padding: 18px 6px; }
    .watch { margin-left: 2px; margin-right: 2px; }
    .ep-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* app.js ใส่ class sticky ให้ .mainmenu ตอนเลื่อนหน้า — ใช้ position: sticky จะได้ไม่กระตุก */
.navbar-s.mainmenu { position: sticky; top: 0; z-index: 1020; }
.navbar-s.sticky { background-image: linear-gradient(to bottom, var(--an-coral), rgba(230, 132, 129, .9)); box-shadow: 0 2px 6px rgba(230, 132, 129, .35); }
