:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-color: #fff;
    --progress-bg: rgba(255, 255, 255, 0.3);
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
}

/* Page Layout - side by side on desktop */
.page-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    max-width: 900px;
    width: 100%;
}

/* Tie Dye Background */
.tie-dye-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 50%, rgba(249, 91, 91, 0.5), transparent 60%),
        radial-gradient(circle at 10% 10%, rgba(19, 239, 239, 0.5), transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(162, 238, 162, 0.5), transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(251, 251, 161, 0.5), transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(249, 208, 249, 0.5), transparent 50%);
    background-size: 200% 200%;
    background-color: #2a0a4a;
    /* Deep purple base */

    animation: tieDyeMove 20s ease infinite alternate;
}

@keyframes tieDyeMove {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 100%;
    }
}

/* Player Container */
.player-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 11px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    flex-shrink: 0;
}

.album-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.album-info h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.album-info h2 {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-secondary);
}

/* Visualizer Placeholder */
.visualizer-placeholder {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.pulse-circle {
    width: 100%;
    max-width: 333px;
    aspect-ratio: 1;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.pulse-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.download-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    cursor: pointer;
}

.download-overlay:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Track Info */
.track-info {
    text-align: center;
    margin-bottom: 1rem;
}

.track-info h3 {
    font-size: 1.1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Playback Modes */
.playback-modes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mode-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.1s, color 0.2s;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.mode-btn.active {
    opacity: 1;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.15);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.play-btn {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
}

/* Progress Bar */
.progress-area {
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--progress-bg);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Playlist */
.playlist-container {
    margin-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}

/* Bio Section */
.bio-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 11px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    flex: 1;
    max-width: 420px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.bio-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.bio-content p:last-child {
    margin-bottom: 0;
}

.bio-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.bio-content .tagline {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-style: italic;
    margin-top: 1.5rem;
    text-align: center;
}

#playlist {
    list-style: none;
}

.playlist-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.playlist-item.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.playlist-item .track-number {
    color: var(--text-secondary);
    margin-right: 1rem;
    font-size: 0.8rem;
    width: 20px;
}

.playlist-item .track-name {
    flex: 1;
}

.hidden {
    display: none;
}

/* Responsive Styles */
@media (max-width: 800px) {
    .page-layout {
        flex-direction: column;
        align-items: center;
    }

    .bio-container {
        max-width: 420px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .page-layout {
        gap: 1rem;
    }

    .player-container,
    .bio-container {
        padding: 1rem;
        border-width: 6px;
        border-radius: 16px;
    }

    .album-info {
        margin-bottom: 1rem;
    }

    .album-info h1 {
        font-size: 1.25rem;
    }

    .album-info h2 {
        font-size: 0.9rem;
    }

    .visualizer-placeholder {
        margin-bottom: 1rem;
    }

    .track-info h3 {
        font-size: 1rem;
    }

    .playback-modes {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .controls {
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .play-btn {
        width: 50px;
        height: 50px;
    }

    .progress-area {
        margin-bottom: 1rem;
    }

    .playlist-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .download-overlay {
        width: 36px;
        height: 36px;
        bottom: 8px;
        right: 8px;
    }

    .bio-content p {
        font-size: 0.9rem;
    }

    .bio-content .tagline {
        font-size: 1rem;
    }
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}