.container {
    position: relative;
    width: 100%;
    height: 100%;
    container-name: expanded-album-list-item;
    container-type: inline-size;
    background-color: var(--theme-colors-surface);
    border-radius: var(--theme-radius-md);
}

.loading {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: var(--theme-spacing-sm);
}

.expanded {
    position: relative;
    gap: var(--theme-spacing-md);
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    border-radius: var(--theme-radius-md);
}

.header {
    display: flex;
    flex-direction: column;
    gap: var(--theme-spacing-xs);
}

.header-title {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.close-button {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    opacity: 0.3;
    transition: opacity 0.3s ease-in-out;

    &:hover {
        opacity: 0.6;
    }
}

.content {
    display: flex;
    flex-direction: column;
    gap: var(--theme-spacing-md);
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: var(--theme-spacing-md);
    overflow: hidden;
}

.item-title {
    z-index: 10;
    display: -webkit-box;
    padding-right: var(--theme-spacing-xl);
    overflow: hidden;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.3;
    color: black !important;
    -webkit-box-orient: vertical;
}

.item-title.dark {
    color: white !important;
}

.item-subtitle {
    z-index: 10;
    color: black;
    white-space: nowrap;
}

.item-subtitle.dark {
    color: white !important;
}

.dark {
    color: white;
}

.image-container {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    display: flex;
    grid-area: image;
    align-items: center;
    justify-content: center;
    width: 50%;
    height: 100%;
}

.play-button-group {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.container:hover .play-button-group {
    opacity: 1;
}

.background-image {
    position: absolute;
    right: 0;
    width: 60%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    filter: blur(2px);

    &::before {
        position: absolute;
        inset: 0;
        content: '';
        background: linear-gradient(to right, var(--bg-color) 0%, transparent 100%);
    }

    @container (min-width: 640px) {
        width: 80%;
    }

    @container (min-width: 768px) {
        width: 90%;
    }

    @container (min-width: 1200px) {
        width: 100%;
    }
}

.tracks {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--theme-spacing-sm);
    width: 60%;
    max-width: 700px;
    min-height: 0;

    @container (min-width: 640px) {
        width: 60%;
    }

    @container (min-width: 768px) {
        width: 50%;
    }

    @container (min-width: 1200px) {
        width: 40%;
    }
}

.tracks-list {
    display: flex;
    flex-direction: column;
}

.track-row {
    position: relative;
    display: grid;
    grid-template-columns: 55px 1fr 55px;
    gap: var(--theme-spacing-sm);
    align-items: center;
    padding: var(--theme-spacing-xs) var(--theme-spacing-sm);
    color: black;
    cursor: pointer;
}

.track-row:hover {
    background-color: rgb(0 0 0 / 20%);
}

.track-number {
    text-align: left;
}

.track-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-duration {
    text-align: right;
}

.row-selected {
    position: relative;
}

.row-selected::before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    content: '';
    background-color: rgb(0 0 0 / 20%);
    opacity: 0.7;
}

.row-selected > * {
    position: relative;
    z-index: 1;
}

.tracks.dark .track-row {
    color: white;
}

.track-row.dragging {
    opacity: 0.5;
}

.track-row.dragged-over-top::after {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 3;
    height: 2px;
    pointer-events: none;
    content: '';
    background-color: var(--theme-colors-primary);
}

.track-row.dragged-over-bottom::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    height: 2px;
    pointer-events: none;
    content: '';
    background-color: var(--theme-colors-primary);
}
