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

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

#app {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cover-wrapper {
    position: relative;
    margin: 0 auto 20px;
    width: 260px;
    height: 260px;
}

.cover {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.3s;
}

.cover:hover .cover-overlay {
    opacity: 1;
}

.play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    font-size: 28px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.play-btn:hover {
    transform: scale(1.1);
    background: #fff;
}

.track-info {
    text-align: center;
    margin-bottom: 20px;
}

.track-info h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.track-info p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.progress-wrapper span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    min-width: 40px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s;
}

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

.ctrl-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.main-btn {
    width: 64px;
    height: 64px;
    font-size: 28px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.main-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(79, 172, 254, 0.6);
}

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

.extra-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
    padding: 4px 8px;
}

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

.extra-btn.active {
    color: #4facfe;
}

.playlist-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

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

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

.playlist-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.playlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.playlist li {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist li:hover {
    background: rgba(255, 255, 255, 0.08);
}

.playlist li.active {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
}

.playlist li .track-duration {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* Анимация вращения для проигрывания */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 4s linear infinite;
}

/* Адаптивность */
@media (max-width: 440px) {
    #app {
        padding: 16px;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .cover-wrapper {
        width: 200px;
        height: 200px;
    }
}
/* Вкладки */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

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

.tab-btn.active {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Плейлисты */
.playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.playlists-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.create-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.create-btn:hover {
    transform: scale(1.05);
}

.playlists-list {
    max-height: 400px;
    overflow-y: auto;
}

.playlists-list::-webkit-scrollbar {
    width: 4px;
}

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

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: 0.3s;
}

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

.playlist-item-info {
    flex: 1;
    cursor: pointer;
}

.playlist-item-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.playlist-item-info p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.playlist-item-actions {
    display: flex;
    gap: 6px;
}

.playlist-item-actions button {
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.playlist-item-actions .play-btn-sm {
    background: rgba(79, 172, 254, 0.3);
    color: #4facfe;
}

.playlist-item-actions .play-btn-sm:hover {
    background: rgba(79, 172, 254, 0.5);
}

.playlist-item-actions .rename-btn {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.playlist-item-actions .rename-btn:hover {
    background: rgba(255, 193, 7, 0.4);
}

.playlist-item-actions .delete-btn {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.playlist-item-actions .delete-btn:hover {
    background: rgba(244, 67, 54, 0.4);
}

.loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px 0;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    padding: 24px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

.modal-content input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    margin-bottom: 16px;
}

.modal-content input:focus {
    outline: none;
    border-color: #4facfe;
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

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

.modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-btn.confirm {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
}

.modal-btn.confirm:hover {
    transform: scale(1.05);
}
