/* BlazinStreetz Unified Content Grid Component */
/* BSAPP-514: Grid Standardization Initiative */

/* ==========================================
   Base Grid Container
   Fixed column structure: 2�3�4 columns
   Predictable responsive behavior
   ========================================== */

.content-grid {
    display: grid;
    /* Mobile first: 2 columns */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
}

/* Tablet: 3 columns (577px-991px) */
@media (min-width: 577px) and (max-width: 991px) {
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Desktop: 4 columns (992px+) */
@media (min-width: 992px) {
    .content-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

/* ==========================================
   Grid Item Base Styles
   ========================================== */

.grid-item {
    background-color: var(--background-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    /* Enable instant touch response on mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Hover effect for desktop only */
@media (hover: hover) and (pointer: fine) {
    .grid-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
}

/* ==========================================
   Content Type Variations
   ========================================== */

/* Song Grid Items */
.songs-grid .grid-item,
.song-card {
    /* Song-specific styles preserved */
}

/* Artist Grid Items */
.artist-grid .grid-item,
.artist-card {
    text-align: center;
}

.artist-grid .artist-image,
.artist-card .artist-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

/* Video Grid Items */
.content-grid--videos .grid-item,
.content-grid--videos .bs-card,
.video-card {
    /* Video-specific aspect ratios */
}

.content-grid--videos .video-thumbnail,
.content-grid--videos .bs-card__image-wrapper,
.video-card .video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

/* Mixtape Grid Items */
.content-grid--mixtapes .grid-item,
.content-grid--mixtapes .bs-card,
.mixtape-card {
    /* Mixtape-specific styles */
}

.content-grid--mixtapes .mixtape-cover,
.content-grid--mixtapes .bs-card__image-wrapper,
.mixtape-card .mixtape-cover {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
}

/* Playlist Grid Items */
.playlists-grid .grid-item,
.playlist-card {
    /* Playlist-specific styles */
}

/* ==========================================
   Grid Item Components
   ========================================== */

/* Cover/Thumbnail Container */
.grid-item-cover {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.grid-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .grid-item:hover .grid-item-cover img {
        transform: scale(1.1);
    }
}

/* Play Overlay */
.grid-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-item:hover .grid-item-overlay {
    opacity: 1;
}

.grid-item-play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.grid-item-play-btn:hover {
    transform: scale(1.1);
}

/* Item Info Section */
.grid-item-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.grid-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-item-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-item-stats {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.grid-item-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==========================================
   Loading States
   ========================================== */

.grid-skeleton {
    display: grid;
    grid-template-columns: inherit;
    gap: inherit;
}

.skeleton-item {
    background-color: var(--background-light);
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
    position: relative;
}

.skeleton-cover {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-info {
    padding: 20px;
}

.skeleton-text {
    height: 20px;
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-text.small {
    width: 60%;
    height: 16px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================
   Animation States
   ========================================== */

/* New card animation */
.grid-item.new-card {
    animation: fadeIn 0.2s ease-out;
    will-change: transform, opacity;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Empty State
   ========================================== */

.grid-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.grid-empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ==========================================
   Mobile Responsive Adjustments
   ========================================== */

@media (max-width: 768px) {
    .grid-item-info {
        padding: 15px;
    }

    .grid-item-title {
        font-size: 0.95rem;
    }

    .grid-item-subtitle {
        font-size: 0.8rem;
    }

    .grid-item-stats {
        font-size: 0.75rem;
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .grid-item-info {
        padding: 10px 12px;
    }

    .grid-item-title {
        font-size: 0.9rem;
    }

    .grid-item-subtitle {
        font-size: 0.75rem;
    }

    .grid-item-stats {
        font-size: 0.7rem;
        gap: 12px;
    }
}