:root {
    --bar-color-from: #d7caff;
    --bar-color-to: #b8b0ff;
    --bar-height: 100%;
    --bar-width: 6px;
    --bar-spacing: 8px;
    --bg-main: #353340;
    --bg-secondary: #393a6a;
}

/* hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;

}

html,
body {
    background: transparent;
    font-family: 'Poppins', "Segoe UI", Arial, sans-serif;
    color: white;
}

body {
    padding: 8px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    height: 100%;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.header {
    height: fit-content;
}

.main {
    width: 100%;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    border-radius: 16px;
}

.equalizer {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: end;
    gap: var(--bar-spacing);
    background-color: var(--bg-secondary);
    border-radius: 16px 16px 0 0;
}

.equalizer .bar {
    width: var(--bar-width);
    height: var(--bar-height);
    background: linear-gradient(180deg, var(--bar-color-from), var(--bar-color-to));
    border-radius: 4px;
    transition: ease-in-out 0.2s;
}

.debug {
    outline: red solid 1px;
}

.relative {
    position: relative;
    border-radius: 12px;
    text-align: center;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.songinfo{
    max-width: 45vw;
    margin: auto;
    overflow: hidden;
}

.relative h3 {
    max-width: 45vw;
    font-size: 12px;
    padding-top: 8px;
    color: #ec6c72;
    text-align: center;
    font-weight: 600;
    opacity: 0.8;
}

.relative h1.songname {
    font-size: 20px;
    font-weight: 600;
    max-width: 45vw;
    overflow: scroll;
    color: white;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s ease;
    outline: none;
    border-radius: 4px;
    white-space: nowrap;
    position: relative;
}

.relative h1.songname.scrolling {
    max-width: unset;
    overflow: visible;
    animation: marquee 10s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(200%);
    }

    100% {
        transform: translateX(-200%);
    }
}

.relative h1.songname:hover {
    color: #d7caff;
}

.relative h1.songname[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #d7caff;
}

.relative h2.artist {
    font-size: 12px;
    font-weight: 400;
    color: #b8b0ff;
    cursor: pointer;
    transition: color 0.2s ease;
    outline: none;
    padding: 2px;
    border-radius: 4px;
    max-width: 300px;
    overflow: hidden;
    white-space: nowrap;
}

.relative h2.artist.scrolling {
    animation: marqueeArtist 8s linear infinite;
}


@keyframes marqueeArtist {
    0% {
        transform: translateX(200%);
    }

    100% {
        transform: translateX(-200%);
    }
}

.relative h2.artist:hover {
    color: #d7caff;
}

.relative h2.artist[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #d7caff;
}

.absolute {
    position: absolute;
    bottom: -50px;
    right: 0;
    display: flex;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 10;
}

.absolute.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.absolute:not(.hidden) {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.absolute div {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

#addtolist {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
}

#addtolist:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    transform: translateY(-1px);
}

#cancel {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

#cancel:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

#reset {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

#reset:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

/* Control buttons styling */
#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

#controls>div {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#controls>div:hover {
    transform: scale(1.1);
}

#controls>div svg {
    width: 20px;
    height: 20px;
    fill: #d7caff;
    transition: fill 0.2s ease;
}

#controls>div:hover svg {
    fill: white;
}

.play {
    background: linear-gradient(135deg, #d7caff, #b8b0ff) !important;
}

.play svg {
    fill: var(--bg-main) !important;
}

.play:hover {
    background: linear-gradient(135deg, #e8dfff, #d7caff) !important;
    transform: scale(1.15);
}

.progressbar {
    width: 80%;
    height: 4px;
    margin: auto;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #d7caff, #b8b0ff);
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Track list animations */
.track-item {
    animation: slideInFromTop 0.5s ease-out forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: var(--h, -50px);
    opacity: 0;
    transform: translateY(-50px);
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        margin-top: var(--h, -50px);
        transform: translateY(var(--h, -50px));
    }

    to {
        opacity: 1;
        margin-top: 0;
        transform: translateY(0);
    }
}

.track-item.highlight {
    animation: highlightPulse 1s ease-out;
}

.track-item.hide{
    animation: slideOutToBottom 0.5s ease-out forwards;
}

@keyframes slideOutToBottom {
    from {
        opacity: 1;
        margin-top: 0;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        margin-top: var(--h, -50px);
        transform: translateY(var(--h, -50px));
    }
}

@keyframes highlightPulse {
    0% {
        background: linear-gradient(135deg, rgba(215, 202, 255, 0.5), rgba(184, 176, 255, 0.5));
        transform: scale(1.02);
    }

    100% {
        background: var(--bg-secondary);
        transform: scale(1);
    }
}

.track-item:hover {
    background: #393a6ab6;
    transform: translateY(-10px);
}

.track-play {
    width: 20px;
    height: 20px;
    fill: #d7caff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b8b0ff;
    flex: 1;
    overflow: hidden;
}

.track-artist {
    font-weight: 700;
    font-size: 14px;
    color: #a38dc4;
    white-space: nowrap;
    flex-shrink: 0;
}

.track-dot {
    width: 4px;
    height: 4px;
    background-color: #b8b0ff;
    border-radius: 50%;
    flex-shrink: 0;
}

.track-song {
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    max-width: 150px;
}

.track-song.scrolling {
    animation: scrollTrackText 12s linear infinite;
}

@keyframes scrollTrackText {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(0);
    }

    80% {
        transform: translateX(calc(-100% + 150px));
    }

    100% {
        transform: translateX(calc(-100% + 150px));
    }
}

.track-item.current {
    background: linear-gradient(135deg, #393a6a, #7475b3);
    border: 1px solid rgba(215, 202, 255, 0.3);
}

#track {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 10px;
}

#track .play {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    fill: #d7caff;
    transition: all 0.3s ease;
}

#track .host {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b8b0ff;
}

#track .host .artist {
    font-weight: 700;
    font-size: 14px;
    color: #a38dc4;
}

#track .host .middot {
    width: 4px;
    height: 4px;
    background-color: #b8b0ff;
    border-radius: 50%;
}

.track-item .track-delete {
  display: none;
  position: absolute;
  right: 50%;
  transform: translateX(50%) translateY(-50%);
  border-radius: 8px;
  padding: 4px;
  background-color: red;
  margin-left: 12px;
  font-size: 1.2em;
}

.track-item:hover .track-delete {
  display: inline;
}
