:root {
    --primary: #bc13fe;
    --secondary: #00f2ff;
    --accent: #bc13fe;
    /* Warm theme overrides */
    --bg-dark: #121212;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

/* New Warm Blurred Background */
.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Warm brownish tone matches reference */
    background: radial-gradient(circle at 50% 30%, #5d4037, #1a1a1a);
    z-index: -1;
}

/* --- Player Container (Soft Modern) --- */
.player-container {
    width: 100%;
    max-width: 400px;
    height: 100vh;
    max-height: 850px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 16px;
    background: transparent;
    /* Let body bg show */
    /* Remove borders/shadows for full screen look on mobile */
    border: none;
    box-shadow: none;
    overflow: hidden;
    margin: 0 auto;
}

@media (min-width: 500px) {
    .player-container {
        max-width: 400px;
        height: min(85vh, 720px);
        margin: 20px auto;
        border-radius: 32px;
        background: transparent;
        border: 1px solid var(--glass-border);
        box-shadow: none;
    }
}

/* --- Album Art Section --- */
.album-section {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    flex-shrink: 0;
}

.album-art-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#album-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-overlay-top {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
}

.album-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 2;
}

.track-details h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-details p {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    backdrop-filter: blur(4px);
}

.overlay-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.left-actions,
.right-actions {
    display: flex;
    gap: 8px;
}

/* --- Buttons --- */
.icon-btn {
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: transform 0.1s;
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* --- Secondary Controls Row --- */
.secondary-controls {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.sec-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 48px;
    height: 48px;
    border-radius: 16px;
    /* Squircle */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.sec-btn svg {
    width: 20px;
    height: 20px;
}

.sec-btn.active-glowing {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* --- Waveform --- */
.waveform-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 50px;
    margin-bottom: 20px;
    opacity: 0.8;
    flex-shrink: 0;
}

.wave-bar {
    width: 4px;
    background: var(--text-secondary);
    border-radius: 2px;
    height: 10px;
    transition: height 0.2s ease;
}

.wave-bar.active {
    background: white;
    height: 30px;
}

/* --- Playback Controls --- */
.playback-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.time-current,
.time-total {
    font-size: 11px;
    font-weight: 600;
    color: white;
    width: 40px;
    text-align: center;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.control-btn.small {
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--text-secondary);
}

.control-btn.medium {
    width: 50px;
    height: 50px;
}

.play-btn-large {
    width: 72px;
    height: 72px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: black;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.play-btn-large svg {
    width: 32px;
    height: 32px;
    fill: black;
    margin-left: 2px;
    /* Visual centering adjustment */
}

/* --- Queue Info --- */
.queue-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: auto;
    /* Push footer down */
    font-size: 10px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    align-self: center;
}

.queue-info svg {
    width: 12px;
    height: 12px;
}

/* --- Bottom Nav --- */
.bottom-nav {
    display: flex;
    justify-content: space-between;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    padding: 15px 30px;
    border-radius: 30px;
    margin-top: 10px;
    flex-shrink: 0;
}

.nav-item {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.nav-item.active {
    color: white;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* Animation classes */
@keyframes waveAnim {

    0%,
    100% {
        height: 10px;
        opacity: 0.5;
    }

    50% {
        height: 40px;
        opacity: 1;
    }
}

.wave-bar.playing {
    animation: waveAnim 1s infinite ease-in-out;
}

/* --- PRESERVED LIBRARY STYLES --- */

/* Library Header */
header[style*="background"] {
    /* Retaining inline styles from React mostly, but enforcing z-index */
    z-index: 100;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* Mini Player Animation */
.mini-player {
    animation: slideUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 1000;
    /* Ensure above everything */
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.track-item.active {
    border-left: 3px solid var(--primary);
    background: rgba(255, 255, 255, 0.1) !important;
}

.track-item:active {
    transform: scale(0.98);
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* No scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}
/* Offline Download Animation */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.icon-btn.downloading-spin svg {
    animation: spin 1s linear infinite;
    opacity: 0.7;
}

.icon-btn.active svg {
    color: var(--accent) !important;
    stroke: var(--accent) !important;
    fill: none;
}
