/* =========================================
   GIAO DIỆN TRANG KHÁM PHÁ (CHỦ ĐỀ)
========================================= */
.discover-section {
    padding: 40px 50px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.section-title-row h2 {
    font-size: 1.5rem;
    color: white;
}

.section-title-row .view-more {
    color: #a0a0a0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}

.section-title-row .view-more:hover {
    color: white;
}

/* --- Thiết lập Grid 5 cột y như ảnh --- */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Ép chính xác 5 cột */
    gap: 20px;
}

/* --- Thiết kế thẻ Chủ Đề --- */
.topic-card {
    position: relative; /* Để chứa hình ảnh cắt góc bên trong */
    height: 110px;
    border-radius: 8px;
    padding: 15px;
    overflow: hidden; /* Cắt phần ảnh bị lòi ra ngoài */
    cursor: pointer;
    transition: transform 0.3s ease;
}

.topic-card:hover {
    transform: scale(1.05); /* Phóng to nhẹ khi di chuột vào */
}

.topic-card h3 {
    color: white;
    font-size: 1.2rem;
    position: relative;
    z-index: 2; /* Nằm đè lên trên ảnh */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5); /* Tạo bóng để chữ dễ đọc */
}

/* --- Định vị hình ảnh chân dung nằm góc phải dưới --- */
.topic-card img {
    position: absolute;
    bottom: -10px; /* Hạ thấp xuống một tí */
    right: -10px; /* Kéo lệch sang phải một tí */
    width: 80px; 
    height: auto;
    z-index: 1;
    transform: rotate(15deg); /* Hơi nghiêng hình cho nghệ thuật giống mẫu */
}

/* --- Các màu nền Gradient mô phỏng giống ảnh của bạn --- */
.bg-1 { background: linear-gradient(135deg, #7a7cf3, #3c2f90); }
.bg-2 { background: linear-gradient(135deg, #3225ba, #892095); }
.bg-3 { background: linear-gradient(135deg, #a78ced, #e6b7b2); }
.bg-4 { background: linear-gradient(135deg, #a8b8b0, #368882); }
.bg-5 { background: linear-gradient(135deg, #d3987f, #a28975); }
.bg-6 { background: linear-gradient(135deg, #f9a380, #af5145); }
.bg-7 { background: linear-gradient(135deg, #99551c, #482306); }
.bg-8 { background: linear-gradient(135deg, #4d3fd2, #29208a); }
.bg-9 { background-color: #000000; }
.bg-10 { background: linear-gradient(135deg, #ddb393, #7a5849); }
/* Reset CSS cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #212521; /* Màu nền tối hơi ngả xanh rêu giống ảnh */
    color: #ffffff;
}

/* --- Header / Navbar --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: #1a1d1a;
}

header .logo h2 {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: #b0b5b0;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}

nav a:hover {
    color: #ffffff;
}

.search-box input {
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    background-color: #333833;
    color: white;
    outline: none;
}

/* --- Hero Banner --- */
.hero {
   height: 400px;
    background-color: #3a403a; 
    background-size: cover;
    
    /* SỬA DÒNG NÀY: Đổi 'center' thành 'center bottom' */
    background-position: center bottom; 
    
    display: flex;
    align-items: center;
    padding: 0 50px;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

/* --- Chỉnh chung cho các Section --- */
.music-section {
    padding: 40px 50px;
}

.music-section h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #d1d5d1;
}

/* --- Grid Bài hát --- */
.grid-container {
    display: grid;
    /* Tự động chia cột đều nhau, mỗi thẻ tối thiểu 180px */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.music-card {
    background-color: #2a2e2a;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.music-card:hover {
    transform: translateY(-5px); /* Hiệu ứng nảy lên khi di chuột */
    background-color: #333833;
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1; /* Giữ ảnh hình vuông */
    background-color: #444; /* Màu nền chờ ảnh */
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Nút Play ẩn/hiện */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: black;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.music-card:hover .play-btn {
    opacity: 1; /* Hiện nút Play khi hover */
}

.music-card h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.music-card p {
    font-size: 0.85rem;
    color: #a0a0a0;
}

/* --- Grid Nghệ sĩ (Hình tròn) --- */
.artist-container {
    display: flex;
    gap: 40px;
}

.artist-card {
    text-align: center;
}

.artist-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #555;
    object-fit: cover;
    margin-bottom: 10px;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid #333;
    margin-top: 20px;
    color: #888;
}
/* --- THANH PHÁT NHẠC (PLAYER BAR) --- */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #181818; /* Màu nền tối giống Spotify */
    border-top: 1px solid #282828;
    display: none; /* Mặc định ẩn, JS sẽ đổi thành flex khi phát nhạc */
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    z-index: 1000;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 30%;
}

.player-info img {
    width: 55px;
    height: 55px;
    border-radius: 5px;
    object-fit: cover;
}

.song-details .now-playing {
    font-size: 0.7rem;
    color: #1db954; /* Màu xanh lá cho chữ NOW PLAYING */
    font-weight: bold;
    letter-spacing: 1px;
}

.song-details h4 {
    margin: 3px 0;
    font-size: 0.9rem;
    color: white;
}

.song-details p {
    font-size: 0.8rem;
    color: #b3b3b3;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-controls button {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s;
}

.player-controls button:hover {
    color: white;
    transform: scale(1.1);
}

/* Format riêng nút Play/Pause hình tròn */
#play-pause-btn {
    background-color: white;
    color: black;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

#play-pause-btn:hover {
    transform: scale(1.05);
}

.player-volume {
    width: 30%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

/* Đẩy nội dung trang lên một chút để không bị thanh nhạc che mất Footer */
body {
    padding-bottom: 80px; 
}
/* --- PHẦN CAROUSEL CUỘN NGANG --- */
.carousel-wrapper {
    position: relative; 
    display: flex;
    align-items: center;
}

/* Lớp chứa các thẻ bài hát */
.slider-container {
    display: flex;
    gap: 20px;
    overflow-x: auto; 
    scroll-behavior: smooth; 
    padding: 10px 0;
    width: 100%;
}

/* Ẩn thanh cuộn mặc định của trình duyệt */
.slider-container::-webkit-scrollbar {
    display: none;
}

/* Đảm bảo các thẻ card không bị bóp méo khi nằm ngang */
.music-card {
    min-width: 200px; /* Chiều rộng tối thiểu của mỗi thẻ */
    flex-shrink: 0; /* Không cho phép thẻ tự thu nhỏ */
}

/* --- THIẾT KẾ 2 NÚT MŨI TÊN --- */
.nav-btn {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2); 
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.5); 
}

.prev-btn { left: -15px; }
.next-btn { right: -15px; }
/* =========================================
   PHẦN CAROUSEL CUỘN NGANG (GIỐNG HÌNH)
========================================= */
.carousel-wrapper {
    position: relative; 
    display: flex;
    align-items: center;
    width: 100%;
}

/* Lớp chứa các thẻ bài hát */
.slider-container {
    display: flex;
    gap: 20px; /* Khoảng cách giữa các thẻ */
    overflow-x: auto; 
    scroll-behavior: smooth; 
    padding: 10px 0;
    width: 100%;
}

/* Ẩn thanh cuộn mặc định của trình duyệt cho đẹp */
.slider-container::-webkit-scrollbar {
    display: none;
}

/* --- THIẾT KẾ THẺ BÀI HÁT (HIỂN THỊ ĐÚNG 4 THẺ) --- */
.music-card {
    /* Ép kích thước: 100% chia 4 thẻ, trừ đi khoảng trống gap */
    flex: 0 0 calc((100% - 60px) / 4); 
    background-color: #2a2e2a; /* Màu nền xám đen */
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.music-card:hover {
    background-color: #333833;
}

/* --- PHẦN HÌNH ẢNH TRONG THẺ (ÉP VUÔNG 100%) --- */
.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Ép khung ảnh luôn là hình vuông */
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cắt ảnh vừa khung, không bị méo hình */
}

.music-card h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: white;
    white-space: nowrap; /* Tránh rớt dòng nếu tên bài quá dài */
    overflow: hidden;
    text-overflow: ellipsis; /* Thêm dấu ... nếu tên dài */
}

.music-card p {
    font-size: 0.85rem;
    color: #a0a0a0;
}

/* --- NÚT MŨI TÊN (ĐẨY RA 2 BÊN RÌA) --- */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8); /* Màu trắng đục dễ nhìn */
    color: black;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
}
/* ========================================================
   SỬA CSS ĐỂ ẢNH RAP VIỆT LẤP ĐẦY KHUNG CHỦ ĐỀ
   ======================================================== */

/* 1. Container (.bg-1): Đảm bảo nó sẵn sàng cho định vị và cắt ảnh */
.discover-section .bg-1 {
    position: relative; /* Cần thiết cho định vị tuyệt đối */
    overflow: hidden;   /* Cắt phần ảnh bị lòi ra ngoài */
    /* Các màu nền gradient cũ có thể giữ nguyên nếu muốn một lớp nền */
}

/* 2. Tạo lớp phủ đen mờ (pseudo-element ::after) để tăng độ tương phản của chữ */
.discover-section .bg-1::after {
    content: ''; /* Cần thiết cho pseudo-element */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Lớp phủ đen mờ (40% opactiy) */
    z-index: 1; /* Nằm trên ảnh, dưới chữ */
}

/* 3. Sửa chữ (.bg-1 h3): Đảm bảo nó nằm trên cùng và có bóng để dễ đọc */
.discover-section .bg-1 h3 {
    position: relative; /* Sử dụng relative để z-index hoạt động */
    z-index: 2; /* Nằm trên lớp phủ ::after */
    color: white;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.7); /* Thêm bóng chữ mạnh */
    /* Các kiểu chữ khác giữ nguyên */
}

/* 4. Sửa hình ảnh (.bg-1 img): Ép lấp đầy và không bị méo */
.discover-section .bg-1 img {
    /* Hủy bỏ các vị trí và kích thước cũ (bottom, right, width: 80px) */
    bottom: 0 !important;
    right: 0 !important;
    transform: rotate(0deg) !important; /* Đặt về 0 độ, không xoay */

    /* Ép hình ảnh lấp đầy container */
    width: 100% !important; /* Dùng width: 100% thay vì width cố định */
    height: 100% !important;
    top: 0;
    left: 0;
    position: absolute;

    /* Ép hình ảnh lấp đầy mà không bị méo - ĐÂY LÀ PHÉP MÀU CHÍNH */
    object-fit: cover; /* Giữ tỷ lệ khung hình và lấp đầy, cắt bớt phần thừa */

    /* Nằm dưới cùng */
    z-index: 0;
}

.prev-btn { left: -15px; } /* Đẩy mũi tên trái lòi ra ngoài một chút */
.next-btn { right: -15px; } /* Đẩy mũi tên phải lòi ra ngoài một chút */