/* Container general */
.rv-widget-container {
    position: relative;
    width: 100%;
}

/* Grid Layout */
.rv-grid {
    display: grid;
    gap: 15px;
}

/* Shared Item Styles (Grid & Carousel) */
.rv-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
    background: #000;
    aspect-ratio: 9/16;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
}

.rv-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.rv-carousel {
    padding: 15px 0 50px 0;
    overflow: hidden;
    position: relative;
}

.rv-carousel .swiper-slide {
    height: auto;
}

.rv-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.rv-grid-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: filter 0.3s;
}

.rv-item:hover .rv-grid-video {
    filter: brightness(1.1);
}

.rv-video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 15px 15px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff !important;
    font-weight: 600;
    font-size: 15px;
    text-align: left;
    box-sizing: border-box;
    pointer-events: none;
}

/* Swiper Navigation */
.rv-swiper-next,
.rv-swiper-prev {
    color: #fff !important;
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10;
    margin-top: -20px !important;
    /* adjust for pagination height */
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.rv-swiper-next::after,
.rv-swiper-prev::after {
    font-size: 18px !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.rv-swiper-next:hover,
.rv-swiper-prev:hover {
    background: rgba(0, 0, 0, 0.75) !important;
    transform: scale(1.05);
}

.rv-swiper-prev {
    left: 10px !important;
}

.rv-swiper-next {
    right: 10px !important;
}

/* Swiper Pagination */
.rv-swiper-pagination {
    bottom: 0px !important;
}

.rv-swiper-pagination .swiper-pagination-bullet {
    background: #000;
    opacity: 0.3;
    width: 10px;
    height: 10px;
    margin: 0 6px !important;
    transition: opacity 0.3s, background 0.3s, transform 0.3s !important;
}

.rv-swiper-pagination .swiper-pagination-bullet-active {
    opacity: 1;
    background: #000;
    transform: scale(1.3);
}

/* Modal Styling - Sleek UI */
.rv-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    display: flex;
}

.rv-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.rv-modal-content {
    position: relative;
    height: 90vh;
    max-height: 850px;
    aspect-ratio: 9/16;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    animation: rvModalZoom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rvModalZoom {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.rv-modal-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
}

.rv-popup-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Global Reset for our modal buttons to prevent theme overrides (like width: 100%) */
.rv-modal-wrapper button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    line-height: 1 !important;
    outline: none !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    color: #fff !important;
    min-width: auto;
}

/* Glassmorphism Close Button */
.rv-modal-close {
    position: absolute;
    top: 15px !important;
    right: 15px !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    font-size: 28px !important;
    z-index: 20;
    transition: background 0.3s, transform 0.2s;
}

.rv-modal-close:hover {
    background: rgba(0, 0, 0, 0.7) !important;
    transform: scale(1.05);
}

/* Title Overlay in Modal */
.rv-modal-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 60px 20px 25px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 5;
    box-sizing: border-box;
}

.rv-modal-title {
    color: #fff !important;
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.4 !important;
    text-align: left;
}

/* Video Controls in Modal */
.rv-controls {
    position: absolute;
    right: 15px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

.rv-controls button {
    min-width: auto;
    width: 48px !important;
    height: 48px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    font-size: 18px !important;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}

.rv-controls button:hover {
    background: rgba(0, 0, 0, 0.7) !important;
    transform: scale(1.05);
}

/* Icons */
.rv-icon-play::before {
    content: "▶";
    margin-left: 2px;
}

.rv-icon-pause::before {
    content: "⏸";
}

.rv-icon-mute::before {
    content: "🔇";
}

.rv-icon-unmute::before {
    content: "🔊";
}

/* Nav Buttons strictly inside the video container for consistency */
.rv-nav-prev,
.rv-nav-next {
    position: absolute;
    top: 50% !important;
    transform: translateY(-50%);
    width: 48px !important;
    height: 48px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    font-size: 32px !important;
    color: #fff !important;
    transition: background 0.3s, transform 0.2s;
    z-index: 10;
}

.rv-nav-prev:hover,
.rv-nav-next:hover {
    background: rgba(0, 0, 0, 0.7) !important;
    transform: translateY(-50%) scale(1.05);
}

/* Responsive Nav Positioning */
.rv-nav-prev {
    left: 15px !important;
}

.rv-nav-next {
    right: 15px !important;
}

/* Remove border-radius on small screens for true fullscreen */
@media (max-width: 768px) {
    .rv-modal-content {
        height: 100vh;
        width: 100vw;
        max-height: none;
        aspect-ratio: auto;
        border-radius: 0;
    }

    .rv-modal-video-container {
        border-radius: 0;
    }
}