/**
 * WP Reels Commerce - Frontend Styles
 *
 * @package   WP_Reels_Commerce
 * @author    Le Thuan
 * @copyright 2026 Le Thuan
 * @license   GPL-2.0-or-later
 * @link      https://lethuan.com/wp-reels-commerce
 * @version   1.3.3
 */

/* ========================================
   1. GLOBAL VARIABLES & RESET
======================================== */
:root {
    --wprc-primary: #ff3b5c;
    --wprc-secondary: #2d2d2d;
    --wprc-text-light: #ffffff;
    --wprc-text-dark: #333333;
    --wprc-overlay: rgba(0, 0, 0, 0.6);
    --wprc-border-radius: 12px;
    --wprc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --wprc-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========================================
   2. STORY SLIDER (HORIZONTAL)
======================================== */
.wprc-story-slider-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 3rem;
}

.wprc-story-slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
}

.wprc-story-slider::-webkit-scrollbar {
    display: none;
}

/* Story Card */
.wprc-story-card {
    flex: 0 0 auto;
    width: 140px;
    cursor: pointer;
    transition: var(--wprc-transition);
}

.wprc-story-card:hover {
    transform: translateY(-4px);
}

.wprc-story-thumbnail {
    position: relative;
    width: 140px;
    height: 200px;
    border-radius: var(--wprc-border-radius);
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: var(--wprc-shadow);
}

.wprc-story-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wprc-story-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wprc-text-light);
    opacity: 0.8;
}

.wprc-story-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wprc-overlay);
    opacity: 0;
    transition: var(--wprc-transition);
}

.wprc-story-card:hover .wprc-story-overlay {
    opacity: 1;
}

.wprc-play-icon {
    transform: scale(0.8);
    transition: var(--wprc-transition);
}

.wprc-story-card:hover .wprc-play-icon {
    transform: scale(1);
}

/* Story Info */
.wprc-story-info {
    margin-top: 0.75rem;
}

.wprc-story-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wprc-text-dark);
    margin: 0 0 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wprc-story-views {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #666;
}

.wprc-story-views svg {
    width: 16px;
    height: 16px;
}

/* Slider Navigation Buttons */
.wprc-slider-prev,
.wprc-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: white;
    box-shadow: var(--wprc-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--wprc-transition);
    color: var(--wprc-secondary);
}

.wprc-slider-prev:hover,
.wprc-slider-next:hover {
    background: var(--wprc-primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.wprc-slider-prev {
    left: 0;
}

.wprc-slider-next {
    right: 0;
}

/* ========================================
   3. ARCHIVE PAGE - GRID LAYOUT
======================================== */
.wprc-archive-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Sidebar Navigation */
.wprc-collections-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.wprc-collections-sidebar h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--wprc-text-dark);
}

.wprc-collections-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wprc-collections-list li {
    margin-bottom: 0.5rem;
}

.wprc-collections-list a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--wprc-text-dark);
    text-decoration: none;
    transition: var(--wprc-transition);
}

.wprc-collections-list a:hover,
.wprc-collections-list a.active {
    background: var(--wprc-primary);
    color: white;
}

/* Grid Layout */
.wprc-reels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.wprc-reel-card {
    cursor: pointer;
    transition: var(--wprc-transition);
}

.wprc-reel-card:hover {
    transform: translateY(-4px);
}

.wprc-reel-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: var(--wprc-border-radius);
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: var(--wprc-shadow);
}

.wprc-reel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wprc-reel-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

.wprc-reel-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.wprc-reel-views,
.wprc-reel-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.wprc-reel-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0.5rem 0 0;
    color: var(--wprc-text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Load More Button */
.wprc-load-more {
    display: block;
    margin: 3rem auto 0;
    padding: 1rem 2.5rem;
    background: var(--wprc-primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wprc-transition);
}

.wprc-load-more:hover {
    background: #e63050;
    transform: scale(1.05);
}

.wprc-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   4. REELS PLAYER MODAL (FULLSCREEN)
======================================== */
.wprc-player-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    overflow: hidden;
}

.wprc-player-modal.active {
    display: flex;
}

/* Desktop Layout: Sidebar + Video + Details */
.wprc-player-container {
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100dvh;
}

/* Sidebar trong modal dùng chung class .wprc-sidebar với trang /reels/,
   nhưng ghi đè position để nằm trong flex container thay vì fixed toàn trang */
.wprc-player-modal .wprc-sidebar {
    position: static;
    width: 240px;
    flex-shrink: 0;
    z-index: auto;
}

/* Column 2: Video Player */
.wprc-player-main {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
}

.wprc-video-wrapper {
    position: relative;
    width: auto;
    max-width: 100%;
    height: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    overflow: hidden;
}

/* ========================================
   NHÓM NÚT BÊN PHẢI VIDEO
   DOM: .wprc-player-main > (.wprc-video-wrapper + .wprc-video-actions)
   Desktop: .wprc-video-actions là sibling → nằm cạnh phải video.
   Mobile: CSS @media đưa nó vào trong video (absolute).
======================================== */
.wprc-video-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
    margin-left: 1.5rem;
    align-self: stretch;
    z-index: 10;
}

/* Cụm 2 nút mũi tên chuyển video: nằm ở nửa trên, icon hành động ở dưới */
.wprc-nav-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: auto 0;
}

.wprc-nav-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    outline: none !important;
    color: #fff !important;
    cursor: pointer;
    transition: var(--wprc-transition);
    -webkit-appearance: none;
    appearance: none;
    line-height: 1 !important;
}

.wprc-nav-btn svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: currentColor;
    pointer-events: none;
}

.wprc-nav-btn:hover,
.wprc-nav-btn:focus {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
    transform: scale(1.1);
}

/* ========================================
   DESKTOP: panel bình luận mở → video dời sang trái, KHÔNG phủ tối, video vẫn phát
======================================== */
@media (min-width: 1025px) {
    .wprc-player-container {
        transition: padding-right 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .wprc-player-modal.wprc-comments-open .wprc-player-container {
        padding-right: 400px;
    }

    .wprc-comments-panel-overlay,
    .wprc-comments-panel-overlay.active {
        display: none;
    }

}

/* Chừa chỗ cho nút đóng (×) ở góc trên-phải panel */
.wprc-comments-meta {
    padding-right: 3.5rem;
}

.wprc-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Video Stage: các slide xếp dọc, dịch chuyển bằng transform.
   KHÔNG đặt overflow: hidden ở đây — slide index N nằm ở translateY(N*100%),
   ngoài khung của stage, sẽ bị cắt thành màn hình đen. Việc cắt do .wprc-video-wrapper đảm nhận. */
.wprc-video-stage {
    position: absolute;
    inset: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.wprc-video-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wprc-video-slide .wprc-video-player {
    background: #000;
}

/* Buffering spinner */
.wprc-buffer-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 5;
}

.wprc-buffer-spinner.visible {
    display: block;
}

.wprc-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff3b5c;
    border-radius: 50%;
    animation: wprc-spin 0.8s linear infinite;
}

@keyframes wprc-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   CHỐNG XUNG ĐỘT VỚI THEME (Flatsome & khác)
   Đặt trong container riêng để theme không style nhầm.
   Dùng `all: unset` ở base rồi khai báo lại từng thuộc tính.
======================================== */
.wprc-video-actions button {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

/* Nếu theme áp box-shadow/gradient lên button, ép về bằng class con */
.wprc-video-actions button::before,
.wprc-video-actions button::after {
    display: none !important;
    content: none !important;
}

/* Bảo đảm SVG không bị theme đổi fill/filter */
.wprc-video-actions button svg {
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Video Actions (nhóm nút bên phải video — xem phần "NHÓM NÚT BÊN PHẢI VIDEO") */

/* Wrapper: button + số đếm nằm DƯỚI button, ngoài button */
.wprc-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    line-height: 1;
}

/* Stack chứa 3 icon hành động (thích / bình luận / chia sẻ) */
.wprc-action-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* Modal xem video (desktop): đưa cụm 3 nút hành động lên cao hơn một chút */
@media (min-width: 1025px) {
    .wprc-player-modal .wprc-action-stack {
        transform: translateY(-1rem);
    }
}

/* Reset mạnh để chống xung đột với CSS button mặc định của theme (Flatsome) */
.wprc-action-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    outline: none !important;
    color: #fff !important;
    cursor: pointer;
    transition: var(--wprc-transition);
    -webkit-appearance: none;
    appearance: none;
    line-height: 1 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.wprc-action-btn svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    fill: currentColor;
    pointer-events: none;
}

.wprc-action-btn:hover,
.wprc-action-btn:focus {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
    transform: scale(1.1);
}

.wprc-action-btn.liked,
.wprc-action-btn.liked:hover,
.wprc-action-btn.liked:focus {
    color: var(--wprc-primary) !important;
}

/* Số đếm: nằm NGOÀI button, bên dưới */
.wprc-action-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* Thông báo nhỏ (VD: "Đã sao chép liên kết!") */
.wprc-toast {
    position: absolute;
    left: 50%;
    bottom: 2.5rem;
    transform: translate(-50%, 10px);
    padding: 0.625rem 1.125rem;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.4;
    border-radius: 999px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 30;
}

.wprc-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ========================================
   POPUP CHIA SẺ (nằm trên video, trong .wprc-video-wrapper)
======================================== */
.wprc-share-popup {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.wprc-share-popup.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.28s ease;
}

/* Lớp nền mờ: fade + blur nhẹ */
.wprc-share-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    transition: opacity 0.28s ease, -webkit-backdrop-filter 0.28s ease, backdrop-filter 0.28s ease;
}

.wprc-share-popup.is-open .wprc-share-backdrop {
    opacity: 1;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

/* Hộp thoại: trượt nhẹ từ dưới + phóng to (spring) */
.wprc-share-dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 1.25rem;
    background: #fff;
    color: #222;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    text-align: left;
    outline: none;
    transform: translateY(14px) scale(0.94);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
    will-change: transform, opacity;
}

.wprc-share-popup.is-open .wprc-share-dialog {
    transform: none;
    opacity: 1;
}

.wprc-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.wprc-share-title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    color: #222;
}

.wprc-share-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem 0.5rem;
    margin-bottom: 1.25rem;
}

/* --- Reset chống CSS button của theme (Flatsome) --- */
.wprc-share-popup button {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    color: inherit !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transform: none;
}

.wprc-share-popup button::before,
.wprc-share-popup button::after {
    display: none !important;
    content: none !important;
}

.wprc-share-popup button:focus-visible {
    outline: 2px solid #1877f2 !important;
    outline-offset: 2px;
}

.wprc-share-popup button svg {
    display: block;
    flex: 0 0 auto;
    fill: currentColor;
    filter: none !important;
    transform: none !important;
    pointer-events: none;
}

/* Nút đóng (×) */
.wprc-share-popup .wprc-share-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #f1f2f4 !important;
    color: #333 !important;
    transition: background 0.15s;
}

.wprc-share-popup .wprc-share-close:hover {
    background: #e4e6ea !important;
}

/* Từng lựa chọn mạng xã hội */
.wprc-share-popup .wprc-share-option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
}

/* Icon + nhãn lần lượt xuất hiện (stagger) khi popup mở */
.wprc-share-popup.is-open .wprc-share-option {
    animation: wprc-share-item-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wprc-share-popup.is-open .wprc-share-option:nth-child(1) { animation-delay: 0.05s; }
.wprc-share-popup.is-open .wprc-share-option:nth-child(2) { animation-delay: 0.09s; }
.wprc-share-popup.is-open .wprc-share-option:nth-child(3) { animation-delay: 0.13s; }
.wprc-share-popup.is-open .wprc-share-option:nth-child(4) { animation-delay: 0.17s; }
.wprc-share-popup.is-open .wprc-share-option:nth-child(5) { animation-delay: 0.21s; }
.wprc-share-popup.is-open .wprc-share-option:nth-child(6) { animation-delay: 0.25s; }
.wprc-share-popup.is-open .wprc-share-option:nth-child(7) { animation-delay: 0.29s; }

/* Ô liên kết hiện ra sau cùng */
.wprc-share-popup.is-open .wprc-share-link {
    animation: wprc-share-item-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

@keyframes wprc-share-item-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.86);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.wprc-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: #fff;
    transition: transform 0.15s ease;
}

.wprc-share-icon svg {
    width: 26px;
    height: 26px;
}

.wprc-share-option:hover .wprc-share-icon {
    transform: scale(1.08);
}

.wprc-share-icon--facebook { background: #1877f2; }
.wprc-share-icon--x { background: #000; }
.wprc-share-icon--x svg { width: 22px; height: 22px; }
.wprc-share-icon--messenger { background: linear-gradient(45deg, #0099ff 0%, #a033ff 60%, #ff5280 90%, #ff7061 100%); }
.wprc-share-icon--zalo { background: #0068ff; }
.wprc-share-icon--tiktok { background: #000; }
.wprc-share-icon--tiktok svg { width: 24px; height: 24px; }
.wprc-share-icon--email { background: #29b6f6; }
.wprc-share-icon--native { background: #eceef1; color: #333; }

.wprc-share-zalo-text {
    font-size: 0.9375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #fff;
}

.wprc-share-label {
    font-size: 0.8125rem;
    line-height: 1.2;
    color: #333;
    white-space: nowrap;
}

/* Ô liên kết + nút sao chép */
.wprc-share-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.625rem 0.625rem 1rem;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
}

.wprc-share-url {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #333;
}

.wprc-share-popup .wprc-share-copy {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    color: #333 !important;
    transition: background 0.15s;
}

.wprc-share-popup .wprc-share-copy:hover {
    background: #e4e6ea !important;
}

.wprc-share-check-icon,
.wprc-share-link.is-copied .wprc-share-copy-icon {
    display: none !important;
}

.wprc-share-link.is-copied .wprc-share-check-icon {
    display: block !important;
    color: #16a34a;
}

@media (max-width: 360px) {
    .wprc-share-dialog {
        padding: 1rem;
    }

    .wprc-share-icon {
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wprc-share-popup,
    .wprc-share-dialog,
    .wprc-share-backdrop,
    .wprc-share-icon {
        transition: none;
    }

    .wprc-share-popup.is-open .wprc-share-option,
    .wprc-share-popup.is-open .wprc-share-link {
        animation: none;
    }
}

/* Comments Panel Overlay */
.wprc-comments-panel-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.4s;
    z-index: 99998;
    pointer-events: none;
}

.wprc-comments-panel-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

/* Comments Panel Meta (thông tin video ở đầu panel) */
.wprc-comments-meta {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #ececec;
    flex-shrink: 0;
    max-height: 45%;
    overflow-y: auto;
}

.wprc-panel-date {
    color: #888;
    font-size: 0.8125rem;
    margin: 0 0 0.5rem;
}

.wprc-panel-title {
    color: #222;
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.wprc-panel-collection {
    color: #ff6b35;
    font-size: 0.8125rem;
    margin: 0 0 0.75rem;
}

.wprc-panel-description {
    color: #444;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.wprc-panel-hashtags {
    margin-bottom: 0.75rem;
}

.wprc-panel-hashtags .wprc-hashtag {
    color: #4A9EFF;
}

.wprc-panel-products {
    margin-bottom: 0.75rem;
}

.wprc-panel-products h4 {
    color: #222;
    font-size: 0.9375rem;
    margin: 0 0 0.5rem;
}

.wprc-panel-cta {
    padding: 0.65rem 1.5rem;
    font-size: 0.9375rem;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.wprc-panel-cta:not([class*="wprc-cta--"]) {
    /* fallback khi server chưa trả class (video cũ chưa lưu design) */
    background: var(--wprc-primary);
    border-radius: 8px;
    color: white !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-weight: 600;
    text-align: center;
    transition: var(--wprc-transition);
}

.wprc-panel-cta:not([class*="wprc-cta--"]):hover {
    background: #e63050;
}

/* Panel bình luận nền trắng: kiểu kính mờ cần nền tối mới đọc được chữ */
.wprc-panel-cta.wprc-cta--glass {
    background: rgba(45, 45, 45, 0.92);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Description (overlay video) */
.wprc-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Hashtags (overlay video) */
.wprc-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.wprc-hashtag {
    color: #4A9EFF;
    font-size: 0.875rem;
    text-decoration: none;
}

/* Products Section */
.wprc-products-section h4 {
    color: white;
    font-size: 1rem;
    margin: 0 0 1rem;
}

.wprc-product-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    text-decoration: none;
    transition: var(--wprc-transition);
}

.wprc-product-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Bản trong panel bình luận (nền trắng) — đặt sau rule chung để ghi đè */
.wprc-panel-products .wprc-product-item {
    background: #f5f5f5;
}

.wprc-panel-products .wprc-product-item:hover {
    background: #ebebeb;
}

.wprc-panel-products .wprc-product-name {
    color: #222;
}

.wprc-panel-products .wprc-product-price {
    color: #ff6b35;
}

.wprc-product-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
}

.wprc-product-info {
    flex: 1;
}

.wprc-product-name {
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.wprc-product-price {
    color: var(--wprc-primary);
    font-size: 1.125rem;
    font-weight: 700;
}

/* CTA Button */
.wprc-cta-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--wprc-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--wprc-transition);
    margin-top: 1rem;
}

.wprc-cta-button:hover {
    background: #e63050;
    transform: scale(1.02);
}

/* Close Button */
.wprc-close-btn {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff !important;
    font-size: inherit !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    vertical-align: middle !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
    z-index: 20 !important;
    transition: var(--wprc-transition);
    -webkit-appearance: none;
    appearance: none;
}

/* Icon SVG: canh giữa tuyệt đối, theme không đổi được fill/kích thước */
.wprc-close-btn svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 auto;
    fill: currentColor !important;
    filter: none !important;
    transform: none !important;
    pointer-events: none;
}

/* Chặn pseudo-element của theme (Flatsome hay inject gradient/shadow) */
.wprc-close-btn::before,
.wprc-close-btn::after {
    display: none !important;
    content: none !important;
}

.wprc-close-btn:hover,
.wprc-close-btn:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    transform: scale(1.1);
}

/* Mobile Player Topbar - hide on desktop by default */
.wprc-mobile-topbar {
    display: none !important;
}

/* ========================================
   5. MOBILE RESPONSIVE
======================================== */
@media (max-width: 1024px) {
    /* Archive Grid - Mobile */
    .wprc-archive-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .wprc-collections-sidebar {
        position: static;
        margin-bottom: 1rem;
    }

    /* Horizontal scrolling collections */
    .wprc-collections-list {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        scrollbar-width: thin;
    }

    .wprc-collections-list li {
        flex: 0 0 auto;
        margin-bottom: 0;
    }

    .wprc-collections-list a {
        white-space: nowrap;
        padding: 0.625rem 1.25rem;
    }

    /* Grid 2 columns */
    .wprc-reels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Player Modal - Mobile */
    .wprc-player-container {
        flex-direction: column;
    }

    .wprc-player-modal .wprc-sidebar {
        display: none;
    }

    .wprc-player-main {
        flex: 1;
    }
@media (max-width: 1024px) {
    .wprc-player-main {
        flex: 1;
        padding: 0 !important;
    }
}

    .wprc-video-wrapper {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        height: 100dvh;
    }

    .wprc-comments-panel {
        width: 100%;
        max-width: 100%;
    }

    .wprc-comments-panel.active {
        transform: translateX(0);
    }

    /* Mobile Header */
    .wprc-mobile-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
        z-index: 15;
    }

    .wprc-mobile-back {
        background: none;
        border: none;
        color: white;
        cursor: pointer;
    }

    .wprc-mobile-brand {
        color: white;
        font-weight: 600;
        font-size: 1rem;
    }

    /* Mobile Collections Slider */
    .wprc-mobile-collections {
        position: absolute;
        top: 4rem;
        left: 0;
        right: 0;
        padding: 0 1rem;
        z-index: 15;
    }

    .wprc-mobile-collections-scroll {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .wprc-mobile-collections-scroll::-webkit-scrollbar {
        display: none;
    }

    .wprc-mobile-collection-btn {
        flex: 0 0 auto;
        padding: 0.5rem 1rem;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        border: none;
        border-radius: 20px;
        color: white;
        font-size: 0.875rem;
        white-space: nowrap;
        cursor: pointer;
    }

    .wprc-mobile-collection-btn.active {
        background: var(--wprc-primary);
    }

    /* Mobile: nhóm icon nằm TRONG video (góc phải dưới) như cũ */
    .wprc-video-actions {
        position: absolute;
        right: 1rem;
        bottom: calc(72px + max(6px, env(safe-area-inset-bottom)));
        margin-left: 0;
        align-self: auto;
        gap: 0.75rem;
    }

    /* Mobile vuốt để chuyển video → ẩn nút mũi tên */
    .wprc-nav-buttons {
        display: none;
    }

    /* Mobile Bottom Info */
    .wprc-video-wrapper.wprc-media-surface {
        --wprc-media-overlay-left: 1rem;
        --wprc-media-overlay-right: 5rem;
    }

    /* Mobile Player Topbar */
    .wprc-mobile-topbar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        display: flex !important;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem;
        padding-top: calc(env(safe-area-inset-top) + 1rem);
        background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
        z-index: 18;
    }

    .wprc-mobile-topbar-home {
        flex-shrink: 0;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: rgba(255, 255, 255, 0.15) !important;
        border: none !important;
        border-radius: 50% !important;
        color: #fff !important;
        text-decoration: none !important;
        cursor: pointer;
        transition: background 0.2s ease;
        -webkit-appearance: none;
        appearance: none;
    }

    .wprc-mobile-topbar-home:hover,
    .wprc-mobile-topbar-home:focus {
        background: rgba(255, 255, 255, 0.25) !important;
        color: #fff !important;
        text-decoration: none !important;
    }

    .wprc-mobile-topbar-home svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
        pointer-events: none;
    }

    .wprc-topbar-menu-container {
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .wprc-topbar-menu-container::-webkit-scrollbar {
        display: none;
    }

    .wprc-topbar-menu {
        display: flex;
        gap: 0.5rem;
        white-space: nowrap;
    }

    .wprc-topbar-menu .wprc-nav-item {
        flex-shrink: 0;
        display: inline-block !important;
        padding: 0.5rem 0.2rem !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 20px !important;
        color: rgba(255, 255, 255, 0.5) !important;
        font-size: 0.875rem !important;
        font-weight: 400 !important;
        text-decoration: none !important;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s ease;
        -webkit-appearance: none;
        appearance: none;
    }

    .wprc-topbar-menu .wprc-nav-item:hover {
        color: #fff !important;
        text-decoration: none !important;
    }

    .wprc-topbar-menu .wprc-nav-item.active {
        color: #fff !important;
    }

    .wprc-mobile-topbar-spacer {
        flex-shrink: 0;
        width: 40px;
    }

}

@media (max-width: 640px) {
    .wprc-story-slider-wrapper {
        padding: 0 2rem;
    }

    .wprc-story-card {
        width: 120px;
    }

    .wprc-story-thumbnail {
        width: 120px;
        height: 180px;
    }

    .wprc-slider-prev,
    .wprc-slider-next {
        width: 32px;
        height: 32px;
    }
}

/* ========================================
   6. ANIMATIONS & LOADING
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wprc-reel-card,
.wprc-story-card {
    animation: fadeIn 0.3s ease-out;
}

.wprc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.wprc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 59, 92, 0.2);
    border-top-color: var(--wprc-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   7. SINGLE REEL PAGE (TRUY CẬP TRỰC TIẾP URL)
======================================== */

/* Body fullscreen: ẩn nội dung theme, chỉ giữ player */
.wprc-single-reel-body {
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
}

/* Đảm bảo modal active ngay khi mở trang single (không cần animation) */
.wprc-single-reel-body .wprc-player-modal {
    display: flex;
}

/* Ẩn các thành phần theme có thể bám vào body/footer */
.wprc-single-reel-body > :not(.wprc-player-modal):not(script):not(style):not(noscript) {
    display: none !important;
}

/* Fallback noscript */
.wprc-single-noscript {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: #fff;
    text-align: center;
    padding: 2rem;
}

.wprc-single-noscript h1 {
    color: #fff;
    margin: 1rem 0 0.5rem;
}

.wprc-single-noscript a {
    color: var(--wprc-primary);
}

/* Safe Area for Notch */
@supports (padding: max(0px)) {
    .wprc-player-main,
    .wprc-mobile-header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .wprc-video-wrapper {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========================================
   8. ARCHIVE PAGE - DARK THEME (NEW DESIGN)
======================================== */

/* Body & Layout */
.wprc-archive-body {
    margin: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

.wprc-archive-layout {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   SIDEBAR (Desktop)
======================================== */
.wprc-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.wprc-top-menu {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    margin: 2rem 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.wprc-top-menu a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.wprc-top-menu a:hover {
    color: #fff;
}

.wprc-top-menu-divider {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.wprc-logo {
    flex-shrink: 0;
    padding: 0 1.5rem 2rem;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.wprc-logo-image {
    max-width: 160px;
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

.wprc-logo-lee {
    color: #fff;
}

.wprc-logo-reels {
    color: #ff6b35;
    margin-left: 4px;
}

.wprc-nav-menu {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.wprc-nav-item {
    display: block;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.wprc-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.wprc-nav-item.active {
    color: #fff;
}

/* ========================================
   MOBILE HEADER & MENU
======================================== */
.wprc-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #1a1a1a;
    z-index: 101;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Flexbox layout để căn chỉnh các phần tử con */
.wprc-mobile-header-left,
.wprc-mobile-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem;
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
}

.wprc-mobile-header-left {
    left: 0;
    padding-left: 0.75rem;
}

.wprc-mobile-header-right {
    right: 0;
    padding-right: 0.75rem;
}

/* Reset đầy đủ CSS cho buttons/links để chống theme override */
.wprc-mobile-back,
.wprc-mobile-home,
.wprc-mobile-menu-toggle {
    /* Layout reset */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Size cố định */
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;

    /* Spacing reset */
    margin: 0 !important;
    padding: 0 !important;

    /* Border & background reset */
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    outline: none !important;

    /* Typography reset */
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    vertical-align: middle !important;

    /* Color */
    color: #fff !important;

    /* Interaction */
    cursor: pointer !important;
    transition: opacity 0.2s ease !important;

    /* Prevent theme interference */
    flex-shrink: 0 !important;
    border-radius: 0 !important;
}

/* SVG reset để đảm bảo hiển thị đúng */
.wprc-mobile-back svg,
.wprc-mobile-home svg,
.wprc-mobile-menu-toggle svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.wprc-mobile-back:hover,
.wprc-mobile-home:hover,
.wprc-mobile-menu-toggle:hover {
    opacity: 0.8 !important;
}

.wprc-mobile-back:active,
.wprc-mobile-home:active,
.wprc-mobile-menu-toggle:active {
    opacity: 0.6 !important;
}

.wprc-mobile-logo-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    pointer-events: none;
    z-index: 1;
}

.wprc-mobile-logo-image {
    max-width: 120px;
    height: auto;
    max-height: 32px;
    object-fit: contain;
}

.wprc-mobile-menu {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: #1a1a1a;
    padding: 0.5rem 1rem;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wprc-mobile-menu-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.2s;
}

.wprc-mobile-menu-item:hover,
.wprc-mobile-menu-item.active {
    color: #fff;
    background: rgba(255, 107, 53, 0.2);
}

/* ========================================
   MOBILE MENU BOTTOM SHEET
======================================== */
.wprc-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 0.4s;
}

.wprc-menu-overlay.is-open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.wprc-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.wprc-menu-overlay.is-open .wprc-menu-backdrop {
    opacity: 1;
}

.wprc-menu-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0a0a0a;
    border-radius: 20px 20px 0 0;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

.wprc-menu-overlay.is-open .wprc-menu-sheet {
    transform: translateY(0);
}

.wprc-menu-sheet-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wprc-menu-sheet-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.wprc-menu-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.wprc-menu-close:hover,
.wprc-menu-close:focus {
    color: #fff;
}

.wprc-menu-sheet-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    align-content: start;
}

.wprc-menu-sheet-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s;
    text-align: center;
    min-height: 52px;
}

.wprc-menu-sheet-item:active {
    transform: scale(0.96);
}

.wprc-menu-sheet-item.active {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
    font-weight: 600;
}

/* No backdrop-filter support fallback */
@supports not (backdrop-filter: blur(4px)) {
    .wprc-menu-backdrop {
        background: rgba(0, 0, 0, 0.85);
    }
}

/* ========================================
   MAIN CONTENT
======================================== */
.wprc-main-content {
    flex: 1;
    margin-left: 240px;
    padding: 3rem 2rem;
    min-height: 100vh;
}

.wprc-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2rem;
}

/* ========================================
   VIDEO GRID (5 COLUMNS)
======================================== */
/* ========================================
   SHORTCODE [wprc_video_grid] — Lưới & Slider
======================================== */
.wprc-shortcode {
    width: 100%;
}

.wprc-shortcode .wprc-video-grid {
    margin-bottom: 0;
}

/* Card trong shortcode: trắng như trang /reels/ (theme Flatsome định màu xám #4a4a4a cho body) */
.wprc-shortcode .wprc-video-card,
.wprc-shortcode .wprc-video-card .wprc-video-views,
.wprc-shortcode .wprc-video-card .wprc-video-duration {
    color: #fff;
}

/* Grid: số cột tùy chỉnh */
.wprc-sc-grid-1 .wprc-video-grid { grid-template-columns: repeat(1, 1fr); }
.wprc-sc-grid-2 .wprc-video-grid { grid-template-columns: repeat(2, 1fr); }
.wprc-sc-grid-3 .wprc-video-grid { grid-template-columns: repeat(3, 1fr); }
.wprc-sc-grid-4 .wprc-video-grid { grid-template-columns: repeat(4, 1fr); }
.wprc-sc-grid-5 .wprc-video-grid { grid-template-columns: repeat(5, 1fr); }
.wprc-sc-grid-6 .wprc-video-grid { grid-template-columns: repeat(6, 1fr); }
.wprc-sc-grid-7 .wprc-video-grid { grid-template-columns: repeat(7, 1fr); }
.wprc-sc-grid-8 .wprc-video-grid { grid-template-columns: repeat(8, 1fr); }
.wprc-sc-grid-9 .wprc-video-grid { grid-template-columns: repeat(9, 1fr); }
.wprc-sc-grid-10 .wprc-video-grid { grid-template-columns: repeat(10, 1fr); }

/* Kích thước card */
.wprc-card-size-small .wprc-video-card {
    aspect-ratio: 9 / 14;
}

.wprc-card-size-large .wprc-video-card {
    aspect-ratio: 9 / 18;
}

/* ==== Slider ==== */
.wprc-sc-slider-wrapper {
    position: relative;
}

.wprc-sc-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    padding: 4px 0;
}

.wprc-sc-slider::-webkit-scrollbar {
    display: none;
}

.wprc-sc-slider .wprc-video-card {
    flex: 0 0 auto;
    width: 150px;
    scroll-snap-align: start;
}

.wprc-card-size-small .wprc-sc-slider .wprc-video-card {
    width: 110px;
}

.wprc-card-size-small .wprc-sc-slider .wprc-video-card {
    width: 110px;
}

.wprc-card-size-large .wprc-sc-slider .wprc-video-card {
    width: 200px;
}

/* Font size title theo kích thước card (slider + grid) */
.wprc-card-size-small .wprc-video-title {
    font-size: 11px;
    font-weight: 400;
}

.wprc-card-size-medium .wprc-video-title {
    font-size: 12px;
}

.wprc-card-size-large .wprc-video-title {
    font-size: 14px;
}

/* ==== Play icon trong slider shortcode — ẩn/thu nhỏ theo kích thước card ==== */

/* Small: ẩn hoàn toàn icon play */
.wprc-card-size-small .wprc-sc-slider .wprc-video-play-icon {
    display: none;
}

/* Medium: icon 24px, đưa lên góc trên bên phải */
.wprc-card-size-medium .wprc-sc-slider .wprc-video-play-icon {
    top: 8px;
    right: 8px;
    left: auto;
    transform: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    max-width: 24px;
}

.wprc-card-size-medium .wprc-sc-slider .wprc-video-card:hover .wprc-video-play-icon {
    transform: scale(1.1);
}

.wprc-card-size-medium .wprc-sc-slider .wprc-video-play-icon svg {
    width: 60% !important;
    height: 60% !important;
}

/* Nút điều hướng — đặt NGOÀI mép slider, reset sạch style theme (Flatsome) */
.wprc-sc-slider-prev,
.wprc-sc-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 42px !important;
    height: 42px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background: rgba(255, 255, 255, 0.96) !important;
    color: #1d2327 !important;
    text-shadow: none !important;
    line-height: 1 !important;
    font-size: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.wprc-sc-slider-prev {
    left: -21px;
}

.wprc-sc-slider-next {
    right: -21px;
}

.wprc-sc-slider-prev svg,
.wprc-sc-slider-next svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    overflow: visible;
}

.wprc-sc-slider-prev:hover,
.wprc-sc-slider-next:hover {
    background: #fff !important;
    color: #000 !important;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

.wprc-sc-slider-prev:disabled,
.wprc-sc-slider-next:disabled {
    opacity: 0.35;
    cursor: default;
    transform: translateY(-50%);
}

/* ==== Shortcode trong trang admin (nền tối) ==== */
.wprc-sc-preview-stage .wprc-video-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
}

.wprc-shortcode-empty {
    color: #646970;
    text-align: center;
    padding: 12px 0;
}

/* Responsive */
@media (max-width: 782px) {
    .wprc-sc-grid-3 .wprc-video-grid,
    .wprc-sc-grid-4 .wprc-video-grid,
    .wprc-sc-grid-5 .wprc-video-grid,
    .wprc-sc-grid-6 .wprc-video-grid,
    .wprc-sc-grid-7 .wprc-video-grid,
    .wprc-sc-grid-8 .wprc-video-grid,
    .wprc-sc-grid-9 .wprc-video-grid,
    .wprc-sc-grid-10 .wprc-video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .wprc-sc-slider-prev,
    .wprc-sc-slider-next {
        display: none;
    }
}

.wprc-video-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
}

.wprc-video-card {
    position: relative;
    aspect-ratio: 10 / 15;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wprc-video-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.wprc-video-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Thumbnail Background */
.wprc-video-thumbnail {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* Injected img from auto-thumbnail must fill container */
.wprc-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.wprc-video-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.wprc-video-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
}

.wprc-video-placeholder-icon svg {
    width: 64px;
    height: 64px;
}

/* Gradient Overlay */
.wprc-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
    pointer-events: none;
}

/* View Count (Top-left) */
.wprc-video-views {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    font-size: 9px;
    color: #fff;
    font-weight: 500;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.wprc-video-views svg {
    opacity: 0.9;
}

/* Play Icon (Center) */
.wprc-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24%;
    min-width: 32px;
    max-width: 48px;
    aspect-ratio: 1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    backdrop-filter: blur(8px);
    transition: all 0.3s;
    z-index: 2;
}

.wprc-video-card:hover .wprc-video-play-icon {
    transform: translate(-50%, -50%) scale(1.15);
    background: rgba(255, 255, 255, 0.35);
}

.wprc-video-play-icon svg {
    width: 55%;
    height: 55%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Bottom Content */
.wprc-video-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 12px 45px 12px; /* Extra bottom padding to avoid duration badge overlap */
    z-index: 2;
}

.wprc-video-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.wprc-video-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Duration Badge (Bottom-left) - Icon + Text */
.wprc-video-duration {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-right: 6px;
    background: hsl(0deg 0% 0% / 60%);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    z-index: 3;
}

.wprc-video-duration::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background-image: url('../images/duration-badge-bg.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.wprc-video-duration svg {
    display: none; /* Hide inline SVG from template */
}

/* Load More Button */
.wprc-load-more {
    display: block;
    margin: 2rem auto;
    padding: 0.875rem 2rem;
    background: rgba(255, 107, 53, 0.1);
    border: 2px solid #ff6b35;
    border-radius: 8px;
    color: #ff6b35;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wprc-load-more:hover {
    background: #ff6b35;
    color: #fff;
}

.wprc-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wprc-no-reels {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

/* ========================================
   PAGINATION (Archive)
======================================== */
.wprc-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 3rem 0 1rem;
    padding: 0;
}

.wprc-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wprc-pagination a.page-numbers:hover,
.wprc-pagination a.page-numbers:focus-visible {
    background: rgba(255, 59, 92, 0.15);
    border-color: var(--wprc-primary);
    color: var(--wprc-text-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 59, 92, 0.25);
    outline: none;
}

.wprc-pagination a.page-numbers:active {
    transform: translateY(0);
    box-shadow: none;
}

.wprc-pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--wprc-primary), #ff6b81);
    border-color: transparent;
    color: var(--wprc-text-light);
    box-shadow: 0 6px 18px rgba(255, 59, 92, 0.4);
    cursor: default;
}

.wprc-pagination .page-numbers.dots {
    min-width: auto;
    padding: 0 4px;
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

.wprc-pagination .page-numbers.prev,
.wprc-pagination .page-numbers.next {
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
    .wprc-pagination {
        gap: 6px;
        margin-top: 2rem;
    }

    .wprc-pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }

    .wprc-pagination .page-numbers.prev,
    .wprc-pagination .page-numbers.next {
        padding: 0 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wprc-pagination .page-numbers {
        transition: none;
    }

    .wprc-pagination a.page-numbers:hover,
    .wprc-pagination a.page-numbers:focus-visible {
        transform: none;
    }
}

/* ========================================
   RESPONSIVE
======================================== */

/* Tablet (4 columns) */
@media (max-width: 1280px) {
    .wprc-video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Small Tablet (3 columns) */
@media (max-width: 1024px) {
    .wprc-sidebar {
        width: 200px;
    }

    .wprc-main-content {
        margin-left: 200px;
        padding: 2rem 1.5rem;
    }

    .wprc-video-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .wprc-page-title {
        font-size: 24px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .wprc-sidebar {
        display: none;
    }

    .wprc-mobile-header,
    .wprc-mobile-menu {
        display: flex;
    }

    .wprc-main-content {
        margin-left: 0;
        margin-top: 106px; /* 56px header + 50px menu */
        padding: 1.5rem 1rem;
    }

    .wprc-video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .wprc-page-title {
        font-size: 20px;
        margin-bottom: 1.5rem;
    }

    .wprc-video-title {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
}

/* ========================================
   9. COMMENTS SYSTEM
======================================== */

/* Comments Panel (Desktop: trượt từ phải, nền trắng) */
.wprc-comments-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
    will-change: transform;
}

.wprc-comments-panel.active {
    transform: translateX(0);
}
/* Nút đóng panel bình luận — reset mạnh chống CSS button của theme (Flatsome) */
.wprc-comments-close {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.05) !important;
    color: #333 !important;
    font-size: inherit !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    vertical-align: middle !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
    z-index: 2 !important;
    transition: var(--wprc-transition);
    -webkit-appearance: none;
    appearance: none;
}

.wprc-comments-close svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 auto;
    fill: currentColor !important;
    filter: none !important;
    transform: none !important;
    pointer-events: none;
}

.wprc-comments-close::before,
.wprc-comments-close::after {
    display: none !important;
    content: none !important;
}

.wprc-comments-close:hover,
.wprc-comments-close:focus {
    background: rgba(0, 0, 0, 0.12) !important;
    color: #333 !important;
}

/* Header: tiêu đề "Bình luận (n)" */
.wprc-comments-header {
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid #ececec;
    flex-shrink: 0;
}

.wprc-comments-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #222;
}

/* Comments List */
.wprc-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Comment Item */
.wprc-comment-item {
    display: flex;
    gap: 0.75rem;
    animation: wprc-comment-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes wprc-comment-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.wprc-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: #eee;
}

/* Wrapper dọc: chứa content + replies, để replies nằm DƯỚI thay vì cạnh bên */
.wprc-comment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wprc-comment-content {
    min-width: 0;
}

.wprc-comment-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.wprc-comment-author {
    font-size: 0.875rem;
    font-weight: 600;
    color: #222;
}

.wprc-comment-time {
    font-size: 0.75rem;
    color: #9a9a9a;
}

.wprc-comment-text {
    font-size: 0.9375rem;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.wprc-comment-mention {
    color: #4A9EFF;
    font-weight: 600;
}

.wprc-comment-actions {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-top: 0.35rem;
}

.wprc-comment-reply-btn,
.wprc-comment-delete-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #9a9a9a;
    cursor: pointer;
    transition: var(--wprc-transition);
    line-height: 1.4;
}

.wprc-comment-reply-btn:hover {
    color: var(--wprc-primary);
}

.wprc-comment-delete-btn {
    color: rgba(255, 107, 53, 0.65);
}

.wprc-comment-delete-btn:hover {
    color: #ff6b35;
}

/* Replies — thread line bo góc nối từ avatar cha xuống reply */
.wprc-comment-replies {
    margin-top: 0.85rem;
    padding-left: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

/* Đường kẻ dọc bo góc */
.wprc-comment-replies::before {
    content: '';
    position: absolute;
    left: 0;
    top: -0.85rem;
    bottom: 1.1rem;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, #e8e8e8 0%, #f0f0f0 100%);
}

/* Reply: avatar nhỏ + viền trắng, lệch nhẹ tạo cảm giác lồng nhau */
.wprc-comment-reply {
    gap: 0.625rem;
}

.wprc-comment-reply .wprc-comment-avatar {
    width: 28px;
    height: 28px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wprc-comment-reply .wprc-comment-author {
    font-size: 0.8125rem;
}

.wprc-comment-reply .wprc-comment-text {
    font-size: 0.875rem;
}

/* Reply cấp 2 — lùi thêm 1 bậc */
/* Highlight bình luận vừa đăng */
.wprc-comment-highlight .wprc-comment-content {
    animation: wprc-comment-flash 1.8s ease-out;
    border-radius: 8px;
}

@keyframes wprc-comment-flash {
    0%, 60% {
        background: rgba(74, 158, 255, 0.14);
        box-shadow: 0 0 0 6px rgba(74, 158, 255, 0.14);
    }
    100% {
        background: transparent;
        box-shadow: 0 0 0 6px transparent;
    }
}

/* Skeleton loading */
.wprc-comment-skeleton {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.wprc-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #f0f0f0;
    animation: wprc-skeleton-pulse 1.4s ease-in-out infinite;
}

.wprc-skeleton-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.25rem;
}

.wprc-skeleton-line {
    height: 10px;
    border-radius: 5px;
    background: #f0f0f0;
    animation: wprc-skeleton-pulse 1.4s ease-in-out infinite;
}

.wprc-skeleton-line--short {
    width: 35%;
}

.wprc-skeleton-line--mid {
    width: 70%;
}

@keyframes wprc-skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}

/* Reply Form */
.wprc-reply-form {
    margin-top: 0.85rem;
    padding: 0.75rem;
    background: #fafafa;
    border: 1px solid #ededed;
    border-radius: 12px;
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
    animation: wprc-reply-form-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes wprc-reply-form-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.wprc-reply-form-avatar {
    flex-shrink: 0;
}

.wprc-reply-form-avatar .wprc-comment-avatar {
    width: 28px;
    height: 28px;
}

.wprc-reply-form-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wprc-reply-textarea {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    padding: 0.625rem 0.75rem;
    color: #222;
    font-size: 0.875rem;
    line-height: 1.45;
    resize: vertical;
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wprc-reply-textarea:focus {
    outline: none;
    border-color: var(--wprc-primary);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.12);
}

.wprc-reply-form-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    justify-content: flex-end;
}

.wprc-reply-submit,
.wprc-reply-cancel {
    border-radius: 20px;
    border: none;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wprc-transition);
    line-height: 1;
}

.wprc-reply-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.9375rem;
    background: var(--wprc-primary);
    color: #fff;
}

.wprc-reply-submit:hover:not(:disabled) {
    background: #e63050;
}

.wprc-reply-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.wprc-reply-submit svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.wprc-reply-cancel {
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: #777;
}

.wprc-reply-cancel:hover {
    color: #333;
    background: #eee;
}

/* Comments Form */
.wprc-comments-form {
    padding: 0.875rem 1.5rem;
    border-top: 1px solid #ececec;
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.wprc-comments-textarea {
    flex: 1;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 0.625rem 1rem;
    color: #222;
    font-size: 0.875rem;
    resize: none;
}

.wprc-comments-textarea:focus {
    outline: none;
    border-color: var(--wprc-primary);
}

.wprc-comments-submit {
    padding: 0.625rem 1.25rem;
    background: var(--wprc-primary);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wprc-transition);
    align-self: flex-end;
}

.wprc-comments-submit:hover {
    background: #e63050;
}

.wprc-comments-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading / Empty / Error States */
.wprc-comments-empty,
.wprc-comments-error {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
    font-size: 0.875rem;
}

.wprc-comments-error {
    color: #ff6b35;
}

/* Login notice + trạng thái load (nền trắng) */
.wprc-comments-login-notice {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ececec;
    text-align: center;
    flex-shrink: 0;
}

.wprc-comments-login-notice p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

.wprc-comments-login-notice a {
    color: var(--wprc-primary);
    text-decoration: none;
}

/* Load More Button */
.wprc-comments-load-more {
    display: block;
    margin: 0.5rem auto;
    padding: 0.625rem 1.5rem;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    color: #555;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--wprc-transition);
}

.wprc-comments-load-more:hover {
    background: #ebebeb;
    color: #333;
}

/* Mobile Adjustments for Comments: bottom sheet trượt từ dưới lên */
@media (max-width: 1024px) {
    .wprc-comments-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 70%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        will-change: transform;
    }

    .wprc-comments-panel.active {
        transform: translateY(0);
    }

    .wprc-comments-list {
        padding: 0.75rem 1rem;
    }

    .wprc-comments-form {
        padding: 0.75rem 1rem;
    }
}

/* Tôn trọng thiết lập giảm chuyển động của hệ điều hành */
@media (prefers-reduced-motion: reduce) {
    .wprc-comments-panel,
    .wprc-comments-panel-overlay,
    .wprc-player-container {
        transition: none;
    }

    .wprc-comment-item,
    .wprc-comment-highlight .wprc-comment-content,
    .wprc-reply-form,
    .wprc-comments-panel.active .wprc-comments-meta,
    .wprc-comments-panel.active .wprc-comments-header,
    .wprc-comments-panel.active .wprc-comments-form,
    .wprc-comments-panel.active .wprc-comments-login-notice {
        animation: none;
    }

    .wprc-skeleton-avatar,
    .wprc-skeleton-line {
        animation: none;
        opacity: 0.6;
    }
}
