/* ==========================================================================
   SAGOR LUXURY VIDEO GRID WIDGET — CSS
   ========================================================================== */

:root {
    --svg-grid-gold: #b48652;
    --svg-grid-pink: #ff0060;
    --svg-grid-radius: 14px;
    --svg-grid-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Container & Grid Layout
   -------------------------------------------------------------------------- */
.sagor-video-grid-wrapper {
    width: 100%;
    display: flex;
    box-sizing: border-box;
}

.sagor-video-grid-wrapper.align-left {
    justify-content: flex-start;
}

.sagor-video-grid-wrapper.align-center {
    justify-content: center;
}

.sagor-video-grid-wrapper.align-right {
    justify-content: flex-end;
}

.video-grid {
    width: 100%;
    max-width: 520px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
}

/* --------------------------------------------------------------------------
   Video Card Item
   -------------------------------------------------------------------------- */
.video-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1.55 / 1;
    overflow: hidden;
    border-radius: var(--svg-grid-radius, 14px);
    background: #ffffff;
    cursor: pointer;
    border: 2px solid transparent;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;

    transition:
        border-color 0.35s ease,
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

/* Active Highlight Card State (Top-Left Reference Style) */
.video-card.is-active,
.video-card.has-permanent-highlight {
    border-color: #ff0060;
    box-shadow: 0 10px 25px rgba(255, 0, 96, 0.2);
}

/* --------------------------------------------------------------------------
   Thumbnail Image
   -------------------------------------------------------------------------- */
.video-card img,
.video-card .video-thumbnail {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;

    transition:
        transform 0.55s cubic-bezier(.2, .8, .2, 1),
        filter 0.4s ease;
}

/* --------------------------------------------------------------------------
   Hover Dark Overlay
   -------------------------------------------------------------------------- */
.video-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    transition: background 0.4s ease;
}

/* --------------------------------------------------------------------------
   Play Button
   -------------------------------------------------------------------------- */
.play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #b48652;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    transition:
        transform 0.35s ease,
        background 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

/* Optional Pulse Animation */
.video-card.has-pulse .play-button::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid rgba(180, 134, 82, 0.6);
    animation: svgPlayPulse 2s infinite cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    pointer-events: none;
}

@keyframes svgPlayPulse {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   Play Icon (CSS Triangle or SVG)
   -------------------------------------------------------------------------- */
.play-button::after {
    content: "";
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid #b48652;
    margin-left: 4px;
    transition: border-left-color 0.3s ease;
}

/* When custom SVG icon is present */
.play-button svg {
    width: 18px;
    height: 18px;
    fill: #b48652;
    margin-left: 3px;
    transition: fill 0.3s ease;
}

/* --------------------------------------------------------------------------
   Badges & Titles
   -------------------------------------------------------------------------- */
.video-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 6;
    background: #ff0060;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.video-card-title-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 6;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
}

.video-card-title {
    margin: 0;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Hover Effects
   -------------------------------------------------------------------------- */
.video-card:hover,
.video-card:focus-visible {
    border-color: #ff0060;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.video-card:hover img,
.video-card:focus-visible img {
    transform: scale(1.08);
    filter: saturate(1.05);
}

.video-card:hover::before,
.video-card:focus-visible::before {
    background: rgba(0, 0, 0, 0.14);
}

.video-card:hover .play-button,
.video-card:focus-visible .play-button {
    transform: translate(-50%, -50%) scale(1.12);
    background: #ffffff;
    border-color: #ff0060;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.video-card:hover .play-button::after,
.video-card:focus-visible .play-button::after {
    border-left-color: #ff0060;
}

.video-card:hover .play-button svg,
.video-card:focus-visible .play-button svg {
    fill: #ff0060;
}

/* --------------------------------------------------------------------------
   Click / Active Effect
   -------------------------------------------------------------------------- */
.video-card:active {
    transform: translateY(-1px) scale(0.99);
}

/* --------------------------------------------------------------------------
   BUILT-IN LIGHTBOX MODAL
   -------------------------------------------------------------------------- */
.sagor-video-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    padding: 20px;
    box-sizing: border-box;
}

.sagor-video-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.sagor-video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.sagor-video-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 860px;
    background: #000000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    z-index: 2;
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sagor-video-modal.is-open .sagor-video-modal-dialog {
    transform: scale(1);
}

.sagor-video-modal-content {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.sagor-video-modal-content iframe,
.sagor-video-modal-content video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
}

.sagor-video-modal-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease;
    z-index: 10;
    outline: none;
}

.sagor-video-modal-close:hover {
    background: #ff0060;
    color: #ffffff;
    transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .video-grid {
        max-width: 100%;
        gap: 14px;
        padding: 8px;
    }

    .video-card {
        border-radius: 12px;
    }

    .play-button {
        width: 46px;
        height: 46px;
    }

    .play-button::after {
        border-top-width: 7px;
        border-bottom-width: 7px;
        border-left-width: 10px;
    }

    .sagor-video-modal-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.6);
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .video-card {
        aspect-ratio: 1.45 / 1;
        border-radius: 10px;
    }

    .play-button {
        width: 40px;
        height: 40px;
    }

    .play-button::after {
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-left-width: 9px;
    }
}
