/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #121212;
    color: #ffffff;
    line-height: 1.6;
}

.player-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.player-header {
    text-align: center;
    margin-bottom: 30px;
}

.player-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1DB954;
}

/* Main content */
.player-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Now playing section */
.now-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.song-info {
    width: 100%;
}

.song-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.song-artist {
    font-size: 1rem;
    color: #b3b3b3;
}

.song-album {
    font-size: 0.875rem;
    color: #888888;
    margin-top: 5px;
}

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

.album-placeholder {
    width: 100%;
    height: 100%;
    background-color: #282828;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #1DB954;
}

/* Progress bar */
.progress-container {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #404040;
    border-radius: 2px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background-color: #1DB954;
    border-radius: 2px;
    width: 0%;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #b3b3b3;
}

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

.control-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

.play-pause-btn {
    width: 56px;
    height: 56px;
    background-color: #1DB954;
}

.play-pause-btn:hover {
    background-color: #1ed760;
}

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

/* Volume control */
.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider {
    flex: 1;
}

.volume-slider input {
    width: 100%;
    height: 4px;
    background-color: #404040;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.volume-slider input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider input::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.playback-settings {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px;
    border: 1px solid #1f1f1f;
    border-radius: 10px;
    background-color: #161616;
}

.settings-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-row label {
    font-size: 0.9rem;
    color: #b3b3b3;
}

.settings-row select {
    background-color: #1f1f1f;
    color: #ffffff;
    border: 1px solid #2b2b2b;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    outline: none;
}

.settings-row select:focus {
    border-color: #1DB954;
}

.sleep-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.secondary-btn {
    background-color: #232323;
    border: 1px solid #2f2f2f;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    min-width: 90px;
    font-weight: 600;
}

.secondary-btn:hover {
    background-color: #2c2c2c;
}

.secondary-btn:active {
    transform: translateY(1px);
}

.secondary-btn.active {
    border-color: #1DB954;
    color: #1DB954;
}

.sleep-status {
    font-size: 0.9rem;
    color: #b3b3b3;
}

/* Playlist */
.playlist-container {
    flex: 1;
    overflow-y: auto;
}

.playlist-container h2 {
    margin-bottom: 15px;
    font-size: 1.25rem;
    font-weight: 600;
}

.playlist {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

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

.playlist-item.active {
    background-color: rgba(29, 185, 84, 0.2);
    color: #1DB954;
}

.playlist-item-number {
    width: 30px;
    text-align: center;
    color: #b3b3b3;
    font-size: 0.875rem;
}

.playlist-item.active .playlist-item-number {
    color: #1DB954;
}

.playlist-item-title {
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    min-width: 0; /* Allows flex item to shrink */
}

.playlist-item-duration {
    color: #b3b3b3;
    font-size: 0.875rem;
}

.loading-message {
    text-align: center;
    color: #b3b3b3;
    padding: 20px;
}

/* Responsive design */
@media (min-width: 768px) {
    .player-container {
        padding: 40px;
    }
    
    .album-art {
        width: 240px;
        height: 240px;
    }
    
    .album-placeholder {
        font-size: 5rem;
    }
}

@media (max-width: 480px) {
    .player-container {
        padding: 15px;
    }
    
    .album-art {
        width: 180px;
        height: 180px;
    }
    
    .album-placeholder {
        font-size: 3.5rem;
    }
    
    .song-title {
        font-size: 1.25rem;
    }
    
    .control-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .play-pause-btn {
        width: 48px;
        height: 48px;
    }
    
    .play-pause-btn svg {
        width: 28px;
        height: 28px;
    }
}

/* Touch-friendly controls for mobile */
@media (hover: none) {
    .control-btn {
        padding: 12px;
    }
    
    .playlist-item {
        padding: 15px;
    }
}
