/* Основные стили липкого плеера */
.sticky-audio-player {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    direction: ltr;
    unicode-bidi: embed;
}

/* Кастомные ползунки */
.sticky-audio-player input[type="range"] {
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    transition: background 0.3s;
}

.sticky-audio-player input[type="range"]:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sticky-audio-player input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.sticky-audio-player input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.sticky-audio-player input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Кнопки */
.sticky-audio-player button {
    transition: all 0.2s;
    border-radius: 4px;
    cursor: pointer;
}

.sticky-audio-player button:hover {
    opacity: 1 !important;
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1) !important;
}

.sticky-audio-player button:active {
    transform: scale(0.95);
}

/* Активные кнопки режимов */
.sticky-audio-player button.active {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Анимация появления */
.sticky-audio-active {
    padding-bottom: 70px;
    transition: padding-bottom 0.3s ease;
}

/* Стили для кнопок запуска аудио */
.sticky-audio-trigger {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 10px 15px;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

.sticky-audio-trigger:hover {
    background: #667eea !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sticky-audio-trigger.active {
    background: #667eea !important;
    color: white !important;
    border-color: #764ba2;
}

.sticky-audio-trigger.active svg {
    fill: white !important;
}

/* Плейлист */
.sticky-audio-playlist {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.sticky-playlist-item {
    transition: all 0.2s;
}

.sticky-playlist-item:hover {
    background: #f8f9fa !important;
}

.sticky-playlist-item.active {
    background: #eef2ff !important;
    color: #667eea !important;
    font-weight: 500;
}

.sticky-playlist-item.playing {
    position: relative;
}

.sticky-playlist-item.playing::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #667eea;
}

/* Полоса прокрутки для плейлиста */
.sticky-playlist-list::-webkit-scrollbar {
    width: 6px;
}

.sticky-playlist-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sticky-playlist-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sticky-playlist-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Анимация загрузки */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.sticky-audio-loading {
    animation: pulse 1.5s infinite;
}

/* Поддержка RTL (справа налево) */
html[dir="rtl"] .sticky-audio-player {
    direction: rtl;
}

html[dir="rtl"] .sticky-audio-trigger svg {
    margin-right: 0;
    margin-left: 8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sticky-audio-player {
        flex-wrap: wrap;
        padding: 10px !important;
    }
    
    .sticky-audio-player > div:nth-child(2) {
        order: 3;
        flex: 1 0 100%;
        margin: 10px 0 0 0 !important;
    }
    
    .sticky-audio-player > div:first-child {
        flex: 1 0 100%;
        margin-bottom: 10px;
    }
    
    .sticky-audio-player > div:last-child {
        display: none !important;
    }
    
    .sticky-audio-cover {
        width: 40px !important;
        height: 40px !important;
    }
    
    .sticky-audio-title {
        font-size: 13px !important;
    }
    
    .sticky-audio-artist {
        font-size: 11px !important;
    }
    
    .sticky-audio-album {
        display: none !important;
    }
    
    .sticky-audio-playlist {
        width: calc(100% - 40px) !important;
        right: 20px !important;
        left: 20px !important;
        max-height: 300px !important;
    }
}

@media (max-width: 480px) {
    .sticky-audio-player {
        padding: 8px !important;
    }
    
    .sticky-audio-cover {
        display: none !important;
    }
    
    .sticky-audio-title {
        font-size: 12px !important;
    }
    
    .sticky-audio-artist {
        font-size: 10px !important;
    }
    
    .sticky-audio-current-time,
    .sticky-audio-time {
        font-size: 10px !important;
        min-width: 35px !important;
    }
    
    .sticky-audio-playlist {
        max-height: 250px !important;
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .sticky-audio-trigger {
        background: #2d3748 !important;
        border-color: #667eea !important;
        color: #e2e8f0 !important;
    }
    
    .sticky-audio-trigger:hover {
        background: #667eea !important;
        color: white !important;
    }
    
    .sticky-audio-playlist {
        background: #2d3748 !important;
        color: #e2e8f0 !important;
    }
    
    .sticky-playlist-item:hover {
        background: #4a5568 !important;
    }
    
    .sticky-playlist-item.active {
        background: #434190 !important;
    }
    
    .sticky-playlist-list::-webkit-scrollbar-track {
        background: #4a5568;
    }
    
    .sticky-playlist-list::-webkit-scrollbar-thumb {
        background: #718096;
    }
    
    .sticky-playlist-list::-webkit-scrollbar-thumb:hover {
        background: #a0aec0;
    }
}

/* Высокий контраст для доступности */
@media (prefers-contrast: high) {
    .sticky-audio-player {
        background: #000 !important;
        border-top: 2px solid #fff;
    }
    
    .sticky-audio-player button {
        border: 1px solid #fff !important;
    }
    
    .sticky-audio-trigger {
        border: 2px solid #000 !important;
    }
}
