/* ════════════════════════════════════════════════════════════════
   ALBUMS GRID SECTION
════════════════════════════════════════════════════════════════ */

.album-list-section {
    width: 100%;
}

.album-search-bar {
    width: 100%;
    max-width: 400px;
}

.album-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 32px;
    padding: 0;
    margin: 0;
}

.album-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    cursor: pointer;
    animation: popIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger album animations */
.album-item:nth-child(1) { animation-delay: 0.05s; }
.album-item:nth-child(2) { animation-delay: 0.1s; }
.album-item:nth-child(3) { animation-delay: 0.15s; }
.album-item:nth-child(4) { animation-delay: 0.2s; }
.album-item:nth-child(5) { animation-delay: 0.25s; }
.album-item:nth-child(6) { animation-delay: 0.3s; }
.album-item:nth-child(7) { animation-delay: 0.35s; }
.album-item:nth-child(8) { animation-delay: 0.4s; }

.album-item:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    transform: translateY(-4px);
}

.album-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.album-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.album-item:hover .album-cover {
    transform: scale(1.05);
}

.album-overlay .play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
    cursor: pointer;
}

.album-item:hover .album-overlay .play-btn {
    transform: translateY(0);
}

.album-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.album-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    transition: color 0.3s;
}

.album-item:hover .album-info h4 {
    color: var(--primary);
}

.album-artist {
    font-size: 14px;
    color: var(--text-subdued);
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-meta {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════════
   ALBUM DETAILS PAGE
════════════════════════════════════════════════════════════════ */

.album-details-container {
    padding: 0;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-subdued);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 24px;
    transition: color 0.3s, transform 0.3s;
}

.back-btn:hover {
    color: var(--primary);
    transform: translateX(-4px);
}

.album-header {
    display: flex;
    gap: 40px;
    align-items: flex-end;
    margin-bottom: 48px;
    animation: slideDownFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.album-header-cover {
    width: 280px;
    height: 280px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.album-header-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.album-type {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-subdued);
}

.album-title {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-base);
    font-family: 'Outfit', sans-serif;
    letter-spacing: -1px;
}

.album-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-subdued);
    font-weight: 500;
    margin-top: 8px;
}

.album-header-meta .artist-name {
    font-weight: 700;
    color: var(--text-base);
}

.album-header-meta .dot {
    font-size: 20px;
    line-height: 0;
}

.album-description {
    font-size: 15px;
    color: var(--text-subdued);
    line-height: 1.6;
    max-width: 600px;
    margin-top: 8px;
}

.album-actions {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.album-actions .play-btn {
    width: 56px;
    height: 56px;
}

/* Tracklist */
.tracklist-section {
    margin-bottom: 64px;
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.tracklist {
    width: 100%;
    border-collapse: collapse;
}

.tracklist th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-subdued);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.tracklist th:first-child { width: 50px; text-align: center; }
.tracklist th:last-child { text-align: right; }

.track-item {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0,0,0,0.02);
}

.track-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.track-item td {
    padding: 16px;
    vertical-align: middle;
}

.track-item td:first-child {
    text-align: center;
    color: var(--text-subdued);
    font-weight: 500;
    width: 50px;
    font-size: 15px;
    position: relative;
}

.track-number {
    display: block;
}

.track-play-icon {
    display: none;
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
}

.track-item:hover .track-number { display: none; }
.track-item:hover .track-play-icon { display: block; }

.track-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-base);
}

.track-artist {
    font-size: 14px;
    color: var(--text-subdued);
    margin-top: 4px;
}

.track-actions {
    text-align: right;
    white-space: nowrap;
}

.track-actions .card-action-btn {
    display: inline-flex;
    padding: 7px 14px;
    font-size: 13px;
    margin-left: 8px;
    border-radius: 8px;
}

.track-actions button:hover {
    color: var(--primary);
}

.album-play-all-btn {
    padding: 12px 28px;
    font-size: 15px;
    border-radius: 500px;
}

/* More by Artist Carousel */
.more-by-artist {
    margin-bottom: 64px;
}

.more-by-artist h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-base);
}

.carousel-container {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-behavior: smooth;
    /* Hide scrollbar */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-container .album-item {
    min-width: 200px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .album-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }

    .album-header-meta {
        justify-content: center;
    }

    .album-actions {
        justify-content: center;
    }

    .album-title {
        font-size: 40px;
    }
}

/* ── Mobile: Transform tracklist into card rows ── */
@media (max-width: 600px) {

    /* Hide the table header on mobile */
    .tracklist thead {
        display: none;
    }

    .tracklist,
    .tracklist tbody,
    .tracklist tr {
        display: block;
        width: 100%;
    }

    /* Each track row becomes a card */
    .track-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 4px;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }

    /* Hide all <td> by default, then selectively show */
    .track-item td {
        display: none;
        padding: 0;
    }

    /* Show track number column */
    .track-item td:first-child {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 28px;
        color: var(--text-subdued);
        font-size: 14px;
        font-weight: 500;
    }

    /* Show title column — takes up remaining space */
    .track-item td:nth-child(2) {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0; /* prevent overflow */
    }

    /* Truncate long titles */
    .track-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 15px;
    }

    .track-artist {
        font-size: 13px;
    }

    /* Show action buttons column */
    .track-item td:last-child {
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
        text-align: right;
    }

    /* Style the play/download buttons to match home page */
    .track-actions .card-action-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 7px 11px;
        font-size: 12px;
        font-weight: 600;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        margin-left: 0;
    }

    .track-actions .card-action-btn.play-btn {
        background-color: #ef4444;
        color: #ffffff;
    }

    .track-actions .card-action-btn.download-btn {
        background-color: #f3f4f6;
        color: #1f2937;
    }
}

