/* 2. Main Content Area */
.main-content {
    grid-area: main-content;
    background: linear-gradient(rgba(40, 40, 40, 0.8), #121212 50%);
    /* Subtle gradient at top */
    overflow-y: auto;
    padding: 20px 30px;
    scroll-behavior: smooth;
    /* Kích hoạt cuộn mượt cho main-content */
}

.main-content h1 {
    font-size: 2em;
    margin-bottom: 30px;
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.card {
    background-color: #181818;
    padding: 16px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    position: relative;
    /* For play button */
    cursor: pointer;
    /* Make the whole card clickable for simplicity or just the play button */
}

.card:hover {
    background-color: #282828;
}

.card img.album-art {
    width: 100%;
    /* Chiếm toàn bộ chiều rộng của .card padding box */
    /* height: auto; */
    /* Bỏ height: auto nếu có, để aspect-ratio kiểm soát */

    aspect-ratio: 1 / 1;
    /* QUAN TRỌNG: Đảm bảo ảnh là hình vuông */
    /* Tỷ lệ 1/1 nghĩa là chiều rộng = chiều cao */

    object-fit: cover;
    /* QUAN TRỌNG: Ảnh sẽ lấp đầy không gian vuông,
                            phần thừa sẽ bị cắt, giữ nguyên tỷ lệ gốc của ảnh. */
    object-position: center center;
    /* Căn giữa ảnh khi bị cắt (mặc định) */

    border-radius: 4px;
    /* Giữ lại bo góc nếu muốn */
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.card h3.song-title {
    /* Added class for JS */
    font-size: 1em;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card p.song-artist {
    /* Added class for JS */
    font-size: 0.85em;
    color: #b3b3b3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .play-button-overlay {
    position: absolute;
    bottom: 80px;
    /* Adjust based on card content */
    right: 20px;
    background-color: #1DB954;
    /* Spotify green */
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    /* So it doesn't interfere with card click */
}

.card:hover .play-button-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* --- Song List Container (Kiểu bảng/lưới chi tiết) --- */
.song-list-container {
    margin-top: 20px;
}
.song-list-item, /* Áp dụng cho cả header và item */
.song-list-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 4px;
    gap: 12px;
    transition: background-color 0.2s ease;
    /* border-bottom: 1px solid rgba(255,255,255,0.05); */ /* Tùy chọn: đường kẻ mờ giữa các item */
}

.song-list-header { /* Style riêng cho header nếu cần */
    color: #b3b3b3;
    font-size: 0.8em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: default; /* Header không cần cursor pointer */
}
.song-list-header:hover { /* Bỏ hover effect cho header */
    background-color: transparent;
}


/* Cột STT */
.song-list-item .song-index,
.song-list-header .song-index {
    color: #b3b3b3;
    font-size: 0.95em;
    width: 25px;
    text-align: right;
    flex-shrink: 0;
    padding-right: 8px; /* Thêm padding để số không sát ảnh */
}
.song-list-header .song-index { /* Riêng cho header */
    font-weight: bold;
}

/* Cột ảnh bìa */
.song-list-item .album-art-small,
.song-list-header .song-art-placeholder { /* Placeholder cho header */
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: transparent; /* Cho placeholder */
}

/* Cột Tiêu đề & Tên nghệ sĩ (trong item) hoặc chỉ Tiêu đề (trong header) */
.song-list-item .song-details,
.song-list-header .song-details {
    flex-grow: 1; /* Quan trọng: Cho phép cột này co giãn */
    overflow: hidden;
    min-width: 0; /* Cho phép co lại đúng cách */
    /* Có thể đặt flex-basis nếu muốn tỷ lệ cố định hơn */
    /* flex-basis: 40%; */
}
.song-list-header .song-details .song-title { /* Tiêu đề trong header */
     font-weight: bold;
}
.song-list-item .song-title {
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95em;
    margin-bottom: 2px;
}
.song-list-item .song-artist-name-in-list {
    font-size: 0.8em;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cột Nghệ sĩ RIÊNG (MỚI) */
.song-list-item .song-artist-column,
.song-list-header .song-artist-header { /* class cũ từ header */
    flex-basis: 20%; /* Điều chỉnh % này cho phù hợp */
    min-width: 100px; /* Đảm bảo không quá hẹp */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #b3b3b3;
    font-size: 0.85em;
    padding-left: 10px; /* Khoảng cách với cột trước */
    flex-shrink: 0; /* Không cho co lại nếu không cần */
}
.song-list-header .song-artist-header {
    font-weight: bold;
}
.song-list-item .song-artist-column a { /* Style cho link nghệ sĩ nếu có */
    color: #b3b3b3;
    text-decoration: none;
}
.song-list-item .song-artist-column a:hover {
    text-decoration: underline;
    color: #fff;
}


/* Cột Lượt nghe */
.song-list-item .song-plays,
.song-list-header .song-plays {
    font-size: 0.85em;
    color: #b3b3b3;
    min-width: 70px; /* Điều chỉnh độ rộng */
    text-align: right;
    flex-shrink: 0;
}
.song-list-header .song-plays {
    font-weight: bold;
}

/* Cột Thời lượng */
.song-list-item .song-duration,
.song-list-header .song-duration {
    font-size: 0.85em;
    color: #b3b3b3;
    min-width: 50px; /* Điều chỉnh độ rộng */
    text-align: right;
    flex-shrink: 0;
}
.song-list-header .song-duration {
    font-weight: bold;
}

/* Cột Actions (Nút like) */
.song-list-item .song-actions,
.song-list-header .song-actions-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 45px; /* Tăng nhẹ để có không gian */
    justify-content: center; /* Căn giữa nút like */
    flex-shrink: 0;
}
.song-list-header .song-actions-placeholder {
    height: 1px; /* Chỉ để giữ chỗ */
}
