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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1e3f 50%, #0a0e27 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 1rem 0;
}

#waveBackground {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
    pointer-events: none;
}

/* Remove old background image overlay */
body::before {
    content: none;
}

.container {
    max-width: 720px;
    width: 90%;
    z-index: 10;
    position: relative;
}

/* Main container */
.main-container {
    max-width: 720px;
    width: 90%;
    z-index: 10;
    position: relative;
}

/* Unified glass card */
.glass-card {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card header with logo */
.card-header {
    margin-bottom: 2rem;
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.9);
}

.logo svg {
    color: #00d4ff;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.track-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 5px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #00d4ff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.playlist-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(0, 212, 255, 0.8);
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 20px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.loading-status {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(167, 139, 250, 0.8);
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.status-text {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Waveform Container */
.waveform-container {
    position: relative;
    height: 300px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#waveformCanvas {
    display: none;
}

.play-button-overlay {
    position: relative;
    z-index: 3;
}

.play-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
    transform: scale(1.1);
}

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

.orbital-ring {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

.player-card.playing .orbital-ring {
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.glass-card.playing {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 212, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card.playing .orbital-ring {
    animation: rotate 20s linear infinite;
}

/* Playback controls wrapper */
.playback-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    color: #00d4ff;
    transform: scale(1.1);
}

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

/* URL Input at bottom */
.url-input-container {
    display: flex;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 2rem;
}

.url-input-container:focus-within {
    border-color: rgba(0, 212, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    outline: none;
}

.url-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.load-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.load-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

.load-btn:active {
    transform: translateY(0);
}

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

.volume-slider-container {
    flex: 1;
    max-width: 120px;
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    transition: all 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(0, 212, 255, 0.4);
}

.control-btn.active {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border-color: rgba(0, 212, 255, 0.5);
}

/* Progress Bar */
.progress-container {
    margin-top: 1.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff 0%, #a78bfa 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.time-display {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: center;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.progress-bar {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 1.5rem;
}

/* Buffering status */
.buffering-status {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.buffering-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
}

.buffering-header svg {
    color: #00d4ff;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.buffering-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buffering-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.buffering-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.buffering-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.buffering-stats {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 0.75rem;
}

/* Playlist songs view */
.playlist-songs {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.close-playlist {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.close-playlist:hover {
    color: rgba(255, 255, 255, 1);
}

.playlist-items {
    overflow-y: auto;
    max-height: 350px;
}

.playlist-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.playlist-item.playing {
    background: rgba(0, 212, 255, 0.1);
    border-left: 3px solid #00d4ff;
}

.playlist-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.playlist-item.disabled:hover {
    background: transparent;
}

.playlist-item-index {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    min-width: 25px;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-item-duration {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.playlist-item-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.playlist-item-status.downloading {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

/* Responsive */
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    text-align: center;
    animation: slideIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        width: 95%;
    }
    
    .glass-card {
        padding: 2rem 1.5rem;
    }
    
    .url-input-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .load-btn {
        justify-content: center;
        width: 100%;
    }
    
    .track-title {
        font-size: 1.2rem;
        letter-spacing: 3px;
    }
    
    .waveform-container {
        height: 250px;
    }
    
    .play-button {
        width: 60px;
        height: 60px;
    }
    
    .play-button svg {
        width: 24px;
        height: 24px;
    }
    
    .orbital-ring {
        width: 150px;
        height: 150px;
    }
    
    .playback-controls-wrapper {
        gap: 1.5rem;
    }
    
    .nav-btn {
        width: 44px;
        height: 44px;
    }
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .container, .main-container {
        width: 100%;
        padding: 0;
        max-width: 100vw;
    }
    
    .player-card {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
        border-radius: 20px;
    }
    
    .track-title {
        font-size: 0.95rem;
        letter-spacing: 1.5px;
    }
    
    .subtitle {
        font-size: 0.7rem;
    }
    
    .waveform-container {
        height: 180px;
        margin-bottom: 1rem;
    }
    
    .playback-controls-wrapper {
        gap: 0.75rem;
    }
    
    .nav-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    
    .nav-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .play-button {
        width: 48px;
        height: 48px;
    }
    
    .play-button svg {
        width: 20px;
        height: 20px;
    }
    
    .orbital-ring {
        width: 100px;
        height: 100px;
    }
    
    .controls {
        gap: 0.5rem;
        margin-bottom: 1rem;
        flex-wrap: nowrap;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        flex-shrink: 0;
    }
    
    .control-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .volume-slider-container {
        flex: 1;
        max-width: none;
        min-width: 60px;
    }
    
    .progress-container {
        margin-top: 1rem;
        gap: 0.5rem;
    }
    
    .time-display {
        font-size: 0.7rem;
        min-width: 32px;
    }
    
    .url-input-container {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    input[type="text"] {
        font-size: 0.85rem;
        padding: 0.7rem 1rem;
    }
    
    .load-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        justify-content: center;
        width: 100%;
    }
    
    .playlist-songs {
        max-height: 250px;
        font-size: 0.85rem;
        margin-top: 1rem;
    }
    
    .playlist-items {
        max-height: 200px;
    }
    
    .playlist-item {
        padding: 0.6rem 0.75rem;
        gap: 0.5rem;
    }
    
    .playlist-item-title {
        font-size: 0.8rem;
    }
    
    .time-display {
        font-size: 0.7rem;
    }
    
    .buffering-status {
        font-size: 0.85rem;
        padding: 0.65rem 0.85rem;
    }
}

/* Equalizer Panel */
.equalizer-panel {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.equalizer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.equalizer-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 1px;
}

.close-equalizer {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
}

.close-equalizer:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.equalizer-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.eq-preset {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.eq-preset:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.eq-preset.active {
    background: rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.6);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

@media (max-width: 600px) {
    .equalizer-presets {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .eq-preset {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}
