/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #121212;
    color: #fff;
}

/* Container */
.container {
    padding: 20px;
    padding-bottom: 110px;
    max-width: 1400px;
    margin: 0 auto;
    transition: margin-right 0.3s ease;
}

.container.drawer-open {
    margin-right: 350px;
}

/* Header */
.header {
    background: #181818;
    padding: 20px;
    border-bottom: 1px solid #282828;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: margin-right 0.3s ease;
}

.header.drawer-open {
    margin-right: 350px;
}

.header h1 {
    color: #1db954;
    font-size: 24px;
}

/* Button */
.btn {
    background: #1db954;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.btn:hover {
    background: #1ed760;
}

/* Container */
.container {
    padding: 20px;
    padding-bottom: 110px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Albums grid */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.album-card {
    background: #181818;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
}

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

.album-cover {
    width: 100%;
    aspect-ratio: 1;
    background: #282828;
    border-radius: 4px;
    margin-bottom: 12px;
}

.album-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.album-artist {
    color: #b3b3b3;
    font-size: 14px;
}

/* album menu */
.album-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.menu-btn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.menu-dropdown:empty {
    display: none;
}

.menu-dropdown:not(:empty) {
    position: absolute;
    top: 100%;
    right: 0;
    background: #181818;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    margin-top: 4px;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}

.menu-item:hover {
    background: #3e3e3e;
}

.menu-item.delete-item {
    color: #dc3545;
}

.menu-item.delete-item:hover {
    background: #3e3e3e;
}

/* Album detail */
.album-detail {
    margin-top: 40px;
}

.album-detail h2 {
    color: #1db954;
    margin-bottom: 10px;
}

.album-detail h3 {
    color: #b3b3b3;
    margin-bottom: 20px;
}

/* Track list */
.tracks-list {
    margin-top: 20px;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.track-item-exists {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
}

.track-item-exists.playing {
    background-color: #3a3a3a;
}

.track-item:hover {
    background: #282828;
}

.track-number {
    min-width: 30px;
    color: #b3b3b3;
}

.track-title {
    flex: 1;
}

.play-icon,
.forbidden-icon {
    margin-left: auto;
    font-size: 18px;
}

.play-icon {
    color: #fff;
}

/* Tracks drawer */
#tracks-drawer {
    position: fixed;
    right: 0;
    top: 0;
    width: 350px;
    height: calc(100vh - 90px);
    background: #181818;
    border-left: 1px solid #282828;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

#tracks-drawer:not(:empty) {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #282828;
    position: sticky;
    top: -20px;
    background: #181818;
    z-index: 10;
}

.drawer-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 15px;
}

.drawer-header h3 {
    margin: 0;
    color: #1db954;
    flex: 1;
    padding-right: 10px;
}

.album-artist {
    color: #b3b3b3;
    margin-bottom: 20px;
}

.album-cover-container {
    position: relative;
    width: 200px;
    margin-bottom: 15px;
}

.album-cover-image {
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.close-drawer {
    position: absolute;
    top: -13px;
    right: -112px;
    background: rgba(0, 0, 0, 0.6);
    color: #1db954;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-drawer:hover {
    background: rgba(0, 0, 0, 0.8);
}


/* Player bar */
#player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: #181818;
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 999;
}

.player-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.player-track-info {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.player-track-title {
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.player-track-album {
    color: #b3b3b3;
    font-size: 14px;
}

.player-content audio {
    flex: 1;
    max-width: 600px;
}
