/* ═══════════════════════════════════════════════════════════
   music-player/player.css — پخش‌کنندهٔ موزیک شناور کارت
   فیچر music-player — فقط وقتی فیچر فعال باشد از base_layout لود می‌شود.
   رنگ تأکیدی از پالت کارت (--accent) پیروی می‌کند؛ سازگار با RTL و تم تاریک.
   ═══════════════════════════════════════════════════════════ */

.mplayer {
    position: fixed;
    bottom: 90px; /* بالای نوار پایین کارت */
    left: 14px;
    z-index: 95;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
}

/* ─── دکمهٔ شناور ─── */
.mplayer-fab {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--accent, #ec4899);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
}
.mplayer-fab:active {
    transform: scale(.94);
}

/* امواج کوچک روی دکمه هنگام پخش */
/* اکولایزر «در حال پخش» — در مرکز دایره، جایگزین آیکون نُت
   (الگوی مرسوم پخش‌کننده‌های صوتی: نوارهای متحرک به‌جای آیکون ثابت) */
.mplayer-fab-wave {
    position: absolute;
    inset: 0;
    margin: auto;
    display: none;
    gap: 3px;
    align-items: flex-end;
    justify-content: center;
    height: 14px;
    pointer-events: none;
}
.mplayer-fab-wave span {
    width: 3px;
    background: #fff;
    border-radius: 2px;
    height: 5px;
}
.mplayer.playing .mplayer-fab-wave {
    display: flex;
}
.mplayer.playing .mplayer-fab-wave span { animation: mplayerWave 1s ease-in-out infinite; }
.mplayer.playing .mplayer-fab-wave span:nth-child(2) { animation-delay: .18s; }
.mplayer.playing .mplayer-fab-wave span:nth-child(3) { animation-delay: .36s; }
/* در حالت پخش، نُت مخفی می‌شود تا اکولایزر تنها نشانگر باشد */
.mplayer.playing .mplayer-fab > i { opacity: 0; }

@keyframes mplayerWave {
    0%, 100% { height: 5px; }
    50%      { height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .mplayer.playing .mplayer-fab-wave span { animation: none; height: 8px; }
}

/* ─── پنل پخش ─── */
.mplayer-panel {
    position: absolute;
    bottom: 54px;
    left: 0;
    width: 240px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    animation: mplayerIn .18s ease;
}
@keyframes mplayerIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .mplayer-panel { animation: none; }
}

[data-theme="dark"] .mplayer-panel {
    background: #1e293b;
    border-color: rgba(148, 163, 184, .25);
}

.mplayer-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.mplayer-title {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-theme="dark"] .mplayer-title { color: #f1f5f9; }

.mplayer-close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
}
.mplayer-close:hover { color: #64748b; }

.mplayer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mplayer-play {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--accent, #ec4899);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mplayer-play:active { transform: scale(.93); }

.mplayer-progress {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: rgba(148, 163, 184, .35);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.mplayer-progress-fill {
    position: absolute;
    top: 0;
    left: 0; /* در RTL هم پیشرفت چپ‌به‌راست است */
    height: 100%;
    width: 0%;
    background: var(--accent, #ec4899);
    border-radius: 4px;
}

.mplayer-time {
    flex: 0 0 auto;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    color: #64748b;
    direction: ltr;
    min-width: 34px;
    text-align: left;
}
[data-theme="dark"] .mplayer-time { color: #cbd5e1; }
