/* ============================================
   Song Library Styles
   ============================================ */

/* Reusing Hero from global/blog if available, else standard */

/* Layout */
.song-library-container {
    padding-bottom: 80px;
}

.blog-grid-section {
    padding: 40px 0;
    max-width: calc(100% - 200px);
    margin: auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

/* Song Card */
.song-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.song-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* Smaller Preview Image */
.song-card-image {
    height: 160px;
    /* Reduced height as requested */
    width: 100%;
    position: relative;
    overflow: hidden;
    display: block;
    background: #f5f5f5;
}

.song-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.song-card:hover .song-card-image img {
    transform: scale(1.05);
}

.placeholder-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface-variant);
}

.placeholder-thumb md-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

/* Difficulty Badge */
.difficulty-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    backdrop-filter: blur(4px);
    text-transform: uppercase;
}

/* Content */
.song-card-content {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 16px;
}

.song-header {
    flex: 1;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.song-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    /* Margin handled by parent gap/margin-bottom */
    line-height: 1.3;
}

.song-title a {
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
}

.price-badge,
.owned-badge {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 6px;
}

.price-badge {
    color: var(--md-sys-color-primary);
    background: var(--md-sys-color-secondary-container);
}

.owned-badge {
    color: #1b5e20;
    /* Green text */
    background: #e8f5e9;
    /* Green bg */
    display: flex;
    align-items: center;
    gap: 4px;
}

.owned-badge md-icon {
    font-size: 16px;
    color: inherit;
}

.free-badge {
    color: #0d47a1;
    /* Blue */
    background: #e3f2fd;
    /* Light Blue */
    text-transform: uppercase;
}

.song-artist {
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.artist-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.artist-avatar.placeholder {
    background: var(--md-sys-color-surface-container-high);
    display: flex;
    align-items: center;
    justify-content: center;
}

.artist-avatar.placeholder md-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Actions */
.song-actions {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.song-excerpt {
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
    margin: 8px 0 0 0;

    /* Max 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.icon-actions {
    display: flex;
    gap: 8px;
}

/* View Tab Button - Left */
.action-row md-filled-button {
    flex-grow: 1;
    --md-filled-button-container-height: 40px;
}

/* Icon Buttons - Right */
.icon-actions md-filled-tonal-button {
    /* Square shape for icons */
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    --md-filled-tonal-button-container-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure icons are same size */
.icon-actions md-filled-tonal-button md-icon,
.play-song-btn md-icon {
    font-size: 20px;
}

/* Play/Stop Button in grid */
.play-song-btn {
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    --md-filled-tonal-button-container-height: 40px;
    --md-filled-tonal-button-container-shape: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Premium Orange Style */
    --md-sys-color-secondary-container: #fff3e0;
    --md-sys-color-on-secondary-container: #e65100;
}

.play-song-btn:hover {
    --md-sys-color-secondary-container: #ffe0b2;
}

.play-song-btn[playing="true"] {
    --md-sys-color-secondary-container: #ef6c00;
    --md-sys-color-on-secondary-container: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 108, 0, 0.3);
}

/* Pagination */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 8px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    font-weight: 600;
    transition: background 0.2s;
}

.pagination a:hover {
    background: var(--md-sys-color-surface-container-high);
}

.pagination .current {
    background: var(--md-sys-color-primary);
    color: #fff;
}


/* Copied from Learn To Play - Hero Styles */
.learn-hero-section {
    padding-top: 40px;
    padding-bottom: 40px;
    text-align: center;
}

.learn-header {
    max-width: 1200px;
    margin: 0 auto;
}

.learn-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--md-sys-color-on-surface);
    letter-spacing: -0.02em;
}

.learn-header p {
    font-size: 1.3rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .learn-header h1 {
        font-size: 2.4rem;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .blog-grid-section {
        max-width: calc(100% - 32px);
        padding: 24px 0;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .song-card-image {
        height: 180px;
        /* Slightly larger for mobile full width */
    }

    .learn-header h1 {
        font-size: 2rem;
    }

    .learn-header p {
        font-size: 1rem;
    }
}