/* Webreta Video Gallery - Frontend */

/* Gallery Grid */
.wrvg-gallery {
    display: grid;
    gap: 24px;
}

.wrvg-gallery.wrvg-cols-1 {
    grid-template-columns: 1fr;
}

.wrvg-gallery.wrvg-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wrvg-gallery.wrvg-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wrvg-gallery.wrvg-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .wrvg-gallery.wrvg-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .wrvg-gallery.wrvg-cols-3,
    .wrvg-gallery.wrvg-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wrvg-gallery {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .wrvg-gallery .wrvg-item {
        padding-bottom: 24px;
        margin-bottom: 24px;
        border-bottom: 1px solid #e5e5e5;
    }

    .wrvg-gallery .wrvg-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
}

/* Item */
.wrvg-item,
.wrvg-single,
.wrvg-latest {
    position: relative;
}

/* Thumbnail */
.wrvg-thumb {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    display: block;
}

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

.wrvg-thumb:hover img {
    transform: scale(1.05);
}

/* Shorts aynı boyut */
.wrvg-shorts .wrvg-thumb {
    aspect-ratio: 16/9;
}

/* Play Button */
.wrvg-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
    pointer-events: none;
}

.wrvg-play svg {
    width: 68px;
    height: 48px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.wrvg-play-lg svg {
    width: 88px;
    height: 62px;
}

.wrvg-play-bg {
    fill: #ff0000;
    fill-opacity: 0.9;
    transition: fill-opacity 0.2s;
}

/* Local video play button - blue */
.wrvg-thumb[data-video-type="local"] .wrvg-play-bg {
    fill: #3b82f6;
}

.wrvg-play-icon {
    fill: #fff;
}

.wrvg-thumb:hover .wrvg-play {
    transform: translate(-50%, -50%) scale(1.1);
}

.wrvg-thumb:hover .wrvg-play-bg {
    fill-opacity: 1;
}

/* Badges */
.wrvg-shorts-badge,
.wrvg-new-badge,
.wrvg-local-badge,
.wrvg-image-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff0000;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wrvg-new-badge {
    background: #22c55e;
}

.wrvg-local-badge {
    background: #3b82f6;
}

.wrvg-image-badge {
    background: #9333ea;
}

/* Badge SVG icons */
.wrvg-badge-icon {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    display: block;
}

/* Zoom icon for images */
.wrvg-zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
    opacity: 0;
    background: rgba(0, 0, 0, 0.6);
    padding: 12px;
    border-radius: 50%;
}

.wrvg-zoom svg {
    width: 32px;
    height: 32px;
    color: #fff;
    display: block;
}

.wrvg-thumb:hover .wrvg-zoom {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.wrvg-zoom-lg {
    padding: 16px;
}

.wrvg-zoom-lg svg {
    width: 40px;
    height: 40px;
}

/* Title & Desc */
.wrvg-title {
    margin: 12px 0 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #0f0f0f !important;
}

.wrvg-title-lg {
    font-size: 18px !important;
}

.wrvg-desc {
    margin: 6px 0 0 !important;
    font-size: 13px !important;
    color: #666 !important;
    line-height: 1.5 !important;
}

.wrvg-no-videos,
.wrvg-error {
    text-align: center;
    padding: 40px;
    color: #666;
}


/* ==========================================================
   MODAL - Full Reset & Flatsome Override
   ========================================================== */

#wrvg-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
}

#wrvg-modal.wrvg-visible {
    display: block !important;
}

/* Backdrop */
#wrvg-modal .wrvg-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.9) !important;
    cursor: pointer !important;
    z-index: 1 !important;
}

/* Wrapper */
#wrvg-modal .wrvg-modal-wrap {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 900px !important;
    z-index: 2 !important;
}

/* Close Button - Full Reset for Flatsome */
#wrvg-modal .wrvg-modal-close {
    all: unset !important;
    box-sizing: border-box !important;
    position: absolute !important;
    top: -50px !important;
    right: 0 !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 32px !important;
    font-family: Arial, sans-serif !important;
    line-height: 44px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    display: block !important;
}

#wrvg-modal .wrvg-modal-close:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    transform: rotate(90deg) !important;
}

/* Content Wrapper */
#wrvg-modal .wrvg-modal-content {
    position: relative !important;
    width: 100% !important;
    background: #000 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5) !important;
}

/* Video Container - YouTube */
#wrvg-modal .wrvg-modal-youtube {
    display: none;
    position: relative !important;
    width: 100% !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    background: #000 !important;
}

#wrvg-modal .wrvg-modal-youtube iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Local Video Container */
#wrvg-modal .wrvg-modal-local {
    display: none;
    position: relative !important;
    width: 100% !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    background: #000 !important;
}

#wrvg-modal .wrvg-modal-local video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #000 !important;
}

/* Image Container */
#wrvg-modal .wrvg-modal-image {
    display: none;
    text-align: center !important;
    max-height: 80vh !important;
    background: #000 !important;
}

#wrvg-modal .wrvg-modal-image img {
    max-width: 100% !important;
    max-height: 80vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: inline-block !important;
}

/* Body lock */
body.wrvg-modal-open {
    overflow: hidden !important;
}

/* Responsive */
@media (max-width: 768px) {
    #wrvg-modal .wrvg-modal-wrap {
        width: 95% !important;
    }

    #wrvg-modal .wrvg-modal-close {
        top: -46px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 28px !important;
        line-height: 40px !important;
    }

    #wrvg-modal .wrvg-modal-content {
        border-radius: 8px !important;
    }
}