/* Basic Layout */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.music-container {
    display: flex;
    height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 200px;
    background-color: #ededed;
    padding: 15px;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar h5 {
    margin-top: 0;
    font-weight: 500;
    color: #666;
}

.playlist-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.playlist-menu li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    font-size: 14px;
}

.playlist-menu li a:hover {
    background-color: #e0e0e0;
}

.playlist-menu li a.active {
    background-color: #d3d3d3;
    font-weight: bold;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.playlist-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.playlist-cover-art {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.playlist-info h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.playlist-info p {
    margin: 0;
    color: #666;
}

.song-table {
    width: 100%;
    border-collapse: collapse;
}

.song-table th, .song-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.song-table th {
    color: #888;
    font-weight: 400;
}

.song-table tbody tr {
    cursor: pointer;
}

.song-table tbody tr:hover {
    background-color: #f0f0f0;
}

.song-table tbody tr.playing {
    background-color: #e6e6e6;
    color: #c72e2e;
}

.song-table td:first-child {
    width: 30px;
    color: #aaa;
    text-align: center;
}

.song-table .cover-cell {
    width: 50px;
    padding-right: 5px;
}

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
}

.player-bar .song-details {
    display: flex;
    align-items: center;
    width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-bar .song-details img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
}

.player-bar .song-details p {
    margin: 0;
    font-size: 12px;
}

.player-bar .song-details #player-title {
    font-size: 14px;
    font-weight: 500;
}

.player-controls {
    display: flex;
    align-items: center;
}

.player-controls button {
    background: none;
    border: none;
    font-size: 18px;
    margin: 0 10px;
    cursor: pointer;
    color: #333;
}

.player-controls #play-btn {
    font-size: 36px;
    color: #c72e2e;
}

.progress-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.progress-container span {
    font-size: 12px;
    color: #999;
    min-width: 35px;
    text-align: center;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    margin: 0 10px;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #e2e2e2;
    border-radius: 5px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #c72e2e;
    cursor: pointer;
    margin-top: -5px;
}

.extra-controls {
    width: 250px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

#mode-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    margin-right: 15px;
}

#speed-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 14px; /* Slightly smaller font for the number */
    cursor: pointer;
    margin-right: 15px;
    padding: 0; /* Remove default button padding */
    display: flex; /* Use flexbox to center content */
    align-items: center;
    justify-content: center;
    min-width: 30px; /* Ensure enough width for "3x" */
}

#speed-btn span {
    font-weight: bold;
}

.volume-container {
    width: 150px;
    display: flex;
    align-items: center;
}

.volume-container i {
    color: #666;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    body {
        padding-bottom: 120px;
    }

    .music-container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        box-sizing: border-box;
        height: auto;
    }

    .main-content {
        padding: 15px;
    }

    .playlist-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .playlist-cover-art {
        width: 100px;
        height: 100px;
        margin-bottom: 15px;
    }

    .playlist-info h2 {
        font-size: 20px;
    }

    .song-table th:nth-child(4), .song-table td:nth-child(4) {
        display: none;
    }

    .player-bar {
        height: auto;
        flex-direction: column;
        padding: 10px;
    }

    .player-bar .song-details {
        width: 100%;
        margin-bottom: 10px;
        justify-content: center;
    }

    .progress-container {
        width: 100%;
        order: -1;
        margin-bottom: 5px;
    }

    .player-controls {
        width: 100%;
        justify-content: center;
    }

    .extra-controls {
        display: none;
    }
}

/* Lyric Modal */
.lyric-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: hidden; /* Changed to hidden to control scrolling via inner container */
    background-color: rgba(0, 0, 0, 0.95); /* Slightly darker background */
    color: #fff;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lyric-modal-content {
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Removed .lyric-cover-container and .lyric-cover-img styles */

.lyric-text-container {
    flex: 1; /* Take full available space */
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 24px;
    line-height: 1.8;
    text-align: center;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    padding: 40px 40px 100px;
}

.lyric-line {
    margin-bottom: 15px; /* Increased space between lines */
    transition: color 0.3s ease, transform 0.3s ease; /* Smooth transition for highlighting */
    color: #bbb; /* Default color for non-active lines */
    line-height: 1.5; /* Ensure consistent line height */
}

.lyric-line.active {
    color: #fff; /* Highlight active line */
    font-size: 32px; /* Further increased font size for active line */
    font-weight: bold;
    transform: scale(1.1); /* Slightly more pronounced zoom effect */
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5); /* Add text shadow for better visibility */
}

.lyric-close-btn {
    position: fixed;
    top: 15px;
    left: 25px; /* Changed from right */
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.lyric-close-btn:hover,
.lyric-close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Rotation Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
    .lyric-modal-content {
        flex-direction: column;
        width: 95%;
        height: 90%;
    }

    .lyric-cover-container {
        padding: 10px;
        flex: none;
        height: 30%; /* Adjusted height for mobile */
        width: 100%; /* Full width on mobile */
    }

    .lyric-cover-img {
        width: 50%;
    }

    .lyric-text-container {
        font-size: 18px; /* Adjusted font size for mobile */
        flex: 1;
        padding: 20px;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: .25rem;
}

.page-item {
    margin: 0 2px;
}

.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

.page-link {
    position: relative;
    display: block;
    padding: .5rem .75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
    border-radius: .25rem;
}

.page-link:hover {
    z-index: 2;
    color: #0056b3;
    text-decoration: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}