/* =====================================================
   MH Audio Player  –  public/css/player.css
   ===================================================== */

.mh-audio-player {
    --mh-red:    #e8192c;
    --mh-red-dk: #c0121f;
    --mh-white:  #ffffff;
    --mh-radius: 14px;
    direction: ltr;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--mh-red);
    border-radius: var(--mh-radius);
    padding: 10px 14px 10px 10px;
    font-family: 'Vazirmatn', 'Vazir', Tahoma, Arial, sans-serif;
    box-shadow: 0 4px 18px rgba(232,25,44,.35);
    margin: 14px 0;
    box-sizing: border-box;
    width: 100%;
    overflow: visible;
}

/* ---- عنوان ---- */
.mh-player-title {
    position: absolute;
    top: 6px;
    right: 74px;          /* فضا برای دکمه بزرگ */
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 160px);
    pointer-events: none;
}

/* ---- دکمه بزرگ سمت راست ---- */
.mh-btn-big-play {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--mh-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    transition: transform .15s, box-shadow .15s;
    order: 99;    /* همیشه آخر (سمت چپ در rtl) */
}
.mh-btn-big-play:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.mh-btn-big-play svg   { width: 22px; height: 22px; fill: var(--mh-red); }

/* ---- نوار کنترل‌ها ---- */
.mh-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding-top: 18px;   /* فضا برای عنوان */
}

/* ---- دکمه‌های کوچک ---- */
.mh-btn-skip,
.mh-btn-play,
.mh-btn-speed {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mh-white);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background .15s;
}
.mh-btn-skip:hover,
.mh-btn-play:hover,
.mh-btn-speed:hover { background: rgba(255,255,255,.18); }

.mh-btn-skip svg,
.mh-btn-speed svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.mh-btn-play svg  { width: 18px; height: 18px; fill: currentColor; }

/* ---- progress bar ---- */
.mh-progress-wrap {
    flex: 1;
    min-width: 0;
    padding: 8px 0;
    cursor: pointer;
}
.mh-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255,255,255,.35);
    border-radius: 99px;
    overflow: visible;
}
.mh-progress-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: var(--mh-white);
    border-radius: 99px;
    pointer-events: none;
    transition: width .1s linear;
}
.mh-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 13px;
    height: 13px;
    background: var(--mh-white);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
    pointer-events: none;
    transition: left .1s linear;
}

/* ---- زمان ---- */
.mh-time {
    flex-shrink: 0;
    font-size: 11px;
    color: rgba(255,255,255,.9);
    white-space: nowrap;
    letter-spacing: .3px;
    font-variant-numeric: tabular-nums;
}

/* ---- منوی سرعت ---- */
.mh-speed-wrap {
    position: relative;
    flex-shrink: 0;
}
.mh-speed-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 10px;
    padding: 6px 4px;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    z-index: 9999;
    min-width: 72px;
    text-align: center;
}
.mh-speed-menu button {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #333;
    border-radius: 6px;
    font-family: inherit;
    transition: background .12s;
}
.mh-speed-menu button:hover   { background: #f5f5f5; }
.mh-speed-menu button.active  { color: var(--mh-red); font-weight: 700; }

/* =====================================================
   موبایل
   ===================================================== */
@media (max-width: 480px) {
    .mh-audio-player {
        padding: 8px 10px 8px 8px;
        border-radius: 11px;
        gap: 6px;
    }
    .mh-btn-big-play { width: 42px; height: 42px; }
    .mh-btn-big-play svg { width: 18px; height: 18px; }
    .mh-btn-skip svg,
    .mh-btn-speed svg { width: 19px; height: 19px; }
    .mh-player-title {
        font-size: 11px;
        right: 62px;
        max-width: calc(100% - 130px);
    }
    .mh-time { font-size: 10px; }
    .mh-controls { gap: 4px; }
}
