.kcx-video-popup {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.kcx-video-grid {
    --kcx-grid-gap: 16px;
    --kcx-primary-size: 70%;
    display: grid;
    gap: var(--kcx-grid-gap);
    grid-template-columns: minmax(0, var(--kcx-primary-size)) minmax(0, calc(100% - var(--kcx-primary-size)));
    grid-template-rows: 1fr 1fr;
    align-items: stretch;
}

.kcx-video-grid.is-one {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.kcx-video-grid.is-two {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.kcx-video-item {
    position: relative;
    min-width: 0;
    height: 100%;
}

.kcx-video-item--primary {
    grid-area: 1 / 1 / 3 / 2;
}

.kcx-video-grid.is-one .kcx-video-item--primary {
    grid-area: 1 / 1 / 2 / 2;
}

.kcx-video-grid.is-two .kcx-video-item--primary {
    grid-area: 1 / 1 / 2 / 2;
}

.kcx-video-item--secondary {
    grid-area: 1 / 2 / 2 / 3;
}

.kcx-video-item--tertiary {
    grid-area: 2 / 2 / 3 / 3;
}

.kcx-video-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    background: #0b1c26;
    height: 100%;
}

.kcx-video-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.kcx-video-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: none;
    background: #0f2d3f;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 200ms ease;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.kcx-video-play:hover {
    transform: scale(1.05);
}

.kcx-video-play-icon {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #ffffff;
    margin-left: 4px;
}

.kcx-video-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 26px 28px;
    color: #ffffff;
    z-index: 2;
    text-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
}

.kcx-video-text::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 85%);
    z-index: -1;
}

.kcx-text-center {
    justify-content: center;
}

.kcx-video-description {
    margin: 0;
    font-size: 20px;
    line-height: 1.4;
}

.kcx-video-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}

.kcx-author-horizontal .kcx-author-title {
    font-weight: 500;
    opacity: 1;
    color: rgba(230, 230, 230, 0.9);
}

.kcx-author-vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.kcx-author-vertical .kcx-author-sep {
    display: none;
}

.kcx-video-grid.is-three .kcx-video-thumb {
    aspect-ratio: auto;
}

.kcx-video-grid.is-three .kcx-video-item--primary .kcx-video-thumb {
    aspect-ratio: auto;
}

.kcx-video-grid.is-three .kcx-video-item--secondary .kcx-video-description,
.kcx-video-grid.is-three .kcx-video-item--tertiary .kcx-video-description {
    display: none;
}

.kcx-video-grid.is-three .kcx-video-item--secondary .kcx-video-text,
.kcx-video-grid.is-three .kcx-video-item--tertiary .kcx-video-text {
    padding: 18px 20px;
    gap: 6px;
}

.kcx-video-grid.is-three .kcx-video-item--secondary .kcx-video-author,
.kcx-video-grid.is-three .kcx-video-item--tertiary .kcx-video-author {
    font-size: 13px;
    line-height: 1.25;
}

.kcx-video-grid.is-three .kcx-video-item--secondary .kcx-author-title,
.kcx-video-grid.is-three .kcx-video-item--tertiary .kcx-author-title {
    font-weight: 500;
    opacity: 1;
    color: rgba(230, 230, 230, 0.9);
    line-height: 1.2;
}

.kcx-video-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 14, 0.75);
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 9999;
}

.kcx-video-modal.is-open {
    opacity: 1;
    pointer-events: all;
}

.kcx-video-modal-dialog {
    position: relative;
    width: 80px;
    max-width: 96vw;
    background: #000000;
    border-radius: 18px;
    overflow: hidden;
    transform: scale(0.92);
    transition: transform 220ms ease;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

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

.kcx-video-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    display: none;
    background: #000000;
}

.kcx-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.kcx-video-player {
    width: 100%;
    height: auto;
    display: block;
}

.kcx-video-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 2;
}

@media (max-width: 600px) {
    .kcx-video-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: var(--kcx-grid-gap);
    }

    .kcx-video-item {
        width: 100%;
        height: auto;
    }

    .kcx-video-item--tertiary {
        display: none;
    }

    .kcx-video-item--primary,
    .kcx-video-item--secondary {
        grid-area: auto;
    }

    .kcx-video-thumb,
    .kcx-video-grid.is-three .kcx-video-thumb,
    .kcx-video-grid.is-three .kcx-video-item--primary .kcx-video-thumb {
        aspect-ratio: 16 / 9;
        height: auto;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .kcx-video-description {
        display: none;
    }

    .kcx-video-slider {
        position: relative;
        overflow: hidden;
        width: 100%;
    }

    .kcx-video-grid.is-slider {
        display: flex;
        gap: 0;
        transition: transform 320ms ease;
        will-change: transform;
    }

    .kcx-video-grid.is-slider .kcx-video-item {
        flex: 0 0 100%;
    }

    .kcx-video-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
    }

    .kcx-video-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        border: 0;
        background: rgba(255, 255, 255, 0.35);
        padding: 0;
        cursor: pointer;
    }

    .kcx-video-dot.is-active {
        background: rgba(255, 255, 255, 0.85);
    }

    .kcx-video-play {
        width: 58px;
        height: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kcx-video-modal,
    .kcx-video-modal-dialog,
    .kcx-video-play {
        transition: none;
    }
}
