/* PHIM MỚI Section */
.main .news-post {
    background-color: rgb(187, 25, 72);
    padding: 30px 15px 40px;
    margin-bottom: 25px;
    width: 100%;
    box-sizing: border-box;
}

.main .news-post .bg .featured-post {
    max-width: 1420px;
    width: 95%;
    position: relative;
    margin: 0 auto;
}

.main .news-post .bg .featured-post .title h2 {
    color: #fff;
    font-size: 28px;
    text-align: center;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 45px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.main .news-post .bg .featured-post .title .horizontal-mini {
    background-color: #fff;
    height: 1px;
    margin: 0 auto;
    max-width: 75px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.main .news-post .bg .featured-post .title .horizontal {
    background-color: #fff;
    height: 1px;
    margin: 0 auto;
    max-width: 150px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.main .news-post .bg .featured-post .title .horizontal-mini1 {
    background-color: #fff;
    height: 1px;
    margin: 0 auto;
    max-width: 75px;
    margin-bottom: 25px;
    opacity: 0.9;
}

/* PHIM MỚI Carousel */
.main .news-post .bg .featured-post .movie-carousel-wrapper {
    position: relative;
    width: 100%;
}

.main .news-post .bg .featured-post .movie-news {
    display: flex;
    gap: 20px;
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 6px 0 10px;
    -webkit-overflow-scrolling: touch;
}

.main .news-post .bg .featured-post .movie-news::-webkit-scrollbar {
    display: none;
}

.main .news-post .bg .featured-post .movie-news.is-dragging {
    scroll-behavior: auto;
    cursor: grabbing;
}

.main .news-post .bg .featured-post .movie-news .item {
    flex: 0 0 calc((100% - 60px) / 4);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

/* Carousel Navigation Buttons (Prev / Next) */
.movie-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(18, 22, 36, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    padding: 0;
    outline: none;
}

.movie-carousel-btn svg {
    width: 15px;
    height: 15px;
    fill: #ffffff;
    transition: transform 0.2s ease;
}

.movie-carousel-btn.prev-btn {
    left: -22px;
}

.movie-carousel-btn.next-btn {
    right: -22px;
}

.movie-carousel-btn:hover {
    background-color: #eb3941;
    border-color: #eb3941;
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 6px 20px rgba(235, 57, 65, 0.55);
}

.movie-carousel-btn.prev-btn:hover svg {
    transform: translateX(-2px);
}

.movie-carousel-btn.next-btn:hover svg {
    transform: translateX(2px);
}

.movie-carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* List Movies Grid (All Sources) */
.main .all-source .source .list-movies {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

.main .news-post .bg .featured-post .movie-news .item,
.main .all-source .source .list-movies .item {
    position: relative;
    aspect-ratio: 1 / 1.37;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background-color: #1a1a24;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main .news-post .bg .featured-post .movie-news .item:hover,
.main .all-source .source .list-movies .item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.main .news-post .bg .featured-post .movie-news .item img,
.main .all-source .source .list-movies .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.main .news-post .bg .featured-post .movie-news .item:hover img,
.main .all-source .source .list-movies .item:hover img {
    transform: scale(1.08);
}

/* Status Badge on Top Left */
.item .tag-content {
    pointer-events: none;
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 13px;
    padding: 4px 10px;
    background-color: #eb093a;
    color: #fff;
    border-radius: 8px;
    z-index: 10;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

.item .tag-content b {
    font-weight: 700;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
}

.item .tag-content .tag-icon,
.item .tag-content i {
    font-size: 12.5px;
    margin-right: 4px;
}

.main .news-post .bg .featured-post .movie-news .item a,
.main .all-source .source .list-movies .item a,
.continue-watching-track .item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.main .news-post .bg .featured-post .movie-news .item a::after,
.main .all-source .source .list-movies .item a::after,
.continue-watching-track .item a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(0, rgb(49 38 41 / 73%) 10%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Movie Info Overlay */
.main .news-post .bg .featured-post .movie-news .item .info,
.main .all-source .source .list-movies .item .info,
.continue-watching-track .item .info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-image: linear-gradient(to bottom, transparent 0%, rgba(4, 12, 62, 0.6) 40%, #040c3e 100%);
    padding: 10px 12px 38px 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    pointer-events: none;
    z-index: 2;
}

.main .news-post .bg .featured-post .movie-news .item .info .title,
.main .all-source .source .list-movies .item .info .title-movies,
.continue-watching-track .item .info .title {
    padding: 0;
    width: 100%;
    text-align: center;
}

.main .news-post .bg .featured-post .movie-news .item .info .title span,
.main .all-source .source .list-movies .item .info .title-movies span,
.continue-watching-track .item .info .title span {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    margin: 0 auto;
    transition: color 0.25s ease;
    text-shadow: 1px 1px 1px #b20000;
    pointer-events: auto;
}

.main .news-post .bg .featured-post .movie-news .item .info .title span:hover,
.main .all-source .source .list-movies .item .info .title-movies span:hover,
.continue-watching-track .item .info .title span:hover {
    color: #ff5252;
}

/* ALL SOURCE SECTIONS */
.main .all-source {
    max-width: 1420px;
    width: 95%;
    margin: 30px auto;
}

.main .all-source .source {
    margin-bottom: 35px;
}

.main .all-source .source .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #101121;
    padding: 7px 12px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    margin-bottom: 18px;
}

.main .all-source .source .title .title_name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main .all-source .source .title .title_name img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    background-color: #fff;
    background-size: cover;
    background-position: center;
}

.main .all-source .source .title .title_name h2 {
    font-size: 20px;
    color: #e8e8e8;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.main .all-source .source .title a,
.continue-watching-title-bar a.btn-clear-history {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #f44;
    color: #fff;
    padding: 6px 20px;
    min-width: 125px;
    height: 36px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid #f44;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 68, 68, 0.25);
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
    white-space: nowrap;
}

.main .all-source .source .title a:hover,
.continue-watching-title-bar a.btn-clear-history:hover {
    background-color: #f83b3b;
    border-color: #f83b3b;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 68, 68, 0.35);
    color: #fff;
}

.main .all-source .source .title a i,
.continue-watching-title-bar a.btn-clear-history i {
    font-size: 13px;
    margin-right: 2px;
}

.main .all-source .source .list-movies {
    margin-bottom: 10px;
    margin-top: 0;
}

/* Xem Tất Cả button */
.all-view {
    text-align: center;
    margin: 35px 0 50px;
}

.all-view h2 a {
    display: inline-block;
    padding: 10px 28px;
    background-color: #f44;
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid #f44;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.all-view h2 a:hover {
    background-color: #f83b3b;
    border-color: #f83b3b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 68, 68, 0.45);
}

/* ==========================================================================
   TIẾP TỤC XEM / CONTINUE WATCHING (LocalStorage)
   ========================================================================== */
.continue-watching-section {
    width: 100%;
    margin: 5px 0 35px 0;
    box-sizing: border-box;
}

.continue-watching-inner {
    max-width: 1420px;
    width: 95%;
    margin: 0 auto;
    position: relative;
}

.continue-watching-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #101121;
    padding: 7px 12px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    margin-bottom: 18px;
}

.continue-watching-title-bar .title_name,
.continue-watching-title-bar .title-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.continue-watching-title-bar .title_name .cw-icon,
.continue-watching-title-bar .title-left .cw-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eb3941, #bb1948);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.continue-watching-title-bar .title_name h2,
.continue-watching-title-bar .title-left h2 {
    font-size: 20px;
    color: #e8e8e8;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.continue-watching-title-bar .title_name .cw-count-badge,
.continue-watching-title-bar .title-left .cw-count-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(235, 57, 65, 0.2);
    color: #ff6b72;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid rgba(235, 57, 65, 0.35);
    line-height: 1.2;
}

.continue-watching-carousel-wrapper {
    position: relative;
    width: 100%;
}

.continue-watching-track {
    display: flex;
    gap: 20px;
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0 10px;
    -webkit-overflow-scrolling: touch;
}

.continue-watching-track::-webkit-scrollbar {
    display: none;
}

.continue-watching-track.is-dragging {
    scroll-behavior: auto;
    cursor: grabbing;
}

.continue-watching-track .item {
    position: relative;
    flex: 0 0 calc((100% - 60px) / 4);
    aspect-ratio: 1 / 1.37;
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background-color: #1a1a24;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.25s ease;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

.continue-watching-track .item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.continue-watching-track .item.is-removing {
    transform: scale(0.85);
    opacity: 0;
}

.continue-watching-track .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.continue-watching-track .item:hover img {
    transform: scale(1.05);
}

.continue-watching-track .item .tag-content {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #eb093a;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 46px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.continue-watching-track .item .tag-content i {
    font-size: 12.5px;
    margin-right: 2px;
}

.continue-watching-track .item .cw-btn-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: rgba(18, 22, 36, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    opacity: 0;
    padding: 0;
}

.continue-watching-track .item:hover .cw-btn-remove {
    opacity: 1;
}

.continue-watching-track .item .cw-btn-remove:hover {
    background-color: #eb3941;
    border-color: #eb3941;
    transform: scale(1.15);
}

.continue-watching-track .item .cw-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 3;
    pointer-events: none;
}

.continue-watching-track .item:hover .cw-play-overlay {
    opacity: 1;
}

.continue-watching-track .item .cw-play-overlay .cw-play-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(235, 57, 65, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(235, 57, 65, 0.5);
    transform: scale(0.85);
    transition: transform 0.25s ease;
    padding-left: 3px;
}

.continue-watching-track .item:hover .cw-play-overlay .cw-play-icon {
    transform: scale(1);
}

.continue-watching-track .item .cw-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 5;
}

.continue-watching-track .item .cw-progress-fill {
    height: 100%;
    width: 75%;
    background: linear-gradient(90deg, #bb1948, #eb3941);
    box-shadow: 0 0 8px rgba(235, 57, 65, 0.8);
}

.cw-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(18, 22, 36, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    padding: 0;
    outline: none;
}

.cw-carousel-btn svg {
    width: 15px;
    height: 15px;
    fill: #ffffff;
    transition: transform 0.2s ease;
}

.cw-carousel-btn.prev-btn {
    left: -22px;
}

.cw-carousel-btn.next-btn {
    right: -22px;
}

.cw-carousel-btn:hover {
    background-color: #eb3941;
    border-color: #eb3941;
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 6px 20px rgba(235, 57, 65, 0.55);
}

.cw-carousel-btn.prev-btn:hover svg {
    transform: translateX(-2px);
}

.cw-carousel-btn.next-btn:hover svg {
    transform: translateX(2px);
}

.cw-carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Responsive Grid & Carousel */
@media (max-width: 1200px) {
    .movie-carousel-btn.prev-btn,
    .cw-carousel-btn.prev-btn {
        left: -14px;
    }
    .movie-carousel-btn.next-btn,
    .cw-carousel-btn.next-btn {
        right: -14px;
    }
}

@media (max-width: 991px) {
    .main .all-source .source .list-movies {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    /* Máy tính bảng (Tablet): Hiển thị đúng 6 item (2 hàng x 3 cột) */
    .main .all-source .source .list-movies .item:nth-child(n+7) {
        display: none;
    }

    .main .news-post .bg .featured-post .movie-news,
    .continue-watching-track {
        gap: 15px;
    }

    .main .news-post .bg .featured-post .movie-news .item,
    .continue-watching-track .item {
        flex: 0 0 calc((100% - 30px) / 3);
    }

    .movie-carousel-btn,
    .cw-carousel-btn {
        width: 38px;
        height: 38px;
    }

    .movie-carousel-btn.prev-btn,
    .cw-carousel-btn.prev-btn {
        left: -10px;
    }

    .movie-carousel-btn.next-btn,
    .cw-carousel-btn.next-btn {
        right: -10px;
    }

    .movie-carousel-btn svg,
    .cw-carousel-btn svg {
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 680px) {
    .main .all-source .source .list-movies {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Điện thoại (Mobile): Giữ nguyên 4 item (2 hàng x 2 cột) */
    .main .all-source .source .list-movies .item:nth-child(n+5) {
        display: none;
    }

    .main .news-post .bg .featured-post .movie-news,
    .continue-watching-track {
        gap: 12px;
    }

    .main .news-post .bg .featured-post .movie-news .item,
    .continue-watching-track .item {
        flex: 0 0 calc((100% - 12px) / 2);
    }

    .continue-watching-track .item .cw-btn-remove {
        opacity: 0.85;
        width: 24px;
        height: 24px;
    }

    .continue-watching-title-bar .title_name h2,
    .continue-watching-title-bar .title-left h2,
    .main .all-source .source .title .title_name h2 {
        font-size: 16px;
    }

    .main .all-source .source .title a,
    .continue-watching-title-bar a.btn-clear-history {
        padding: 5px 14px;
        font-size: 12px;
        height: 30px;
        min-width: 95px;
    }

    .movie-carousel-btn,
    .cw-carousel-btn {
        width: 34px;
        height: 34px;
        display: flex !important;
    }

    .movie-carousel-btn.prev-btn,
    .cw-carousel-btn.prev-btn {
        left: -6px;
    }

    .movie-carousel-btn.next-btn,
    .cw-carousel-btn.next-btn {
        right: -6px;
    }

    .movie-carousel-btn svg,
    .cw-carousel-btn svg {
        width: 11px;
        height: 11px;
    }

    .main .news-post {
        padding: 20px 10px 25px;
    }
    .main .news-post .bg .featured-post .title h2 {
        font-size: 22px;
        line-height: 35px;
    }
}
