/* ===== دکمه‌های پخش و دانلود (مستطیلی) ===== */
.playlist-buttons a.download-btn-custom,
.playlist-buttons a.download-btn-custom:link,
.playlist-buttons a.download-btn-custom:visited {
    background: #691b22 !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px;
    transition: 0.2s;
    margin: 0 !important;
    line-height: 1;
}
.playlist-buttons a.download-btn-custom:hover {
    background: #8f3039 !important;
}
.playlist-buttons button.play-btn-custom {
    background: #7b232b;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: 0.2s;
}
.playlist-buttons button.play-btn-custom:hover {
    background: #a2454e;
}
.playlist-buttons svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.playlist-buttons span {
    line-height: 1;
}

/* ===== کادر کلی پلی‌لیست ===== */
.custom-playlist-wrapper {
    direction: rtl;
    margin: 25px 0;
    font-family: inherit;
    border: 1px solid #e6d4d7;
    border-radius: 12px;
    background-color: #fbf6f7;
    box-shadow: 0 2px 10px rgba(105,27,34,0.08);
    overflow: hidden;
}

.playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #eadadd;
    background-color: transparent;
    transition: all 0.2s ease;
}
.playlist-item:last-child {
    border-bottom: none;
}
.playlist-item:hover {
    background-color: #f5eeef;
}

.playlist-title {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: #2b2022;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 15px;
    text-align: right;
}
.playlist-number {
    margin-left: 5px;
    font-weight: bold;
    color: #8f3039;
}

/* آیتم در حال پخش */
.playlist-item.playing {
    background-color: #f1e2e5;
    border-left: 4px solid #691b22;
}
.playlist-item.playing .playlist-title {
    color: #3a171b;
    font-weight: 700;
}
.playlist-item.playing .playlist-number {
    color: #691b22;
}

/* ===== دکمه پخش بزرگ ===== */
.playlist-master-control {
    text-align: center;
    padding: 20px 0 15px 0;
    background-color: #fbf6f7;
    border-bottom: 1px solid #eadadd;
}
.master-play-btn {
    background: #691b22;
    border: none;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    color: white;
    box-shadow: 0 4px 12px rgba(105,27,34,0.2);
}
.master-play-btn:hover {
    background: #8f3039;
    transform: scale(1.02);
}
.master-play-text {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #3a171b;
}

/* ===== بازنویسی کامل بخش موبایل برای جلوگیری از ریختگی ===== */
@media (max-width: 768px) {
    /* آیتم پلی‌لیست به صورت ستونی و با فاصله مناسب */
    .playlist-item {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 8px;
    }
    .playlist-title {
        white-space: normal;
        text-align: center;
        margin-left: 0;
        width: 100%;
        font-size: 14px;
        line-height: 1.4;
    }
    .playlist-number {
        font-size: 14px;
    }
    /* دکمه‌ها در یک ردیف و وسط چین */
    .playlist-buttons {
        display: flex;
        justify-content: center;
        gap: 12px;
        width: 100%;
    }
    .playlist-buttons button.play-btn-custom,
    .playlist-buttons a.download-btn-custom {
        padding: 6px 12px !important;
        font-size: 12px;
    }
    /* دکمه اصلی پخش بزرگ */
    .master-play-btn {
        width: 60px;
        height: 60px;
    }
    .master-play-text {
        font-size: 12px;
    }
    
    /* پلیر شناور در موبایل - اصلاح چیدمان عمودی و دایره‌ای بودن دکمه اصلی */
    .custom-bottom-player {
        padding: 10px 0;
    }
    .player-container {
        flex-direction: column;
        gap: 8px;
        padding: 0 10px;
    }
    .player-controls {
        order: 3;
        justify-content: center;
        width: 100%;
        gap: 12px;
    }
    .player-progress-area {
        order: 2;
        width: 100%;
        gap: 10px;
    }
    .player-info {
        order: 1;
        width: 100%;
        text-align: center !important;
        white-space: normal;
        word-break: break-word;
        font-size: 13px;
    }
    /* دکمه اصلی پلیر (پلی/پوز) - دایره کامل */
    .main-play-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 50% !important;
        background: #691b22;
    }
    .main-play-btn .icon {
        width: 24px !important;
        height: 24px !important;
    }
    .ctrl-btn {
        width: 36px;
        height: 36px;
    }
    .ctrl-btn .icon {
        width: 20px;
        height: 20px;
    }
    .progress-bar-container {
        height: 6px;
    }
    #player-time-current, #player-time-total {
        font-size: 11px;
        width: 35px;
    }
}

/* ===== پلیر شناور (دسکتاپ) ===== */
.custom-bottom-player {
    position: fixed;
    bottom: -150px;
    left: 0;
    right: 0;
    background: #fffafa;
    color: #2b2022;
    z-index: 999999;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 22px rgba(105,27,34,0.18);
    padding: 18px 0;
    direction: rtl;
    font-family: inherit;
}
.custom-bottom-player.show {
    bottom: 0;
}
.player-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    flex-wrap: nowrap;
    gap: 20px;
}
.player-info {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: bold;
    color: #2b2022;
    text-align: left;
}
.player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    direction: ltr;
}
.ctrl-btn {
    background: none;
    border: none;
    color: #595959;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
    padding: 0;
}
.ctrl-btn:hover { color: #691b22; }
.ctrl-btn .icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}
.main-play-btn {
    background: #691b22;
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}
.main-play-btn .icon {
    width: 26px;
    height: 26px;
}
.main-play-btn:hover { background: #8f3039; color: #fff; }
.player-progress-area {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 15px;
    direction: ltr;
}
.progress-bar-container {
    flex: 1;
    height: 8px;
    background: #eadadd;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: #691b22;
    width: 0%;
    pointer-events: none;
    border-radius: 6px;
}
#player-time-current, #player-time-total {
    font-size: 13px;
    color: #6b4d51;
    width: 42px;
    text-align: center;
    font-weight: 500;
}
