/* YouTube Grid Lazy Embed Styles */

.ytgrid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.ytgrid-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ytgrid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ytgrid-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    aspect-ratio: 16/9;
}

.ytgrid-thumb-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ytgrid-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.ytgrid-thumb:hover .ytgrid-play {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.ytgrid-title {
    padding: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

/* Modal Styles */
.ytgrid-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.ytgrid-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ytgrid-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.ytgrid-modal-dialog {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px;
}

.ytgrid-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    z-index: 10;
    transition: background 0.2s ease;
}

.ytgrid-modal-close:hover {
    background: rgba(255, 255, 255, 1);
}

.ytgrid-modal-body {
    width: 100%;
    height: 100%;
}

.ytgrid-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ytgrid-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }
    
    .ytgrid-modal-dialog {
        margin: 10px;
    }
    
    .ytgrid-play {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .ytgrid-title {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ytgrid-play {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .ytgrid-title {
        padding: 10px;
    }
}
