/* =========================================================
   Trang Phim - dien mao rieng (xanh la nhat / mint-green), phan biet voi
   Trang Truyen (be/tan), Trang Tho (hong), Trang Nhac (xanh da troi).
   Chi load trong Areas/Phim/Views/Shared/_Phimlayout.cshtml.
   Nen chinh (.nenphimchinh / .nenphimtrai / .nentieude7) da co san trong
   base.css, file nay chi bo sung phan base.css/danhsach.css chua co.
   ========================================================= */

/* ---- Lam nhat hinh nen tieu de trang trai (nenphim.png qua ron, chu +
   chi tiet bi lan vao nen) - phu 1 lop trang mo len tren anh nen bang
   linear-gradient, chi anh huong lop background (khong lam mo chu vi chu
   la noi dung DOM rieng, khong phai lop background). ---- */
.nentieude7 {
    background: linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)), url(/images/nenphim.png) no-repeat center top;
}

/* ---- Thanh chuyen doi cach sap xep ---- */
.phim-sort-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 22px;
}

.phim-sort-tab {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    background-color: #dcf3e3;
    color: #1f6b3e !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid #a8dfc0;
    box-shadow: 0 1px 3px rgba(31, 107, 62, 0.15);
    transition: all .2s ease;
}

.phim-sort-tab:hover {
    background-color: #c7ecd2;
    transform: translateY(-1px);
}

.phim-sort-tab.active {
    background-color: #2f8f4e;
    color: #fff !important;
    border-color: #2f8f4e;
}

@media (max-width: 600px) {
    .phim-sort-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        margin: 4px -4px 18px;
    }

    .phim-sort-tabs::-webkit-scrollbar {
        display: none;
    }

    .phim-sort-tab {
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
}

/* ---- Dropdown "Tim theo the loai" o sidebar ----
   base.css co rule "#letrai select" (id + element, specificity cao hon
   class thuong) dat mau xanh reu/oliu cho MOI the select trong khung
   sidebar - phai ghi de bang selector cung gan id #letrai moi thang duoc,
   giong cach Nhac/Tho da xu ly. */
.phim-dropdown-box {
    margin-bottom: 10px;
    padding: 0 10px;
}

#letrai .phim-dropdown-box select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #a8dfc0 !important;
    background-color: #fff !important;
    background-image: none !important;
    color: #1f6b3e !important;
    box-shadow: none !important;
}

#letrai .phim-dropdown-box option {
    background-color: #fff !important;
    color: #1f6b3e !important;
    border-top: none !important;
}

/* ---- Diem nhan xanh la cho cac khoi sidebar dung chung ---- */
.nenphimtrai .sidebar-title {
    color: #1f6b3e;
    border-bottom-color: #a8dfc0;
}

/* ---- Sua loi anh sao de len chu "luot xem" trong sidebar ----
   base.css co rule cu "#letrai img { position:absolute; }" khien MOI anh
   trong khung sidebar Phim (ke ca sao10.gif tung dong) bi keo ra khoi
   dong chay binh thuong va de chong len dong "X luot xem" ben duoi. */
#letrai .truyen-stars img {
    position: static !important;
    z-index: auto !important;
}

/* ---- Hop goi y tim kiem nhanh ---- */
#phim-search-box {
    position: relative;
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #f2faf4;
    border: 1px solid #c3e6cc;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    margin-top: 4px;
    max-height: 320px;
    overflow-y: auto;
}

.suggestions-box .suggestion-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.suggestions-box .suggestion-list li {
    padding: 8px 14px;
    border-bottom: 1px solid #e3f2e6;
}

.suggestions-box .suggestion-list li:last-child {
    border-bottom: none;
}

.suggestions-box .suggestion-list a {
    color: #1f6b3e;
    font-weight: bold;
    text-decoration: none;
}

.suggestions-box .suggestion-list a:hover {
    text-decoration: underline;
}

.suggestions-box .text-muted {
    color: #888;
    font-size: 12px;
}

/* ---- The phim trong danh sach chinh ---- */
.phim-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.phim-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 14px;
    padding: 14px 20px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(31, 107, 62, 0.12);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.phim-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 12px rgba(31, 107, 62, 0.18);
}

.phim-item-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}

.phim-item-stars {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phim-item-stars img {
    height: 16px;
}

.phim-item-titlerow {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: nowrap;
}

.phim-item-title {
    font-size: 19px;
    font-weight: bold;
    color: #1f6b3e !important;
    text-decoration: none !important;
    line-height: 1.5;
    flex: 1 1 0;
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phim-item-title:hover {
    color: #2f8f4e !important;
}

.phim-item-soTap {
    display: inline-block;
    font-size: 12px;
    color: #1f6b3e;
    background: #dcf3e3;
    border: 1px solid #a8dfc0;
    border-radius: 10px;
    padding: 2px 9px;
    white-space: nowrap;
    flex-shrink: 0;
}

.phim-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    max-width: 42%;
    text-align: right;
}

.phim-item-daodien,
.phim-item-theloai {
    font-size: 14px;
    font-weight: normal;
    color: #2a7d4e !important;
    text-decoration: none !important;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phim-item-daodien:hover,
.phim-item-theloai:hover {
    text-decoration: underline !important;
}

.phim-item-views {
    display: inline-block;
    font-size: 13px;
    color: #555;
    background: #fff;
    border: 1px solid #a8dfc0;
    border-radius: 12px;
    padding: 3px 12px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .phim-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .phim-item-side {
        align-items: flex-start;
        max-width: 100%;
        text-align: left;
    }
}

/* ---- Trang xem phim ---- */
#vntqReaderBox .nentruyen2 {
    min-height: 200px;
}

#vntqReaderBox .nentruyen1 {
    margin-top: 10px;
}

.phim-media-box {
    margin: 18px 0;
}

.phim-media-box video,
.phim-media-box iframe {
    outline: none;
    border-radius: 8px;
}

.phim-tap-select {
    margin: 10px 0 18px;
}

.phim-tap-select select {
    width: 100%;
    max-width: 480px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #a8dfc0;
    color: #1f6b3e;
    font-weight: bold;
}

.phim-dienvien-line {
    margin: 10px 0 4px;
    font-size: 14px;
}

.phim-dienvien-line a {
    color: #2a7d4e !important;
    text-decoration: none !important;
}

.phim-dienvien-line a:hover {
    text-decoration: underline !important;
}

.phim-nguoi-anh {
    max-width: 220px;
    border-radius: 8px;
    margin: 10px 0;
}

.vntq-dark-mode #vntqTextContent,
.vntq-dark-mode #vntqTextContent * {
    color: #b3d1bb !important;
    background-color: transparent !important;
    text-shadow: none !important;
}

.vntq-dark-mode blockquote {
    background: #1a271e !important;
    border-color: #3a594a !important;
}

.vntq-dark-mode blockquote p {
    color: #cfe8d4 !important;
    background-image: none !important;
}

#vntqReaderBox.vntq-dark-mode,
.vntq-dark-mode .nentieude7 {
    background-image: none !important;
}

#vntqReaderBox .vntq-reader-title {
    font-weight: bold !important;
    color: rgba(31, 107, 62, 0.85) !important;
    text-shadow: none !important;
    letter-spacing: 0.5px;
    margin-top: 20px !important;
    margin-bottom: 18px !important;
}

#vntqReaderBox .vntq-author-top {
    margin-bottom: 6px;
    padding-bottom: 14px;
}

#vntqReaderBox .vntq-author-top a {
    color: #1f6b3e !important;
}

#vntqReaderBox .vntq-stats-container {
    margin-bottom: 20px;
}

/* ---- Khung tieu de (.nentieude7, anh nen hac tren canh thong) - them
   khoang dem tren de day noi dung xuong, giong cach da lam cho Nhac. ---- */
#vntqReaderBox .nentieude7 {
    min-height: 280px;
    padding-top: 50px;
    box-sizing: border-box;
}

.chuto50,
.chuto40,
.chuto30,
.chutieude {
    color: #1f6b3e !important;
    font-weight: bold !important;
}

/* ---- Khoi "Cung dao dien / cung dien vien" cuoi trang xem ---- */
.phim-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.phim-related-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(31, 107, 62, 0.25);
    border-radius: 8px;
    text-decoration: none !important;
    transition: background .2s ease, transform .2s ease;
}

.phim-related-item:hover {
    background: rgba(255, 255, 255, 0.65);
    transform: translateY(-1px);
}

.phim-related-title {
    font-size: 16px;
    color: #1f6b3e !important;
    line-height: 1.3;
}

.vntq-dark-mode .phim-related-item {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.vntq-dark-mode .phim-related-title {
    color: #8fe0a8 !important;
}

@media (max-width: 480px) {
    .phim-related-grid {
        grid-template-columns: 1fr;
    }
}
