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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 50%, #000000 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.music-player {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 24px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 8px 32px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    position: relative;
    will-change: transform;
    transform: translateZ(0);
}

.player-header {
    margin-bottom: 24px;
}

.player-header h1 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    opacity: 0.95;
}

.album-art {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    will-change: transform;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.playing .album-art img {
    animation: spin 20s linear infinite;
}

.vinyl-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.vinyl-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

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

.track-info {
    margin-bottom: 24px;
}

.track-info h2 {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 400;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 4px;
}

.progress-container span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 32px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 24px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    transform: translateY(-50%);
}

.progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 6px;
    background: linear-gradient(90deg, #ffffff, #cccccc);
    border-radius: 3px;
    width: 0%;
    transform: translateY(-50%);
    transition: width 0.1s ease;
    will-change: width;
    z-index: 5;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: left, transform;
    z-index: 10;
}

.progress-handle:hover,
.progress-handle:active {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.progress-bar:hover .progress-handle {
    opacity: 1;
    visibility: visible;
}

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

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

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

.play-pause {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 1.2rem;
}

.play-pause:hover {
    background: rgba(255, 255, 255, 0.25);
}

.repeat-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #4CAF50;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 8px;
}

.volume-container i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.volume-slider {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.playlist {
    text-align: left;
}

.playlist h3 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-container {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.playlist-container::-webkit-scrollbar {
    width: 4px;
}

.playlist-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.playlist-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.playlist-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.playlist-item i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.track-details {
    flex: 1;
    min-width: 0;
}

.track-name {
    display: block;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-artist {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.track-controls {
    display: flex;
    gap: 8px;
}

.save-btn, .remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.save-btn:hover, .remove-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.save-btn.saved {
    color: #ff4757;
}

.remove-btn:hover {
    color: #ff4757;
}

.upload-section {
    margin-top: 16px;
    text-align: center;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.auto-fetch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(74, 144, 226, 0.2);
    color: #4a90e2;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(74, 144, 226, 0.3);
    backdrop-filter: blur(10px);
    margin-top: 10px;
    border: none;
}

.auto-fetch-btn:hover {
    background: rgba(74, 144, 226, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.2);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.fa-robot {
    color: #4a90e2;
    font-size: 0.8rem;
    margin-left: 4px;
}

@media (max-width: 480px) {
    .music-player {
        padding: 24px 20px;
        max-width: 320px;
    }

    .album-art {
        width: 160px;
        height: 160px;
    }

    .controls {
        gap: 16px;
    }

    .control-btn:not(.play-pause) {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .play-pause {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .track-info h2 {
        font-size: 1.1rem;
    }
}

@supports (backdrop-filter: blur()) {
    .music-player {
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(40px);
    }
}
