/* Thiết lập chung */
body {
    background-color: #f4f4f4;
    display: flex;
    /* Dùng flex */
    flex-direction: column;
    /* Quan trọng: xếp các phần tử con theo cột (dọc) */
    justify-content: center;
    align-items: center;
    min-height: 0vh;
    margin: 0;
    font-family: Arial, sans-serif;
    padding: 5px;
}
* {
    box-sizing: border-box;
}
/* --- 1. Thiết lập Khung Chứa Tổng Thể --- */
.main-player-wrapper {
    /* 💡 Chiều rộng tối đa là 600px */
    max-width: 600px;
    /* 💡 Chiều rộng mặc định là 100% của phần tử cha (body), 
       * nhưng sẽ không vượt quá max-width. */
    width: 100%;
    /* Canh giữa khung chứa trên màn hình lớn */
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    /* Thêm padding ngang nhỏ để tránh dính lề trên màn hình rất nhỏ (mobile) */
}
/* Container Chính */
.player-container {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 20px;
    /* Thêm khoảng cách với Playlist */
    /* display: block; (Mặc định div đã là block, nhưng có thể thêm vào để chắc chắn) */
}
/* Thông tin bài hát */
.song-info {
    margin-bottom: 20px;
}
#title {
    margin: 10px 0 5px;
    color: #333;
}
#artist {
    margin: 0;
    color: #777;
    font-size: 0.9em;
}
/* Ảnh bìa */
#cover {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    /* Hình tròn */
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: rotate 15s linear infinite;
    /* Animation quay */
    animation-play-state: paused;
    /* Tạm dừng khi chưa phát */
}
.playing #cover {
    animation-play-state: running;
    /* Bắt đầu quay khi phát */
}
/* Keyframes cho Animation Quay */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
/* Thanh tiến trình */
.progress-container {
    background: #e0e0e0;
    border-radius: 5px;
    height: 8px;
    width: 100%;
    cursor: pointer;
    margin-bottom: 5px;
}
.progress {
    background-color: #3498db;
    /* Màu xanh nổi bật */
    border-radius: 5px;
    height: 100%;
    width: 0%;
    /* Ban đầu là 0% */
    transition: width 0.1s linear;
}
/* Hiển thị thời gian */
.time-container {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #555;
    margin-bottom: 20px;
}
/* Nút điều khiển */
.controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.control-btn {
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 10px;
    transition: background-color 0.3s ease, transform 0.1s ease;
}
.control-btn:hover {
    background-color: #2980b9;
}
.control-btn:active {
    transform: scale(0.95);
}
.control-btn.large {
    font-size: 1.5em;
    padding: 15px;
    display: flex;
    justify-content: center;
    /* Căn giữa ngang */
    align-items: center;
    /* Căn giữa dọc */
    width: 60px;
    /* Thử nghiệm giá trị này */
    height: 60px;
    /* Phải bằng width */
    border-radius: 50%;
    /* Quan trọng: Giữ nút luôn tròn */
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.4);
}
/* Danh sách playlist */
/* Danh sách phát */
/* Container của Danh sách Phát */
.playlist-container {
    /* Quan trọng: đặt chiều rộng BẰNG với player-container */
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    max-height: 250px;
    overflow-y: auto;
    background-color: #fff;
    /* Nên thêm màu nền cho đẹp */
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    /* Thêm bóng mờ */
    padding: 15px 5px;
    /* Giảm padding một chút so với player chính */
}
#playlist {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}
.playlist-item {
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
}
.playlist-item:hover {
    background-color: #f0f0f0;
}
/* Đánh dấu bài hát đang phát */
.playlist-item.active {
    background-color: #e6f7ff;
    /* Màu xanh nhạt */
    color: #3498db;
    font-weight: bold;
    border-left: 5px solid #3498db;
    padding-left: 5px;
}
.song-title,
.song-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8em;
    color: #333;
}
.song-title {
    flex-grow: 1;
    /* Cho phép nó mở rộng tối đa */
    max-width: 65%;
    /* Giới hạn tối đa 65% chiều rộng item */
}
.song-artist {
    flex-shrink: 0;
    /* Ngăn nó co lại (chắc chắn hiển thị) */
    max-width: 30%;
    /* Giới hạn tối đa 30% chiều rộng item */
    text-align: right;
}
h3 {
    color: #333;
}
.playlist-item.active .song-artist {
    color: #3498db;
    /* Giữ màu chữ trong suốt */
}
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    /* flex-direction: column; */
    padding: 20px 0;
    background: #f5f5f5;
}
.footer-text {
    text-align: center;
    margin: 4px 0;
    font-size: 15px;
    color: #333;
    padding: 0 10px 0;
}
footer a {
    color: #ff3300;
    text-decoration: none;
    transition: color 0.3s;
}
.search-box {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, opacity 0.25s ease;
}
/* Ẩn khi kéo xuống */
.search-box.hide {
    transform: translateY(-100%);
    opacity: 0;
}
/* Hiện khi kéo lên */
.search-box.show {
    transform: translateY(0);
    opacity: 1;
}
/* Container input full width */
.search-container {
    display: flex;
    align-items: center;
    width: 100%;
    background: #f3f3f3;
    border-radius: 10px;
    padding: 5px 5px;
    gap: 10px;
    border: 1px solid #d6d6d6;
}
.input-wrap {
    display: flex;
    width: 100%;
    height: 30px;
    align-items: center;
    align-self: center;
}
/* Icon search */
.search-icon {
    font-size: 18px;
    opacity: 0.7;
}
/* Input đẹp – full width */
.search-container input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
}
.home {
    display: block;
    font-size: 18px;
    text-align: left;
    margin-bottom: 10px;
    color: #000;
    font-weight: 600;
    margin-top: -5px;
    align-items: center;
}
.home a {
    color: #000;
    text-decoration: none;
}
.home a:hover {
    color: #d10956;
    text-decoration: none;
}
.home .home-left {
    display: inline-flex;
    float: inline-end;
    gap: 8px;
    margin-top: 3px;
}