/**
 * Grid view styles for YT Playlist plugin
 * Contains all grid layout and responsive grid styles
 */

/* Main Grid Container */
.yt-playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

/* Grid Item Adjustments */
.yt-playlist-grid .yt-video-item {
    display: flex;
    flex-direction: column;
    height: auto;
}

.yt-playlist-grid .yt-video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Grid Specific Hover Effects */
.yt-playlist-grid .yt-video-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Dense Grid Variant */
.yt-playlist-grid.yt-grid-dense {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.yt-playlist-grid.yt-grid-dense .yt-video-info {
    padding: 0.75rem;
}

.yt-playlist-grid.yt-grid-dense .yt-video-title {
    font-size: 0.9rem;
    -webkit-line-clamp: 1;
}

/* Large Grid Variant */
.yt-playlist-grid.yt-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
}

.yt-playlist-grid.yt-grid-large .yt-video-info {
    padding: 1.25rem;
}

.yt-playlist-grid.yt-grid-large .yt-video-title {
    font-size: 1.1rem;
    -webkit-line-clamp: 3;
}

/* Masonry Style Grid (Optional) */
.yt-playlist-grid.yt-grid-masonry {
    columns: 320px;
    column-gap: 1.5rem;
    column-fill: balance;
}

.yt-playlist-grid.yt-grid-masonry .yt-video-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* Grid Animation Variants */
.yt-playlist-grid.yt-grid-animated .yt-video-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.yt-playlist-grid.yt-grid-animated .yt-video-item:nth-child(1) { animation-delay: 0.1s; }
.yt-playlist-grid.yt-grid-animated .yt-video-item:nth-child(2) { animation-delay: 0.2s; }
.yt-playlist-grid.yt-grid-animated .yt-video-item:nth-child(3) { animation-delay: 0.3s; }
.yt-playlist-grid.yt-grid-animated .yt-video-item:nth-child(4) { animation-delay: 0.4s; }
.yt-playlist-grid.yt-grid-animated .yt-video-item:nth-child(5) { animation-delay: 0.5s; }
.yt-playlist-grid.yt-grid-animated .yt-video-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Grid Breakpoints */

/* Large Tablets */
@media (max-width: 1024px) {
    .yt-playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
    
    .yt-playlist-grid.yt-grid-large {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* Tablets */
@media (max-width: 768px) {
    .yt-playlist-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
        padding: 0;
    }
    
    .yt-playlist-grid.yt-grid-dense {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .yt-playlist-grid.yt-grid-large {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .yt-playlist-grid.yt-grid-masonry {
        columns: 250px;
        column-gap: 1rem;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .yt-playlist-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }
    
    .yt-playlist-grid.yt-grid-dense,
    .yt-playlist-grid.yt-grid-large {
        grid-template-columns: 1fr;
    }
    
    .yt-playlist-grid.yt-grid-masonry {
        columns: 1;
        column-gap: 0;
    }
    
    .yt-playlist-grid.yt-grid-masonry .yt-video-item {
        margin-bottom: 1rem;
    }
}

/* Very Small Screens */
@media (max-width: 320px) {
    .yt-playlist-grid {
        gap: 0.75rem;
    }
    
    .yt-playlist-grid .yt-video-info {
        padding: 0.75rem;
    }
    
    .yt-playlist-grid .yt-video-title {
        font-size: 0.9rem;
    }
}