/* Frontend Video Grid Styles */

.yci-video-grid {
    display: grid;
    gap: 24px;
    margin: 30px 0;
    padding: 0;
}

.yci-video-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.yci-video-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.yci-video-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.yci-video-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.yci-video-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.yci-video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.yci-video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.yci-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.yci-video-item:hover .yci-video-thumbnail img {
    transform: scale(1.05);
}

.yci-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    transition: all 0.3s ease;
    pointer-events: none;
}

.yci-video-item:hover .yci-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.yci-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: monospace;
}

.yci-video-info {
    padding: 16px;
}

.yci-video-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yci-video-description {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #606060;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yci-video-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #606060;
}

.yci-video-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.yci-video-meta svg {
    opacity: 0.7;
}

.yci-no-videos {
    padding: 40px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.yci-no-videos p {
    color: #606060;
    font-size: 16px;
}

/* Video Modal */
.yci-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.yci-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.yci-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    animation: yci-fade-in 0.3s ease;
}

.yci-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 1000000;
    animation: yci-slide-up 0.3s ease;
}

.yci-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.yci-modal-close:hover {
    transform: scale(1.2);
}

.yci-modal-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#yci-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#yci-video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Animations */
@keyframes yci-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes yci-slide-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {

    .yci-video-grid[data-columns="4"],
    .yci-video-grid[data-columns="3"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .yci-video-grid[data-columns="1"],
    .yci-video-grid[data-columns="2"],
    .yci-video-grid[data-columns="3"],
    .yci-video-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }

    .yci-video-grid {
        gap: 16px;
    }

    .yci-video-title {
        font-size: 15px;
    }

    .yci-video-description {
        font-size: 13px;
    }

    .yci-modal-content {
        width: 95%;
    }

    .yci-modal-close {
        top: -35px;
        font-size: 32px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .yci-video-item {
        background: #1f1f1f;
    }

    .yci-video-title {
        color: #fff;
    }

    .yci-video-description,
    .yci-video-meta {
        color: #aaa;
    }

    .yci-no-videos {
        background: #1f1f1f;
    }

    .yci-no-videos p {
        color: #aaa;
    }
}