/* =========================================================
   WP Audio Player Pro - Styles
   تمام قوانین مهم با پیشوند html و !important نوشته شده‌اند
   تا استایل‌های المنتور یا قالب آن‌ها را بازنویسی نکنند.
   مقادیر رنگ/اندازه/فونت در صفحه تنظیمات قابل تغییر هستند و
   به‌صورت CSS داینامیک (inline style) با اولویت بالاتر بارگذاری می‌شوند.
   ========================================================= */

html .wapp-player {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    background: #ffffff !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Arial, sans-serif !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    line-height: normal !important;
}

html .wapp-player * {
    box-sizing: border-box !important;
}
.wapp-player .wapp-seek-btn svg {
    fill: none;
    width: auto !important;
}
/* جهت‌دهی راست‌چین / چپ‌چین (به‌صورت خودکار از طریق ویژگی dir روی عنصر اعمال می‌شود) */
html .wapp-player.wapp-dir-rtl {
    direction: rtl !important;
}

html .wapp-player.wapp-dir-ltr {
    direction: ltr !important;
}

/* =========================================================
   ردیف بالا: عنوان + کنترل‌های عقب/جلو/سرعت/زمان
   ========================================================= */

html .wapp-top-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

html .wapp-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1c3d5a !important;
    margin: 0 !important;
    text-align: inherit !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

html .wapp-top-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    font-size: 12px !important;
    color: #4a5b6c !important;
    direction: ltr !important;
    flex: 0 0 auto !important;
    margin-inline-start: auto !important;
}

html .wapp-player.wapp-dir-rtl .wapp-top-controls {
    direction: rtl !important;
}

/* اگر عنوانی وجود نداشته باشد، کنترل‌ها کل عرض ردیف را بگیرند */
html .wapp-top-row:has(> .wapp-top-controls:only-child) {
    justify-content: space-between !important;
}

html .wapp-seek-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #4a5b6c !important;
    font-size: 9px !important;
    line-height: 1 !important;
    padding: 2px !important;
    margin: 0 !important;
}

html .wapp-seek-btn:hover {
    color: #1c3d5a !important;
}

html .wapp-seek-label {
    font-size: 9px !important;
    line-height: 1 !important;
}

/* دکمه و منوی سرعت */
html .wapp-speed-wrapper {
    position: relative !important;
}

html .wapp-speed-btn {
    border: 1px solid #c9d3dc !important;
    background: #fff !important;
    border-radius: 4px !important;
    padding: 2px 9px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    color: #1c3d5a !important;
    min-width: 40px !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

html .wapp-speed-btn:hover {
    border-color: #1c3d5a !important;
}

html .wapp-speed-menu {
    display: none;
    position: absolute !important;
    bottom: 110% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #fff !important;
    border: 1px solid #d7dee5 !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    z-index: 10 !important;
    min-width: 70px !important;
    overflow: hidden !important;
}

html .wapp-speed-menu.wapp-open {
    display: block !important;
}

html .wapp-speed-menu button {
    display: block !important;
    width: 100% !important;
    background: none !important;
    border: none !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    text-align: center !important;
    cursor: pointer !important;
    color: #333 !important;
    margin: 0 !important;
}

html .wapp-speed-menu button:hover,
html .wapp-speed-menu button.wapp-active {
    background: #1c3d5a !important;
    color: #fff !important;
}

/* زمان */
html .wapp-time {
    direction: ltr !important;
    font-size: 11px !important;
    color: #8a98a7 !important;
    white-space: nowrap !important;
}

/* =========================================================
   ردیف پایین: دکمه پخش + موج صوتی
   ========================================================= */

html .wapp-bottom-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* دکمه پخش اصلی */
html .wapp-play-btn {
    flex: 0 0 auto !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #1c3d5a !important;
    color: #fff !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
}

html .wapp-play-btn:hover {
    background: #285a87 !important;
}

html .wapp-play-btn svg {
    pointer-events: none !important;
}

/* موج صوتی */
html .wapp-waveform-wrapper {
    position: relative !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 28px !important;
    cursor: pointer !important;
    min-width: 0 !important;
}

html .wapp-waveform {
    display: block !important;
    width: 100% !important;
    height: 28px !important;
}

html .wapp-progress-overlay {
    position: absolute !important;
    top: 0 !important;
    height: 100% !important;
    width: 0%;
    background: rgba(28, 61, 90, 0.18) !important;
    pointer-events: none !important;
    border-radius: 4px !important;
}

/* در حالت LTR از سمت چپ پر می‌شود، در حالت RTL از سمت راست */
html .wapp-player.wapp-dir-ltr .wapp-progress-overlay {
    left: 0 !important;
    right: auto !important;
}

html .wapp-player.wapp-dir-rtl .wapp-progress-overlay {
    right: 0 !important;
    left: auto !important;
}

html .wapp-seek-slider {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    opacity: 0 !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

html .wapp-player.wapp-dir-rtl .wapp-seek-slider {
    direction: rtl !important;
}

/* پیام خطا */
html .wapp-error {
    color: #c0392b !important;
    background: #fdecea !important;
    padding: 10px 14px !important;
    border-radius: 6px !important;
    direction: rtl !important;
}

/* =========================================================
   مودال ادمین (افزودن شورت‌کد در ویرایشگر)
   ========================================================= */

.wapp-insert-btn {
    display: inline-flex !important;
    align-items: center;
}

.wapp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wapp-modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: 420px;
    max-width: 90%;
    direction: rtl;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.wapp-modal-box h2 {
    margin-top: 0;
    font-size: 18px;
}

.wapp-modal-box label {
    font-weight: 600;
    font-size: 13px;
}

.wapp-modal-box input[type="text"],
.wapp-modal-box select {
    margin-top: 6px;
    margin-bottom: 4px;
}

.wapp-modal-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* =========================================================
   صفحه تنظیمات در ادمین
   ========================================================= */

.wapp-settings-wrap .form-table th {
    width: 280px;
}

/* =========================================================
   ریسپانسیو پایه (مقادیر دقیق موبایل از تنظیمات داینامیک تزریق می‌شوند)
   ========================================================= */

@media (max-width: 480px) {
    html .wapp-top-row {
        gap: 8px !important;
    }

    html .wapp-title {
        flex-basis: 40% !important;
		scale: 0.8;
		margin-inline-start: -10px !important;
    }

    html .wapp-top-controls {
        gap: 10px !important;
		scale: 0.8;
        margin-inline-end: -10px;
    }

    html .wapp-bottom-row {
        gap: 8px !important;
    }
}
