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

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

.player-container {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-header h1 {
    color: #fff;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.now-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.album-art {
    width: 180px;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.album-art-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
}

.album-art-placeholder svg {
    width: 60px;
    height: 60px;
}

.track-info {
    text-align: center;
    width: 100%;
}

.track-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.progress-container {
    margin-bottom: 20px;
}

.time-display {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
    left: 0%;
}

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

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

.control-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

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

.control-btn svg {
    width: 24px;
    height: 24px;
}

.control-btn.active {
    color: #667eea;
}

.play-btn {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.play-btn:hover {
    background: linear-gradient(135deg, #7b8eee 0%, #8a5fb3 100%);
    transform: scale(1.05);
}

.play-btn svg {
    width: 32px;
    height: 32px;
}

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

.volume-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-btn svg {
    width: 24px;
    height: 24px;
}

.volume-slider-container {
    flex: 1;
}

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

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

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

.playlist-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 16px;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.playlist-header h2 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.track-count {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.playlist {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.playlist::-webkit-scrollbar {
    width: 6px;
}

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

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

.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}

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

.playlist-item.active {
    background: rgba(102, 126, 234, 0.3);
}

.playlist-item.playing .track-number {
    color: #667eea;
}

.track-number {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    width: 24px;
    text-align: center;
}

.playlist-item .track-name {
    flex: 1;
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item.active .track-name {
    color: #667eea;
}

.playing-indicator {
    display: none;
    gap: 2px;
}

.playlist-item.playing .playing-indicator {
    display: flex;
}

.playlist-item.playing .track-number span {
    display: none;
}

.playing-indicator span {
    width: 3px;
    height: 12px;
    background: #667eea;
    border-radius: 2px;
    animation: equalizer 0.8s ease-in-out infinite;
}

.playing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.playing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes equalizer {
    0%, 100% { height: 4px; }
    50% { height: 12px; }
}

.loading {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 20px;
}

.empty-message {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .player-container {
        padding: 20px;
        border-radius: 20px;
    }

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

    .track-title {
        font-size: 1.1rem;
    }

    .controls {
        gap: 12px;
    }

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

    .play-btn svg {
        width: 28px;
        height: 28px;
    }

    .playlist {
        max-height: 200px;
    }
}

@media (min-width: 768px) {
    .player-container {
        max-width: 450px;
    }

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

/* Upload Modal Styles */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.upload-overlay.active {
    display: flex;
}

.upload-modal {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    width: 100%;
    max-width: 340px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

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

.upload-header h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}

.upload-content {
    padding: 20px;
}

.password-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.password-section input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    outline: none;
}

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

.password-section input:focus {
    border-color: #667eea;
}

.upload-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.upload-btn:hover {
    transform: scale(1.02);
}

.upload-btn:active {
    transform: scale(0.98);
}

.upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.drop-zone svg {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.drop-zone p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.upload-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.upload-status.success {
    display: block;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.upload-status.error {
    display: block;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.upload-status.uploading {
    display: block;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

/* Long press visual feedback */
.album-art.pressing {
    animation: pulse 2s ease-in-out;
}

@keyframes pulse {
    0% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6); }
    100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
}
