/*
 * Slider Section Redesign
 * Làm cho TikTok video slider nhất quán với DarkMode theme.
 * Override các style trong style.css
 */

/* ── Bỏ floating card look ─────────────────────────────────── */
.top-videos-slider-wrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 0 20px !important;
    border-radius: 0 !important;
    transition: none !important;
}

.top-videos-slider-wrapper:hover {
    box-shadow: none !important;
    border-color: transparent !important;
}

.top-videos-slider-section {
    padding: 0 !important;
    margin: 0 auto 4px !important;
}

/* ── Heading: khớp với section heading của theme ────────────── */
.top-videos-slider-title h2 {
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    color: #f1f1f1 !important;
    padding-left: 12px !important;
    border-left: 3px solid #ff4757 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    /* baseline làm icon + badge "HOT" lệch cao/thấp so với chữ (icon glyph và
       pill badge không có baseline chuẩn) — center cho cả 3 thẳng hàng */
    align-items: center !important;
    gap: 8px !important;
}

.tiktok-icon {
    color: #ff4757 !important;
    font-size: 1rem !important;
}

/* Subtitle: ẩn mặc định, .home-refined bật lại trong index-page.css */
body:not(.home-refined) .title-subtitle {
    display: none !important;
}

.top-videos-slider-header {
    margin-bottom: 12px !important;
    align-items: center !important;
}

/* ── View-more → chip nhỏ, có hình khối rõ ràng ───────────────
   Bản trước là chữ xám trần không viền/nền — trên mobile (không có :hover)
   nhìn như chữ tĩnh, không rõ là bấm được. Đổi thành chip có nền/viền nhẹ +
   mũi tên, giữ nguyên type "text link, không phải nút to" nhưng có affordance. */
.view-more-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08)) !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    gap: 6px !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}

.view-more-btn::after {
    content: "\203A"; /* › */
    font-weight: 700;
    font-size: 0.95em;
    line-height: 1;
    transition: transform 0.2s ease;
}

.view-more-btn:hover,
.view-more-btn:focus-visible {
    background: rgba(255, 71, 87, 0.14) !important;
    border-color: rgba(255, 71, 87, 0.35) !important;
    color: #fff !important;
}

.view-more-btn:hover::after {
    transform: translateX(2px);
}

/* Phản hồi khi chạm trên mobile — không có :hover nên cần :active riêng */
.view-more-btn:active {
    background: rgba(255, 71, 87, 0.2) !important;
    border-color: rgba(255, 71, 87, 0.4) !important;
    color: #fff !important;
}

.view-more-count {
    background: rgba(255, 71, 87, 0.16) !important;
    color: var(--accent-tint, #ff8a9b) !important;
    padding: 1px 7px !important;
    border-radius: var(--radius-sm, 6px) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    transition: background 0.2s ease, color 0.2s ease !important;
}

.view-more-btn:hover .view-more-count,
.view-more-btn:active .view-more-count {
    background: var(--accent-strong, #C4293A) !important;
    color: #fff !important;
    transform: none !important;
}

/* ── Edge fade mask – hiệu ứng "peek" trên slide track ─────── */
#topVideosSlider .splide__track {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 5%,
        #000 95%,
        transparent 100%
    ) !important;
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 5%,
        #000 95%,
        transparent 100%
    ) !important;
    border-radius: 0 !important;
}

/* ── Khoảng cách giữa slides ────────────────────────────────── */
#topVideosSlider .splide__slide {
    padding: 0 3px !important;
}

/* ── Card: bo góc nhẹ, không border ────────────────────────── */
.top-video-card {
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease !important;
}

.top-video-card:hover {
    transform: translateY(-6px) scale(1.02) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 71, 87, 0.3) !important;
}

/* ── Hover/motion sinh động hơn ──────────────────────────────
   Ảnh zoom mạnh + mượt hơn, scrim đậm hơn, tiêu đề nhích lên,
   like-btn nảy nhẹ khi hover card, tim "pop" khi hover trực tiếp. */
.top-video-thumbnail img {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.top-video-card:hover .top-video-thumbnail img {
    transform: scale(1.12) !important;
}

.top-video-thumbnail::after {
    transition: background 0.35s ease !important;
}

.top-video-title-overlay {
    transition: transform 0.3s ease !important;
}

.top-video-card:hover .top-video-title-overlay {
    transform: translateY(-4px) !important;
}

.slider-like-btn {
    transition: background 0.25s ease, border-color 0.25s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.top-video-card:hover .slider-like-btn {
    transform: translateY(-2px) !important;
}

.slider-like-btn:hover i {
    animation: slider-heart-pop 0.4s ease;
}

@keyframes slider-heart-pop {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.4); }
}

/* Nút mũi tên + pagination: thêm phản hồi bấm rõ ràng hơn */
#topVideosSlider .splide__arrow {
    transition: all 0.25s ease, transform 0.2s ease !important;
}

#topVideosSlider .splide__arrow:hover {
    transform: scale(1.1) !important;
}

#topVideosSlider .splide__arrow:active {
    transform: scale(0.92) !important;
}

#topVideosSlider .splide__pagination__page {
    transition: all 0.3s ease, transform 0.2s ease !important;
}

#topVideosSlider .splide__pagination__page:hover {
    transform: scale(1.4) !important;
}

/* ── Giữ portrait (9:16) nhất quán trên MỌI màn hình ────────── */
@media (max-width: 768px) {
    .top-video-thumbnail {
        padding-bottom: 177.78% !important;
        aspect-ratio: unset !important;
        min-height: unset !important;
    }

    .top-videos-slider-wrapper {
        padding: 0 0 12px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .top-videos-slider-header {
        /* wrap thay vì ép 1 hàng: tiêu đề dài (icon + chữ + badge HOT) +
           "Xem thêm 999+" từng bị chật/đè nhau trên màn hình hẹp */
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        row-gap: 6px !important;
        gap: 8px !important;
    }

    .top-videos-slider-title {
        text-align: left !important;
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    .top-videos-slider-title h2 {
        min-width: 0;
    }

    .view-more-btn {
        /* giữ dạng chip (nền/viền/bo góc) trên mobile — đây mới là nơi cần rõ
           "bấm được" nhất vì không có :hover để gợi ý */
        width: auto !important;
        max-width: none !important;
        justify-content: flex-end !important;
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
        /* xuống hàng riêng, dồn về mép phải thay vì chen cạnh tiêu đề */
        margin-left: auto !important;
    }

    #topVideosSlider .splide__slide {
        padding: 0 2px !important;
    }

    /* perPage tăng 2→3 làm card hẹp lại (~⅓ màn hình) — thu nhỏ badge tim
       theo để không tràn/đè lên ảnh */
    .slider-like-btn {
        padding: 4px 8px !important;
        gap: 4px !important;
        font-size: 0.68rem !important;
    }

    .slider-like-btn i {
        font-size: 0.7rem !important;
    }
}

@media (max-width: 480px) {
    .top-videos-slider-title h2 {
        font-size: 14px !important;
    }

    .top-video-thumbnail {
        padding-bottom: 177.78% !important;
        aspect-ratio: unset !important;
        min-height: unset !important;
    }

    .top-videos-slider-wrapper {
        padding: 0 0 10px !important;
        margin: 0 !important;
    }

    .slider-like-btn {
        padding: 3px 6px !important;
        gap: 3px !important;
        font-size: 0.6rem !important;
    }

    .slider-like-btn i {
        font-size: 0.62rem !important;
    }
}
