:root {
    --primary: #8a2be2;
    --secondary: #ff007f;
    --bg-color: #0d0e15;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(var(--primary-rgb, 138, 43, 226), 0.2) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(var(--secondary-rgb, 255, 0, 127), 0.15) 0%, transparent 40%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-y: auto;
}

.player-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Library Styles */
.library-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px;
    scrollbar-width: none; /* Firefox */
}

.library-container::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.book-card {
    flex: 0 0 150px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.book-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid transparent;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.book-card span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.book-card.active img {
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(var(--primary-rgb, 138, 43, 226), 0.4);
}

.book-card.active span {
    color: var(--text-main);
}

.book-card:hover {
    transform: translateY(-5px);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 25px 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.vinyl-record {
    width: 240px;
    height: 240px;
    background: repeating-radial-gradient(
        #111 0%,
        #111 5%,
        #222 6%,
        #222 9%
    );
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    border: 4px solid rgba(255,255,255,0.05);
}

.vinyl-center {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.6), 0 0 10px rgba(0,0,0,0.5);
}

.vinyl-center::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: var(--bg-color);
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.spinning {
    animation: spin 3s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.track-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 50%, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.track-artist {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 300;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 12px;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -4px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.progress-container:hover .progress-bar::after,
.progress-container:active .progress-bar::after {
    opacity: 1;
    transform: scale(1.2);
}

.time-display {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.play-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.3), 0 0 0 0 rgba(255, 0, 127, 0.2);
}

.play-btn:hover {
    transform: scale(1.08);
    color: #fff;
    box-shadow: 0 15px 25px rgba(138, 43, 226, 0.4), 0 0 0 10px rgba(255, 0, 127, 0);
}

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

#prev-btn, #next-btn {
    font-size: 1.2rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#prev-btn:hover, #next-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(138, 43, 226, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

#prev-btn:active, #next-btn:active {
    transform: scale(0.95);
}

.playlist-controls {
    margin-top: 25px;
    width: 100%;
    display: flex;
    justify-content: center;
}

#file-upload {
    display: none;
}

.upload-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.playlist-container {
    list-style: none;
    width: 100%;
    margin-top: 15px;
    max-height: 120px;
    overflow-y: auto;
    padding-right: 5px;
}

.playlist-container::-webkit-scrollbar {
    width: 4px;
}
.playlist-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.playlist-item {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

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

.playlist-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(138,43,226,0.3), transparent);
    border-left: 2px solid var(--primary);
    font-weight: 600;
}
