.controls {
    position: fixed;
    display: flex;
    flex-direction: column;
    top: 0rem;
    left: 0rem;
    /* background-color: var(--star-grey);
    opacity: 30%; */
    background-color: var(--bright-white);
    opacity: 50%;
    padding: 0.2rem 0.2rem;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.controls:hover {
    opacity: 100%;
}

.controls button, .controls a {
    /* background: var(--bright-white); */
    background: none;
    border: none;
    padding: 0.5rem 0.5rem;
    cursor: pointer;
    font-weight: bold;
    width: auto;
    height: 2rem;
}

.controls button img,.controls a img {
    height: 100%;
}

.controls button:hover {
    background: var(--paper-yellow);
}

#toggleView {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

#toggleView img {
    width: 30px;
    height: 30px;
    transition: opacity 0.3s ease;
}


/* -------------------------------- GRID VIEW --------------------------------*/
.albums-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    justify-content: center;
    width: 80%;
    align-items: center;
}

.album-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: visible;
    border-radius: 1px;
    background-color: var(--paper-yellow);
    width: 150px;
    height: 150px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* album background colors */
.album-card:nth-child(3n + 1) {
    background-color: var(--paper-yellow);
}
.album-card:nth-child(3n + 2) {
    background-color: var(--faded-purple);
}
.album-card:nth-child(3n + 3) {
    background-color: var(--star-grey);
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.album-image {
    width: 90%;
    height: 90%;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 5%;
    left: 5%;
}

/* ranking top-right corner */
.album-ranking {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--bright-white);
    color: var(--byte-black);
    font-size: 1rem;
    font-weight: bold;
    z-index: 2;
    font-family: 'FatAlbert Shadow', 'Courier New';
}

.album-ranking div {
    width: 0px;
    overflow: visible;
}

.album-name {
    margin: 0;
    font-size: 1.0rem;
    background-color: var(--bright-white);
    color: var(--byte-black);
    margin: 0;
    font-family: 'FatAlbert Shadow', 'Courier New';
}

.album-artist {
    margin: 0;
    font-size: 0.7rem;
    background-color: var(--bright-white);
    color: var(--byte-black);
    margin: 0;
    font-family: 'FatAlbert', 'Courier New';
}

.album-info {
    position: absolute;
    bottom: 0;
    left: -0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: left;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 90%;
    box-sizing: border-box;
    word-wrap: break-word;
}


/* -------------------------------- LIST VIEW --------------------------------*/
.albums-list {
    display: none;
    flex-direction: column;
    /* gap: 1rem; */
    width: 80%;
    margin: 0 auto;
    padding: 1rem;
}

.album-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    justify-content: space-between;
    color: var(--byte-black);
    margin: 0;
    font-family: 'FatAlbert Shadow', 'Courier New';
    position: relative;
    height: 2rem;
    background: transparent;
    margin-bottom: 1rem;
    justify-content: left;
    transition: transform 0.2s ease;
}

.album-details {
    display: flex;
    flex: 1;                        
    height: 100%;                    
    justify-content: space-between;
    align-items: center;             
    gap: 1rem;
    padding: 0.2rem;
}

.album-details div {                       
    height: 100%;
    display: flex;
    align-items: center; 
    justify-content: center; 
    font-size: 1rem;
    font-family: 'FatAlbert', 'Courier New';
    background: transparent;
    overflow: hidden;
}
.album-details div span {
    background-color: var(--bright-white);
    color: var(--byte-black);
    /* display: inline; */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-details .album-name {
    flex: 1;
    justify-content: left;
    /* font-family: 'FatAlbert Shadow', 'Courier New'; */
    font-size: 1.15rem;
}

/* album background colors */
.album-row:nth-child(3n + 2) > div {
    background-color: var(--paper-yellow);
}
.album-row:nth-child(3n + 3) > div {
    background-color: var(--faded-purple);
}
.album-row:nth-child(3n + 1) > div{
    background-color: var(--star-grey);
}

.album-row .album-ranking {
    position: absolute;
    transform: translateY(-50%);
    background: var(--bright-white);
    color: var(--byte-black);
    font-weight: bold;
    font-size: 1rem;
    z-index: 10;
    padding: 0;
    height: fit-content;
    height: fit-content;
    width: fit-content;
    left: -0.4rem;
    top: 0.1rem;
}

.album-row:hover {
    transform: translateY(-5px);
    z-index: 5;
}

.album-list-image {
    object-fit: cover;
    flex: 0 0 2rem;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.2rem;
}

.album-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------------------------- SEARCH ---------------------------- */

.search-bar {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    padding: 1rem;
    font-family: 'FatAlbert', 'Courier New';
    align-items: center;
    text-align: center;
    width: 90%;
    margin-top: 2rem;
}

.search-bar input[type=text] {
    font-size: 1.5rem;
    width: 70%;
    text-align: center;
}

.search-bar button {
    font-size: 1.5rem;
    width: 50%;
    max-width: 10rem;
}

/* remove default link styling */
.albums-list a, .albums-grid a {
    text-decoration: none;      
    color: inherit;             
    font: inherit;              
    transition: color 0.3s ease;
}

.albums-list a:hover, .albums-grid a:hover {
    color: var(--smooth-purple);
}

.sortable-ghost {
    opacity: 0.3;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    /* transform: scale(1.05); */
    transition: all 0.2s;
}

.selected {
    border: 5px dashed var(--sunflower-yellow);
    opacity: 0.8;
}

@media screen and (max-width: 500px) { 
    .album-details .album-name {
        font-size: 1rem;
    }
}