body {
    font-family: 'Roboto', sans-serif;
    background-color: #121212;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none; /* Safari, Chrome, Opera, Edge */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */
    user-select: none;         /* Def */
}

html,
body {
    touch-action: none;
}

.player-container {
    background-color: #1E1E1E;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.album-art-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #333;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.album-art-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-art-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.album-art-placeholder .material-icons-sharp {
    font-size: 64px;
    color: #777;
}

.album-art-placeholder p {
    margin-top: 8px;
    color: #aaa;
    font-size: 0.875rem;
}

.song-info {
    text-align: center;
    margin-bottom: 16px;
    width: 100%;
    overflow: hidden;
}

.song-title,
.song-artist {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 0.875rem;
    color: #aaa;
}

.marquee {
    display: inline-block;
    padding-left: 100%;
    -webkit-animation-name: marquee-animation;
    animation-name: marquee-animation;
    -webkit-animation-timing-function: linear;
    animation-timing-function: linear;
    -webkit-animation-iteration-count: 1;
    animation-iteration-count: 1;
}

@-webkit-keyframes marquee-animation {
    0% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }

    100% {
        -webkit-transform: translateX(-100%);
        transform: translateX(-100%);
    }
}

@keyframes marquee-animation {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.progress-bar-container {
    width: 100%;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #444;
    border-radius: 3px;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -5px;
}

.progress-bar::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.time-display {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 16px;
}

.controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.control-button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease-out;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
}

.control-button:disabled {
    color: #555;
    cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
    .control-button:hover:not(:disabled) {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.control-button-active {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.control-button .material-icons-sharp {
    font-size: 32px;
    pointer-events: none;
}

.play-pause-button .material-icons-sharp {
    font-size: 48px;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    opacity: 1;
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.ripple.is-active {
    transform: scale(2.5);
}

.ripple.is-releasing {
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 16px;
    padding: 0 8px;
}

.folder-select-button {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #555;
    color: #fff;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 0.875rem;
    cursor: pointer;
}

.playback-speed-container,
.loop-container {
    display: flex;
    align-items: center;
}

.playback-speed-container label,
.loop-container .loop-label {
    font-size: 0.875rem;
    color: #aaa;
    margin-right: 8px;
}

.playback-speed-select {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.875rem;
    outline: none;
}

.playback-speed-select:focus {
    border-color: #777;
}

.drag-over {
    border: 2px dashed #fff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.hidden {
    display: none !important;
}

.active-loop {
    color: #60a5fa;
}

/* --- Playlist Modal Styles --- */
.playlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #282828;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    z-index: 1001;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
}

.close-modal-button {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
}

.close-modal-button .material-icons-sharp {
    font-size: 28px;
}

.playlist-items {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.playlist-items::-webkit-scrollbar {
    width: 8px;
}

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

.playlist-items::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
    background-color: #777;
}

.playlist-items li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.playlist-items li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.playlist-item-art {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #333;
    flex-shrink: 0;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
}

.playlist-item-info {
    flex-grow: 1;
    overflow: hidden;
}

.playlist-item-title {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-duration {
    font-size: 0.9rem;
    color: #aaa;
    margin-left: 16px;
    flex-shrink: 0;
}

.playlist-items li.current-track .playlist-item-title {
    color: #60a5fa;
}

.playlist-items li.current-track .playlist-item-artist {
    color: #8cc0fa;
}