/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 420px;
    position: relative;
}

/* Main Music Player Container */
.music-player {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 32px 28px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.music-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    border-radius: 24px 24px 0 0;
}

/* Header Section */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.app-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.equalizer {
    display: flex;
    gap: 3px;
    align-items: flex-end;
}

.equalizer .bar {
    width: 3px;
    background: linear-gradient(180deg, #ff6b6b, #feca57);
    border-radius: 2px;
    animation: equalizer 1.2s ease-in-out infinite;
}

.equalizer .bar:nth-child(1) {
    height: 16px;
    animation-delay: 0s;
}

.equalizer .bar:nth-child(2) {
    height: 12px;
    animation-delay: 0.2s;
}

.equalizer .bar:nth-child(3) {
    height: 20px;
    animation-delay: 0.4s;
}

@keyframes equalizer {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.3); }
}

/* Album Art Section */
.album-section {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.album-art {
    position: relative;
    width: 220px;
    height: 220px;
}

.album-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
    animation: vinyl-spin 20s linear infinite paused;
}

.album-cover.playing {
    animation-play-state: running;
}

.vinyl-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    z-index: 3;
}

@keyframes vinyl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Song Information */
.song-info {
    text-align: center;
    margin-bottom: 28px;
}

.song-title {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.artist-name {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.album-name {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 400;
}

/* Progress Section */
.progress-section {
    margin-bottom: 32px;
}

.progress-container {
    position: relative;
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    right: -8px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-bar:hover .progress-thumb {
    opacity: 1;
}

.time-display {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
}

/* Main Controls */
.main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 28px;
}

.control-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.control-btn svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    color: white;
    transform: scale(1.1);
}

.control-btn.active {
    color: #ff6b6b;
}

.play-pause-btn {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    box-shadow: 0 8px 16px rgba(255, 107, 107, 0.4);
}

.play-pause-btn svg {
    width: 32px;
    height: 32px;
}

.play-pause-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(255, 107, 107, 0.6);
}

.shuffle-btn,
.repeat-btn {
    width: 40px;
    height: 40px;
}

.prev-btn,
.next-btn {
    width: 48px;
    height: 48px;
}

/* Volume Section */
.volume-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.volume-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: color 0.3s ease;
}

.volume-btn:hover {
    color: white;
}

.volume-btn svg {
    width: 20px;
    height: 20px;
}

.volume-slider-container {
    flex: 1;
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.volume-slider {
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    position: relative;
    z-index: 2;
}
.volume-bar {
    position: relative;
    cursor: pointer;
    /* Add appropriate width, height, background, etc. */
}

.volume-fill {
    pointer-events: none; /* Allow clicks to pass through to parent */
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    border-radius: 2px;
    width: 70%;
    transition: width 0.1s ease;
}

.volume-percentage {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    min-width: 35px;
    text-align: right;
}

/* Additional Controls */
.additional-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.feature-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: linear-gradient(90deg, #ff6b6b, #feca57);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

.playlist-toggle-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.playlist-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.playlist-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* Playlist */
.playlist-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.playlist-container.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-header h4 {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.playlist-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-action-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.playlist-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.playlist-action-btn svg {
    width: 18px;
    height: 18px;
}

.close-playlist {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-playlist:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.playlist-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.playlist {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 4px;
    position: relative;
    group: hover;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.playlist-item.active {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.2), rgba(254, 202, 87, 0.2));
    border-left: 3px solid #ff6b6b;
}

.playlist-item-icon {
    font-size: 28px;
    margin-right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    color: white;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-duration {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 500;
    margin-right: 12px;
    flex-shrink: 0;
}

.playlist-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-item:hover .playlist-item-actions {
    opacity: 1;
}

.playlist-item-action {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.playlist-item-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.playlist-item-action.delete:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.playlist-item-action svg {
    width: 16px;
    height: 16px;
}

.empty-playlist {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-playlist-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-playlist-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-playlist-subtext {
    font-size: 13px;
    opacity: 0.7;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 8px;
    margin-bottom: 8px;
    color: #666;
    font-size: 12px;
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #333;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Scrollbar Styling */
.playlist::-webkit-scrollbar {
    width: 4px;
}

.playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.playlist::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff6b6b, #feca57);
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 0;
    }
    
    .music-player {
        padding: 24px 20px;
        border-radius: 20px;
    }
    
    .album-cover {
        width: 180px;
        height: 180px;
        font-size: 48px;
    }
    
    .main-controls {
        gap: 12px;
    }
    
    .play-pause-btn {
        width: 56px;
        height: 56px;
    }
    
    .play-pause-btn svg {
        width: 28px;
        height: 28px;
    }
    
    .prev-btn,
    .next-btn {
        width: 44px;
        height: 44px;
    }
    
    .shuffle-btn,
    .repeat-btn {
        width: 36px;
        height: 36px;
    }
    
    .song-title {
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .album-cover {
        width: 160px;
        height: 160px;
        font-size: 42px;
    }
    
    .song-title {
        font-size: 18px;
    }
    
    .main-controls {
        gap: 8px;
    }
}

/* Animation for loading */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.music-player {
    animation: fadeIn 0.8s ease-out;
}