/* Frontend Gallery Styles */

.y-ytg-wrapper {
    width: 100%;
}

.y-ytg-gallery {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* Column layouts */
.y-ytg-cols-1 { grid-template-columns: repeat(1, 1fr); }
.y-ytg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.y-ytg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.y-ytg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.y-ytg-cols-5 { grid-template-columns: repeat(5, 1fr); }
.y-ytg-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Video Card */
.y-ytg-video-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.y-ytg-video-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Thumbnail */
.y-ytg-video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #f0f0f0;
    display: block;
    flex-shrink: 0;
}

.y-ytg-video-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    line-height: 0;
}

.y-ytg-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    vertical-align: top;
}

/* Play Button */
.y-ytg-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.y-ytg-play-button svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.y-ytg-play-button .y-ytg-play-bg {
    fill: #333333;
    transition: fill 0.3s ease;
}

.y-ytg-video-card:hover .y-ytg-play-button {
    opacity: 1;
}

.y-ytg-video-card:hover .y-ytg-play-button .y-ytg-play-bg {
    fill: #000000;
}

/* Content */
.y-ytg-video-content {
    padding: 15px;
}

.y-ytg-video-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.y-ytg-video-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.y-ytg-video-title a:hover {
    color: #1c87bb;
}

.y-ytg-video-description {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.y-ytg-video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #888;
}

.y-ytg-channel,
.y-ytg-date {
    display: inline-block;
}

.y-ytg-channel::before {
    content: "📺 ";
    margin-right: 3px;
}

.y-ytg-date::before {
    content: "📅 ";
    margin-right: 3px;
}

/* No Videos Message */
.y-ytg-no-videos {
    padding: 40px 20px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

/* Pagination */
.y-ytg-pagination {
    margin-top: 30px;
    text-align: center;
}

.y-ytg-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.y-ytg-pagination .page-numbers:hover {
    background: #1c87bb;
    color: #fff;
    border-color: #1c87bb;
}

.y-ytg-pagination .page-numbers.current {
    background: #1c87bb;
    color: #fff;
    border-color: #1c87bb;
}

.y-ytg-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* Load More Button */
.y-ytg-load-more {
    margin-top: 30px;
    text-align: center;
}

.y-ytg-load-more-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #1c87bb;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.y-ytg-load-more-btn:hover {
    background: #166a95;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 135, 187, 0.3);
}

.y-ytg-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.y-ytg-load-more-btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: y-ytg-spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.y-ytg-hidden {
    display: none !important;
}

/* Modal/Lightbox */
.y-ytg-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.y-ytg-modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 1200px;
}

.y-ytg-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.y-ytg-modal-close:hover {
    color: #1c87bb;
}

.y-ytg-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.y-ytg-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Tablet Responsive */
@media screen and (max-width: 1024px) {
    .y-ytg-cols-tablet-1 { grid-template-columns: repeat(1, 1fr); }
    .y-ytg-cols-tablet-2 { grid-template-columns: repeat(2, 1fr); }
    .y-ytg-cols-tablet-3 { grid-template-columns: repeat(3, 1fr); }
    .y-ytg-cols-tablet-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile Responsive */
@media screen and (max-width: 767px) {
    .y-ytg-gallery {
        gap: 15px;
    }
    
    .y-ytg-cols-mobile-1 { grid-template-columns: repeat(1, 1fr); }
    .y-ytg-cols-mobile-2 { grid-template-columns: repeat(2, 1fr); }
    
    .y-ytg-video-content {
        padding: 12px;
    }
    
    .y-ytg-video-title {
        font-size: 14px;
    }
    
    .y-ytg-video-description {
        font-size: 13px;
    }
    
    .y-ytg-video-meta {
        font-size: 12px;
    }
    
    .y-ytg-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .y-ytg-modal-close {
        top: -35px;
        font-size: 30px;
    }
    
    /* Pagination mobile - Previous and Next on separate lines */
    .y-ytg-pagination {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .y-ytg-pagination .page-numbers {
        min-width: 44px;
        text-align: center;
    }
    
    .y-ytg-pagination .page-numbers.prev,
    .y-ytg-pagination .page-numbers.next {
        width: 100%;
        max-width: 300px;
        order: 0;
    }
    
    .y-ytg-pagination .page-numbers.next {
        order: 2;
    }
    
    .y-ytg-pagination-numbers {
        order: 1;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
}

/* Loading State */
.y-ytg-loading {
    text-align: center;
    padding: 40px;
}

.y-ytg-loading::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1c87bb;
    border-radius: 50%;
    animation: y-ytg-spin 1s linear infinite;
}

@keyframes y-ytg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.y-ytg-video-card:focus-within {
    outline: 2px solid #1c87bb;
    outline-offset: 2px;
}

.y-ytg-video-title a:focus,
.y-ytg-video-thumbnail a:focus {
    outline: none;
}
