/*
 * MrSeokar Auto Music Player Styles
 * بهینه‌سازی شده برای سایت‌های راست‌چین (فارسی)
 */

/* تنظیمات کلی نوار پخش‌کننده (بستر راست‌چین) */
.amp-sticky-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1e1e1e;
    color: #ffffff;
    z-index: 99999;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease-in-out;
    direction: rtl; /* کلیت نوار راست‌چین می‌ماند */
    font-family: Tahoma, Arial, sans-serif;
}

.amp-sticky-player.hidden {
    transform: translateY(100%);
}

.amp-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
    flex-direction: row-reverse;
}

/* استایل عمومی دکمه‌ها */
.amp-sticky-player button, 
.amp-sticky-player a {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    margin: 0;
    transition: color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.amp-sticky-player button:hover, 
.amp-sticky-player a:hover {
    color: #ff9800;
}

.amp-sticky-player button:active {
    transform: scale(0.9);
}

/* * ----------------------------------------------------
 * اصلاح چپ‌چین بودن (LTR) برای اجزای استاندار پخش‌کننده
 * ----------------------------------------------------
 */

/* بخش کنترل‌ها (قبلی، بعدی، پخش) - باید LTR باشد تا دکمه قبلی سمت چپ بیفتد */
.amp-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    direction: ltr; 
}

#sp-play-pause svg {
    width: 32px;
    height: 32px;
}

/* زمان آهنگ */
.amp-time {
    font-size: 13px;
    color: #bbbbbb;
    white-space: nowrap;
    direction: ltr;
    min-width: 85px;
    text-align: center;
}

/* نوار پیشرفت (Progress) - باید از چپ به راست پر شود */
.amp-progress-container {
    flex-grow: 1;
    cursor: pointer;
    padding: 10px 0;
    display: flex;
    align-items: center;
    direction: ltr;
}

.amp-progress-bar {
    background-color: rgba(255, 255, 255, 0.2);
    height: 6px;
    border-radius: 4px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.amp-progress-fill {
    background-color: #ff9800;
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
}

/* * ----------------------------------------------------
 * تنظیمات ولوم صدا و کنترل‌های اضافی
 * ----------------------------------------------------
 */
.amp-extra-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* بخش تنظیم صدا - باید LTR باشد تا 0 سمت چپ و 100 سمت راست قرار گیرد */
.amp-volume-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    direction: ltr; 
}

/* استایل واضح و اختصاصی برای اسلایدر صدا */
.amp-volume-slider {
    -webkit-appearance: none; /* حذف استایل پیش‌فرض */
    appearance: none;
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2); /* پس‌زمینه نوار */
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    accent-color: #ff9800; /* رنگ بخش پر شده در مرورگرهای جدید */
}

/* استایل دکمه لغزاننده (Thumb) روی نوار صدا */
.amp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff9800; /* رنگ نارنجی واضح برای دکمه کشویی */
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.8); /* سایه برای برجستگی بیشتر */
}

.amp-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff9800;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}


/* * ----------------------------------------------------
 * استایل‌های مربوط به تگ‌ها و لینک‌های داخل متن صفحه
 * ----------------------------------------------------
 */

.amp-active-track {
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.6);
    border-radius: 30px;
    transition: box-shadow 0.3s ease;
}

a.amp-active-link {
    position: relative;
    color: #ff9800 !important;
    font-weight: bold;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid #ff9800;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
    background-color: rgba(255, 152, 0, 0.05);
}

/* آیکون Pause با استفاده از Inline SVG روی لینک‌های فعال */
a.amp-active-link::before {
    content: "";
    display: inline-block;
    width: 16px; 
    height: 16px;
    margin-left: 8px; /* فاصله از سمت چپ، چون راست‌چین است */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23ff9800" d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>') no-repeat center;
    background-size: contain;
}

a.amp-active-link.is-playing {
    color: #ffffff !important;
    background-color: #4caf50;
    border-color: #4caf50;
}

/* آیکون صدا با رنگ سفید */
a.amp-active-link.is-playing::before {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23ffffff" d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/></svg>') no-repeat center;
}

/* * ----------------------------------------------------
 * واکنش‌گرایی (Responsive)
 * ----------------------------------------------------
 */
@media screen and (max-width: 768px) {
    .amp-container {
        flex-wrap: wrap;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .amp-progress-container {
        order: -1;
        width: 100%;
        flex: none;
        padding: 5px 0;
    }
    
    .amp-volume-slider {
        display: none;
    }
    
    .amp-extra-controls {
        gap: 10px;
    }
    
    .amp-time {
        font-size: 11px;
        min-width: 70px;
    }
}

@media screen and (max-width: 480px) {
    .amp-controls {
        gap: 5px;
    }
    
    #sp-play-pause svg {
        width: 28px;
        height: 28px;
    }
    
    .amp-extra-controls button svg, 
    .amp-extra-controls a svg {
        width: 20px;
        height: 20px;
    }
}