/* =========================================================
   Trang Anh (Tranh Anh) - dien mao rieng (tim lavender nhat / bokeh),
   phan biet voi Truyen (be/tan), Tho (hong), Nhac (xanh da troi),
   Phim (xanh la/mint-green). Chi load trong
   Areas/Anh/Views/Shared/_Anhlayout.cshtml.
   Nen chinh (.nenanhchinh / .nenanhtrai / .nentieude6) da co san trong
   base.css (nenanhchinh.jpg, nenanhtrai.jpg, nenanh1.png - da xac nhan
   qua anh thuc te, khong can lam nhat nhu .nentieude7 cua Phim vi
   nenanh1.png da nhat mau san). File nay chi bo sung phan
   base.css/danhsach.css chua co: luoi anh (grid) - day la muc ANH,
   khong phai danh sach van ban nhu cac muc khac.
   ========================================================= */

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

.anh-sort-tab {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    background-color: #ece2f7;
    color: #5c3a8c !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid #cbb3e6;
    box-shadow: 0 1px 3px rgba(92, 58, 140, 0.15);
    transition: all .2s ease;
}

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

.anh-sort-tab.active {
    background-color: #6a3f9c;
    color: #fff !important;
    border-color: #6a3f9c;
}

@media (max-width: 600px) {
    .anh-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;
    }

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

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

/* ---- Nut chon che do Sang/Toi (dat tren o "Tim theo the loai") ---- */
.anh-theme-switch {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
}

.anh-theme-btn {
    padding: 4px 12px;
    border: 1px solid #cbb3e6;
    border-radius: 14px;
    background: #fff;
    color: #5c3a8c;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

    .anh-theme-btn.anh-theme-active {
        border-color: #6a3f9c;
        background: linear-gradient(135deg, #ece2f7, #ddc9f0);
        color: #5c3a8c;
    }

/* ---- Dropdown "Tim theo the loai" o sidebar ---- */
.anh-dropdown-box {
    margin-bottom: 10px;
    padding: 0 10px;
}

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

#letrai .anh-dropdown-box option {
    background-color: #fff !important;
    color: #5c3a8c !important;
    border-top: none !important;
}

.nenanhtrai .sidebar-title {
    color: #5c3a8c;
    border-bottom-color: #cbb3e6;
}

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

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #f7f2fb;
    border: 1px solid #d9c6ec;
    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 #ece0f7;
}

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

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

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

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

/* =========================================================
   Luoi anh (grid) - day la KHAC BIET chinh so voi cac muc khac: Anh la
   1 thu vien anh/tranh (goc hien thi luoi thumbnail), khong phai danh
   sach van ban dang .xxx-list/.xxx-item. Khong dung lai .phim-item/
   .tho-item (list-row) vi bo cuc can 1 grid thumbnail-first, khong phai
   1 dong text.
   ========================================================= */
.anh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 10px 0 20px;
    list-style: none;
    padding: 0;
}

.anh-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(92, 58, 140, 0.12);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.anh-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 14px rgba(92, 58, 140, 0.2);
}

.anh-card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #eee;
    overflow: hidden;
    cursor: zoom-in;
}

.anh-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.anh-card-thumb:hover img {
    transform: scale(1.06);
}

.anh-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px 12px;
    min-width: 0;
}

.anh-card-title {
    font-size: 15px;
    font-weight: bold;
    color: #5c3a8c;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.anh-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.anh-card-tacgia,
.anh-card-theloai {
    font-size: 12.5px;
    color: #7a56ab !important;
    text-decoration: none !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    display: block;
}

.anh-card-tacgia:hover,
.anh-card-theloai:hover {
    text-decoration: underline !important;
}

.anh-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.anh-card-stars img {
    height: 14px;
    display: block;
}

.anh-card-views {
    font-size: 11.5px;
    color: #666;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .anh-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .anh-card-title {
        font-size: 13.5px;
    }
}

/* ---- Lightbox (thay highslide - khong co san trong wwwroot, tu lam nhe,
   khong phu thuoc CDN ngoai) ---- */
.anh-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(20, 10, 30, 0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}

.anh-lightbox img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
}

.anh-lightbox-title {
    max-width: min(90vw, 700px);
    margin-top: 14px;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    cursor: default;
}

.anh-lightbox-caption {
    max-width: min(90vw, 700px);
    margin-top: 14px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #f1e9fb;
    font-style: italic;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    cursor: default;
}

.anh-lightbox-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 14px;
    cursor: default;
}

.anh-lightbox-stars {
    font-size: 30px;
    letter-spacing: 4px;
    line-height: 1;
}

.anh-star {
    font-style: normal;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
    display: inline-block;
}

.anh-star:hover {
    transform: scale(1.12);
}

.anh-star.filled {
    color: #ffcc33;
    text-shadow: 0 0 6px rgba(255, 204, 51, 0.5);
}

.anh-lightbox-rating-label {
    font-size: 13px;
    color: #d9c9ee;
    min-height: 16px;
}

.anh-lightbox-close {
    position: absolute;
    top: 18px;
    right: 28px;
    font-size: 38px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    font-weight: 300;
    z-index: 5001;
}

/* ---- Khoi sidebar (5 sao / xem nhieu) - thumbnail + ten + sao + luot xem ---- */
.anh-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.anh-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(203, 179, 230, 0.4);
}

.anh-sidebar-item:last-child {
    border-bottom: none;
}

.anh-sidebar-thumb {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    display: block;
    cursor: zoom-in;
}

.anh-sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.anh-sidebar-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.anh-sidebar-name {
    font-size: 12.5px;
    color: #5c3a8c;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.anh-sidebar-stars {
    height: 11px;
}

.anh-sidebar-views {
    font-size: 11px;
    color: #777;
}

/* base.css co rule "#letrai img { position:absolute; }" khien anh thumbnail
   trong khung sidebar bi keo ra khoi dong chay binh thuong - ghi de nhu
   Phim da lam voi .truyen-stars img. */
#letrai .anh-sidebar-thumb img,
#letrai .anh-sidebar-stars {
    position: static !important;
    z-index: auto !important;
}

/* ---- Trang danh sach tac gia theo mau tu ---- */
.anh-tacgia-list {
    list-style: none;
    margin: 10px 0;
    padding: 0;
}

.anh-tacgia-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.anh-tacgia-name {
    font-weight: bold;
    color: #5c3a8c !important;
    text-decoration: none !important;
}

.anh-tacgia-name:hover {
    text-decoration: underline !important;
}

.anh-tacgia-soanh {
    font-size: 13px;
    color: #777;
}

/* ---- Trang 1 tac gia: tieu su + anh dai dien ---- */
.anh-tacgia-bio {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 10px 0 16px;
    flex-wrap: wrap;
}

.anh-tacgia-anhdaidien {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.anh-tacgia-tieusu {
    flex: 1 1 260px;
    font-size: 14.5px;
    line-height: 1.6;
    color: #333;
}
