/* Modern Reset by Andy Bell - Excellent for modern browsers */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font-family: "Montserrat";
}

html {
    color-scheme: dark light;
    hanging-punctuation: first last;
}

body {
    min-height: 100dvh;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

p {
    max-width: 65ch;
    text-wrap: pretty;
}

@media (prefers-reduced-motion: no-preference) {
    :has(:target) {
        scroll-behavior: smooth;
        scroll-padding-top: 3rem;
    }
}


/* MY STUFF */

#player-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-image: url('square.jpg'); /* CSS */
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.4);
    z-index: -1;
}

#content-wrapper {
    position: relative;
    top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#now-playing {
    display: flex;
    justify-content: center;
}

#album-cover {
    display: flex;
    justify-content: center;
    width: 90vw;
}

#album-cover img {
    border-radius: 10px;
}

#song-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#waveform {
    width: 90%;
    max-width: 400px;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    padding-left: 8px;
}

#media-controls button {
    background: none;
    border: none;
}

.material-icons {
    font-size: 40px !important;
    margin: 0 20px;
}




/* ===== LYRICS DRAWER ===== */

.lyrics-drawer,
.lyrics-header,
.lyrics-content,
.lyric-group,
.drawer-handle {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
}

.lyrics-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85dvh; /* Use full height always */
    background: rgba(15, 5, 20, 0.50);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px 25px 0 0;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(calc(100% - 63px)); 
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    overscroll-behavior: contain; /* Prevent scroll chaining */
}

.lyrics-drawer.open {
    transform: translateY(0); /* Fully open */
}

.drawer-handle {
    width: 50px; /* Slightly wider for easier dragging */
    height: 6px; /* Slightly taller */
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 15px auto 12px auto; /* Adjusted margins */
    cursor: grab;
    touch-action: none;
    position: relative;
    z-index: 1001; /* Ensure it's above other elements */
}

.drawer-handle:active {
    cursor: grabbing;
}

.lyrics-header {
    text-align: center;
    padding: 0 20px 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lyrics-header h3 {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* ===== LYRICS CONTENT ===== */
.lyrics-content {
    height: calc(100% - 80px); /* Account for handle + header */
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px; /* Extra space at bottom */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.lyrics-content::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* ===== LYRIC GROUPS ===== */
.lyric-group {
    margin: 40px 0;
    opacity: 0.3;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer; /* Add cursor pointer */
}

.lyric-group:not(.active):hover {
    background: rgba(209, 163, 255, 0.05);
}

.lyric-group.active {
    opacity: 1;
    background: rgba(209, 163, 255, 0.1);
    border-left: 3px solid #d1a3ff;
    padding-left: 15px;
    transform: translateX(5px);
    cursor: default; /* Active lyric not clickable */
}

.es-line {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    line-height: 1.4;
}

.en-line {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    line-height: 1.4;
    transition: color 0.4s ease;
}

.lyric-group.active .en-line {
    color: #d1a3ff;
}

/* Prevent main content from being covered when drawer is open */
#content-wrapper {
    transition: margin-bottom 0.4s ease; 
}

.lyrics-drawer.open ~ #content-wrapper {
    margin-bottom: 30vh; /* Use margin to push content */
}

.lyrics-drawer:not(.open) .lyrics-content {
    pointer-events: none; /* Prevent scrolling when closed */
}

.lyrics-drawer.open .lyrics-content {
    pointer-events: auto; /* Allow scrolling when open */
}