/* --- СТИЛИ ПЛЕЕРА --- */
.dle-audio-wrapper { width: 100%; max-width: 100%; margin: 0; font-family: 'Inter', sans-serif; color: #333; box-sizing: border-box; }
.dle-audio-wrapper * { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

.dap-icon { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.125em; display: inline-block; }
.dap-btn .dap-icon { width: 1.2em; height: 1.2em; }
.dap-btn-main .dap-icon { width: 1.5em; height: 1.5em; margin-left: 0.15em; }

/* ЗАЩИТА ОТ ПРЫЖКОВ (CLS): Заранее резервируем высоту плеера, чтобы не сдвигать рекламу */
.dap-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid #eee; overflow: hidden; display: flex; flex-direction: column; position: relative; min-height: 400px; }

/* Лоадер */
.dap-overlay-loader { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.95); z-index: 20; display: none; flex-direction: column; justify-content: center; align-items: center; color: #e54c3c; font-size: 14px; font-weight: 500; }
.dap-overlay-loader.active { display: flex; }
.dap-spinner { width: 40px; height: 40px; margin-bottom: 10px; animation: dap-spin 1s linear infinite; fill: #e54c3c; }
@keyframes dap-spin { 100% { transform: rotate(360deg); } }

/* Офлайн бар */
.dap-offline-bar { background: #e74c3c; color: #fff; font-size: 12px; padding: 8px 20px; display: none; justify-content: space-between; align-items: center; }
.dap-offline-bar.show { display: flex; }
.dap-offline-bar svg { width: 14px; height: 14px; fill: #fff; margin-right: 6px; vertical-align: -2px; }

/* Шапка */
.dap-header { background: linear-gradient(135deg, #e54c3c 0%, #c0392b 100%); padding: 20px; color: #fff; display: flex; align-items: center; gap: 15px; }
.dap-cover-icon { font-size: 24px; background: rgba(255,255,255,0.25); width: 55px; height: 55px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: #fff; }
.dap-cover-icon img { width: 100%; height: 100%; object-fit: cover; }
.dap-cover-icon svg { width: 28px; height: 28px; fill: #fff; opacity: 0.8; }
.dap-meta { flex: 1; overflow: hidden; }
.dap-title { font-size: 16px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dap-subtitle { font-size: 13px; opacity: 0.9; margin-top: 4px; font-weight: 400; }
.dap-subtitle a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.3); }

/* Контролы */
.dap-controls { padding: 20px 20px 10px; background: #fff; }
.dap-progress-area { margin-bottom: 15px; cursor: pointer; padding: 15px 0; touch-action: none; position: relative; }
.dap-time-row { display: flex; justify-content: space-between; font-size: 11px; color: #999; font-weight: 600; position: absolute; top: -5px; left: 0; right: 0; pointer-events: none; }
.dap-bar-bg { height: 8px; background: #eef2f5; border-radius: 10px; position: relative; overflow: hidden; }
.dap-bar-fill { height: 100%; width: 0%; background: #e54c3c; border-radius: 10px; position: relative; transition: width 0.05s linear; }

.dap-buttons { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 10px; }
.dap-btn { background: none; border: none; cursor: pointer; color: #b2bec3; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.2s; padding: 0; }
.dap-btn:hover { background: #fff0f0; color: #e54c3c; }
.dap-btn:active { transform: scale(0.95); }
.dap-btn-main { width: 60px; height: 60px; background: #e54c3c; color: #fff; box-shadow: 0 4px 12px rgba(229, 76, 60, 0.4); }
.dap-btn-main:hover { background: #c0392b; color: #fff; transform: scale(1.05); }
.dap-btn.dap-disabled { opacity: 0.5; cursor: not-allowed; }

/* Действия */
.dap-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid #f5f5f5; background: #fafafa; }
.dap-action-item { padding: 12px; text-align: center; cursor: pointer; font-size: 11px; color: #777; border-right: 1px solid #f5f5f5; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: 0.2s;}
.dap-action-item:last-child { border-right: none; }
.dap-action-item:hover { background: #fff; color: #e54c3c; }
.dap-action-item .dap-icon { font-size: 16px; margin-bottom: 2px; }
.dap-action-item.dap-delete-btn { color: #e74c3c; }
.dap-action-item.dap-delete-btn:hover { background: #fff0f0; color: #c0392b; }
.dap-action-item.dap-disabled { opacity: 0.5; pointer-events: none; }

/* Плейлист */
.dap-playlist { max-height: 200px; overflow-y: auto; background: #fff; border-top: 1px solid #eee; scrollbar-width: thin; scrollbar-color: #ddd #fff; }
.dap-track { padding: 12px 20px; border-bottom: 1px solid #f9f9f9; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.2s; }
.dap-track:hover { background: #fff5f5; }
.dap-track.active { background: #fff0f0; border-left: 3px solid #e54c3c; }
.dap-track.active .dap-t-icon { color: #e54c3c; }
.dap-track.played { background: #fdfdfd; }
.dap-track.played .dap-t-icon { color: #2ecc71; }
.dap-track.played .dap-t-title { color: #999; }
.dap-t-icon { color: #ccc; width: 20px; text-align: center; display: flex; align-items: center; justify-content: center; }
.dap-t-icon svg { width: 12px; height: 12px; }
.dap-t-info { flex: 1; min-width: 0; }
.dap-t-title { font-size: 13px; font-weight: 500; color: #333; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dap-t-meta { font-size: 11px; color: #aaa; }

/* Статусы в плейлисте */
.dap-dl-status svg { width: 14px; height: 14px; }
.dap-spin-small { animation: dap-spin 1s linear infinite; fill: #e54c3c; }

/* Статистика */
.dap-footer-stats { background: #fdfdfd; border-top: 1px solid #eee; padding: 15px 20px; font-size: 12px; color: #555; display: flex; flex-direction: column; gap: 8px; }
.dap-stat-row { display: flex; justify-content: space-between; align-items: center; }
.dap-stat-val { font-weight: 700; color: #333; }
.dap-stat-highlight { color: #e54c3c; font-weight: 700; }
.dap-stat-saved { font-size: 11px; color: #27ae60; background: #eafaf1; padding: 4px 10px; border-radius: 10px; align-self: flex-start; display: none; margin-top: 2px; }
.dap-stat-saved.visible { display: inline-block; }
.dap-stat-saved svg { width: 10px; height: 10px; fill: #27ae60; margin-right: 4px; }

/* Toast */
.dap-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(50px); background: rgba(0,0,0,0.85); color: #fff; padding: 10px 20px; border-radius: 30px; font-size: 13px; opacity: 0; pointer-events: none; transition: 0.3s; z-index: 9999; }
.dap-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }