/**
 * Dynamic Audio Player - Unified Styles
 * نمط المشغل الصوتي الموحد
 * 
 * Full RTL/LTR Support using CSS Logical Properties
 * دعم كامل للعربية والإنجليزية
 */

/* ===================================
   CSS Variables & Base Styles
=================================== */
:root {
    --dap-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dap-primary-color: #667eea;
    --dap-secondary-color: #764ba2;
    --dap-text-dark: #1a1a1a;
    --dap-text-medium: #666;
    --dap-text-light: #999;
    --dap-bg-light: #f8f9fa;
    --dap-bg-white: #ffffff;
    --dap-border-color: #e0e0e0;
    --dap-shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
    --dap-shadow-md: 0 5px 15px rgba(0, 0, 0, 0.15);
    --dap-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --dap-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --dap-slide-offset: -8px;
    --dap-internal-play-color: inherit;
    --dap-internal-play-bg-color: transparent;
    --dap-internal-volume-color: inherit;
    --dap-internal-menu-color: #1A1A1A;
    --dap-internal-time-color: inherit;
    --dap-thumbnail-animation-duration: 0.3s;
    --dap-thumbnail-animation-scale: 1.05;
}

/* RTL Support: Reverse slide direction */
[dir="rtl"] :root {
    --dap-slide-offset: 8px;
}

/* ===================================
   Audio Playlist Wrapper
=================================== */
.dap-playlist-wrapper,
.dap-player-wrapper {
    max-width: 1200px;
    margin: 40px auto 100px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.dap-player-wrapper {
    background: var(--dap-bg-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--dap-shadow-lg);
    margin-block-end: 40px;
}

.dap-no-content,
.dap-empty-playlist {
    text-align: center;
    padding: 60px 20px;
    color: var(--dap-text-light);
    font-size: 16px;
}

.dap-empty-playlist p {
    margin: 0;
}

/* ===================================
   Playlist Section
=================================== */
.dap-playlist-section {
    padding: 40px;
    max-height: 700px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #fafafa 0%, #ffffff 100%);
}

.dap-section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dap-text-dark);
    margin: 0 0 30px;
    padding-block-end: 20px;
    border-block-end: 3px solid var(--dap-border-color);
    position: relative;
}

.dap-section-title::after {
    content: '';
    position: absolute;
    inset-block-end: -3px;
    inset-inline-end: 0;
    width: 100px;
    height: 3px;
    background: var(--dap-primary-gradient);
}

/* ===================================
   Audio Items
=================================== */
.dap-audio-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    margin-block-end: 15px;
    background: var(--dap-bg-white);
    border-radius: 15px;
    cursor: default;
    transition: all 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

/* Row 1: Image, Title, Description */
.dap-row-1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    width: 100%;
    cursor: pointer;
}

/* Row 2: Internal Player - Redesigned to match dap-player-left */
.dap-internal-player {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    /* Background and Color set via Inline CSS from PHP settings */
    transition: background 0.3s ease;
    position: relative;
}

[dir="rtl"] .dap-internal-player {
    flex-direction: row-reverse;
}

/* Internal Player Play Button - Match dap-play-pause-bottom */
.dap-internal-play-btn {
    background: var(--dap-internal-play-bg-color) !important;
    border: none !important;
    color: var(--dap-internal-play-color) !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: none;
}

.dap-internal-play-btn:hover {
    transform: scale(1.1);
}

/* Internal Time Info - Match dap-time-info-bottom */
.dap-internal-time-info {
    font-family: monospace;
    font-size: 12px;
    color: var(--dap-internal-time-color);
    opacity: 0.8;
    white-space: nowrap;
    min-width: 80px;
}

/* Internal Progress Container - Match dap-progress-container-bottom */
.dap-internal-progress-container {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0 15px;
}

[dir="rtl"] .dap-internal-progress-container {
    direction: ltr;
}

.dap-internal-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.dap-internal-progress-bar:hover {
    height: 8px;
}

.dap-internal-progress-fill {
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
    background: currentColor;
}

/* Internal Controls Right - Match dap-controls-right */
.dap-internal-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

[dir="rtl"] .dap-internal-controls-right {
    flex-direction: row-reverse;
}

/* Internal Volume Control - Match dap-volume-control-bottom with hover effect */
.dap-internal-volume-control {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.dap-internal-volume-control .fa-volume-high {
    font-size: 20px;
    color: var(--dap-internal-volume-color);
}

.dap-internal-volume-slider-wrapper {
    position: absolute;
    inset-block-end: 30px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 130px;
    background: var(--dap-bg-white);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    padding: 10px 0;
    z-index: 10000;
    direction: ltr;
}

/* Hover on Icon OR Wrapper keeps it visible - Match dap-player-left behavior */
.dap-internal-volume-control:hover .dap-internal-volume-slider-wrapper,
.dap-internal-volume-slider-wrapper:hover {
    opacity: 1;
    visibility: visible;
    inset-block-end: 35px;
}

/* Rotated Range Input - Enhanced Specificity - Match dap-player-left */
.dap-internal-volume-control .dap-internal-volume-slider,
input.dap-internal-volume-slider[type="range"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 110px !important;
    height: 10px !important;
    background: linear-gradient(to right, #073b4c 0%, #00bcd4 100%) !important;
    border: none !important;
    border-radius: 5px !important;
    transform: rotate(-90deg) !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Webkit Thumb - Match dap-player-left */
.dap-internal-volume-control .dap-internal-volume-slider::-webkit-slider-thumb,
input.dap-internal-volume-slider[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    background: var(--dap-bg-white) !important;
    border: 3px solid #00bcd4 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.2s ease !important;
}

.dap-internal-volume-control .dap-internal-volume-slider::-webkit-slider-thumb:hover,
input.dap-internal-volume-slider[type="range"]::-webkit-slider-thumb:hover {
    background: #00bcd4 !important;
    transform: scale(1.1) !important;
}

/* Firefox Thumb - Match dap-player-left */
.dap-internal-volume-control .dap-internal-volume-slider::-moz-range-thumb,
input.dap-internal-volume-slider[type="range"]::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    background: var(--dap-bg-white) !important;
    border: 3px solid #00bcd4 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.2s ease !important;
}

.dap-internal-volume-control .dap-internal-volume-slider::-moz-range-thumb:hover,
input.dap-internal-volume-slider[type="range"]::-moz-range-thumb:hover {
    background: #00bcd4 !important;
    transform: scale(1.1) !important;
}

/* Firefox Track - Match dap-player-left */
.dap-internal-volume-control .dap-internal-volume-slider::-moz-range-track,
input.dap-internal-volume-slider[type="range"]::-moz-range-track {
    background: linear-gradient(to right, #073b4c 0%, #00bcd4 100%) !important;
    border: none !important;
    border-radius: 5px !important;
    height: 10px !important;
}

/* Internal Menu Button - Match dap-menu-btn-bottom */
.dap-internal-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    box-shadow: none;
}

.dap-internal-menu-btn:hover,
.dap-internal-menu-btn:focus {
    opacity: 1;
    background-color: transparent;
}

.dap-internal-menu-btn .fa-ellipsis-vertical {
    color: var(--dap-internal-menu-color);
    font-size: 20px;
}

.dap-internal-menu-btn:hover .dap-internal-menu-btn .fa-ellipsis-vertical{
    color: var(--dap-internal-menu-color);
}

/* Internal Options Menu Container - Match dap-options-menu-container */
.dap-internal-options-menu-container {
    position: relative;
}

/* Internal Options Popover - Match dap-options-popover */
.dap-internal-options-popover {
    position: absolute;
    inset-block-end: 100%;
    inset-inline-start: 0;
    background: var(--dap-bg-white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    margin-block-end: 10px;
    z-index: 10000;
    overflow: hidden;
    animation: dapFadeIn 0.2s ease;
}

.dap-internal-options-popover a,
.dap-internal-options-popover button {
    display: block;
    width: 100%;
    padding: 12px 15px;
    text-align: start;
    background: none;
    border: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    border-block-end: 1px solid #eee;
    text-decoration: none;
    transition: background 0.2s;
}

.dap-internal-options-popover a:hover,
.dap-internal-options-popover button:hover {
    background: var(--dap-bg-light);
}

.dap-internal-options-popover a:last-child,
.dap-internal-options-popover button:last-child {
    border-block-end: none;
}

.dap-internal-options-popover .dashicons {
    margin-inline-end: 8px;
    font-size: 18px;
    vertical-align: middle;
}

.dap-audio-item::before {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    width: 5px;
    height: 100%;
    background: var(--dap-primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.dap-audio-item:hover {
    background: #f8f9ff;
    transform: translate(var(--dap-slide-offset), 0);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.15);
}

.dap-audio-item:hover::before {
    opacity: 1;
}

.dap-audio-item.dap-active {
    background: #e8edff;
    border-color: var(--dap-primary-color);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.dap-audio-item.dap-playing {
    background: var(--dap-primary-gradient);
    color: var(--dap-bg-white);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.dap-audio-item.dap-playing .dap-audio-title,
.dap-audio-item.dap-playing .dap-audio-description,
.dap-audio-item.dap-playing .dap-audio-duration {
    color: var(--dap-bg-white);
}

/* Thumbnail with transition */
.dap-audio-thumbnail {
    transition: transform var(--dap-thumbnail-animation-duration) ease, box-shadow var(--dap-thumbnail-animation-duration) ease;
}

/* Thumbnail Animation Effects */
.dap-audio-item:hover .dap-audio-thumbnail {
    transform: scale(var(--dap-thumbnail-animation-scale));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Rotate Animation */
.dap-audio-item[data-thumbnail-animation="rotate"]:hover .dap-audio-thumbnail {
    transform: scale(var(--dap-thumbnail-animation-scale)) rotate(5deg);
}

/* Scale + Rotate Animation */
.dap-audio-item[data-thumbnail-animation="scale-rotate"]:hover .dap-audio-thumbnail {
    transform: scale(var(--dap-thumbnail-animation-scale)) rotate(3deg);
}

/* Shadow Effect Animation */
.dap-audio-item[data-thumbnail-animation="shadow"]:hover .dap-audio-thumbnail {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* No Animation */
.dap-audio-item[data-thumbnail-animation="none"]:hover .dap-audio-thumbnail {
    transform: none;
    box-shadow: var(--dap-shadow-md);
}

/* Thumbnail */
.dap-audio-thumbnail {
    width: 90px;
    height: 90px;
    min-width: 90px;
    border-radius: 8px !important;
    object-fit: cover;
    box-shadow: var(--dap-shadow-md);
    transition: var(--dap-transition);
}

.dap-audio-item:hover .dap-audio-thumbnail {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

/* Thumbnail */
.dap-audio-thumbnail {
    width: 90px;
    height: 90px;
    min-width: 90px;
    border-radius: 8px !important;
    object-fit: cover;
    box-shadow: var(--dap-shadow-md);
    transition: var(--dap-transition);
}

.dap-audio-item:hover .dap-audio-thumbnail {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

/* Content */
.dap-audio-content {
    flex: 1;
    min-width: 0;
}

.dap-audio-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--dap-text-dark);
    margin-block-end: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dap-audio-description {
    font-size: 14px;
    color: var(--dap-text-medium);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dap-audio-duration {
    font-size: 15px;
    color: var(--dap-text-light);
    font-weight: 600;
    min-width: 60px;
    text-align: start;
    font-family: 'Courier New', monospace;
}

.dap-audio-item.dap-playing .dap-audio-duration {
    color: rgba(255, 255, 255, 0.9);
}

/* ===================================
   Fixed Bottom Player
=================================== */
.dap-fixed-player-bottom {
    position: fixed;
    inset-block-end: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: #073b4c;
    border-block-start: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    color: var(--dap-bg-white);
    animation: slideUp 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dap-player-content-bottom {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 20px;
}

[dir="rtl"] .dap-player-content-bottom {
    flex-direction: row-reverse;
}


/* Left Section: Controls + Progress */
.dap-player-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    max-width: 70%;
}

[dir="rtl"] .dap-player-left {
    flex-direction: row-reverse;
}

.dap-play-pause-bottom {
    background: none !important;
    border: none !important;
    color: var(--dap-bg-white) !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.dap-play-pause-bottom:hover {
    transform: scale(1.1);
}

.dap-play-pause-bottom .dashicons {
    font-size: 28px !important;
    width: 28px !important;
    height: 28px !important;
}

.dap-time-info-bottom {
    font-family: monospace;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    min-width: 80px;
}

.dap-progress-container-bottom {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0 15px;
}

[dir="rtl"] .dap-progress-container-bottom {
    direction: ltr;
}

.dap-progress-bar-bottom {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.dap-progress-bar-bottom:hover {
    height: 8px;
}

.dap-progress-fill-bottom {
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
}

/* Volume Control - Vertical Upwards */
.dap-volume-control-bottom {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.dap-volume-control-bottom .fa-volume-high {
    font-size: 20px;
    color: inherit;
}

.dap-volume-slider-wrapper {
    position: absolute;
    inset-block-end: 30px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 130px;
    background: var(--dap-bg-white);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    padding: 10px 0;
    z-index: 10000;
    direction: ltr;
}

/* Hover on Icon OR Wrapper keeps it visible */
.dap-volume-control-bottom:hover .dap-volume-slider-wrapper,
.dap-volume-slider-wrapper:hover {
    opacity: 1;
    visibility: visible;
    inset-block-end: 35px;
}

/* Rotated Range Input - Enhanced Specificity */
.dap-volume-control-bottom .dap-volume-slider-bottom,
input.dap-volume-slider-bottom[type="range"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 110px !important;
    height: 10px !important;
    background: linear-gradient(to right, #073b4c 0%, #00bcd4 100%) !important;
    border: none !important;
    border-radius: 5px !important;
    transform: rotate(-90deg) !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Webkit Thumb (Chrome, Safari, Edge) */
.dap-volume-control-bottom .dap-volume-slider-bottom::-webkit-slider-thumb,
input.dap-volume-slider-bottom[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    background: var(--dap-bg-white) !important;
    border: 3px solid #00bcd4 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.2s ease !important;
}

.dap-volume-control-bottom .dap-volume-slider-bottom::-webkit-slider-thumb:hover,
input.dap-volume-slider-bottom[type="range"]::-webkit-slider-thumb:hover {
    background: #00bcd4 !important;
    transform: scale(1.1) !important;
}

/* Firefox Thumb */
.dap-volume-control-bottom .dap-volume-slider-bottom::-moz-range-thumb,
input.dap-volume-slider-bottom[type="range"]::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    background: var(--dap-bg-white) !important;
    border: 3px solid #00bcd4 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.2s ease !important;
}

.dap-volume-control-bottom .dap-volume-slider-bottom::-moz-range-thumb:hover,
input.dap-volume-slider-bottom[type="range"]::-moz-range-thumb:hover {
    background: #00bcd4 !important;
    transform: scale(1.1) !important;
}

/* Firefox Track */
.dap-volume-control-bottom .dap-volume-slider-bottom::-moz-range-track,
input.dap-volume-slider-bottom[type="range"]::-moz-range-track {
    background: linear-gradient(to right, #073b4c 0%, #00bcd4 100%) !important;
    border: none !important;
    border-radius: 5px !important;
    height: 10px !important;
}

/* Controls Right Group */
.dap-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

[dir="rtl"] .dap-controls-right {
    flex-direction: row-reverse;
}

/* Menu Button */
.dap-menu-btn-bottom {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.dap-menu-btn-bottom:hover,
.dap-menu-btn-bottom:focus {
    opacity: 1;
    background-color: transparent;
}

.dap-menu-btn-bottom .fa-ellipsis-vertical {
    font-size: 20px;
}

/* Options Popover */
.dap-options-menu-container {
    position: relative;
}

.dap-options-popover {
    position: absolute;
    inset-block-end: 100%;
    inset-inline-start: 0;
    background: var(--dap-bg-white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    margin-block-end: 10px;
    z-index: 10000;
    overflow: hidden;
    animation: dapFadeIn 0.2s ease;
}

.dap-options-popover a,
.dap-options-popover button {
    display: block;
    width: 100%;
    padding: 12px 15px;
    text-align: start;
    background: none;
    border: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    border-block-end: 1px solid #eee;
    text-decoration: none;
    transition: background 0.2s;
}

.dap-options-popover a:hover,
.dap-options-popover button:hover {
    background: var(--dap-bg-light);
}

.dap-options-popover a:last-child,
.dap-options-popover button:last-child {
    border-block-end: none;
}

.dap-options-popover .dashicons {
    margin-inline-end: 8px;
    font-size: 18px;
    vertical-align: middle;
}

@keyframes dapFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Right Side - Info */
.dap-player-right {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 250px;
    justify-content: flex-end;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 15px;
    margin-left: 15px;
    flex-direction: row;
}

/* RTL: Reverse content order (thumbnail and text swap) */
/* [dir="rtl"] .dap-player-right {
    flex-direction: row-reverse;
} */

.dap-current-info-bottom {
    text-align: start;
    overflow: hidden;
}

.dap-current-title-bottom {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-block-end: 2px;
}

.dap-current-description-bottom {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dap-current-thumbnail-bottom {
    width: 45px;
    height: 45px;
    border-radius: 8px !important;
    object-fit: cover;
    box-shadow: var(--dap-shadow-sm);
}

/* ===================================
   Sticky Player (Alternative Style)
=================================== */
.dap-fixed-player {
    position: sticky;
    inset-block-end: 0;
    background: var(--dap-primary-gradient);
    padding: 30px 40px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.dap-no-audio-message {
    text-align: center;
    color: var(--dap-bg-white);
    padding: 20px;
}

.dap-no-audio-message .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    opacity: 0.6;
    margin-block-end: 10px;
}

.dap-no-audio-message p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Player Info */
.dap-player-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-block-end: 25px;
}

.dap-current-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.dap-current-info {
    flex: 1;
    color: var(--dap-bg-white);
}

.dap-current-title {
    font-size: 20px;
    font-weight: 700;
    margin-block-end: 5px;
    line-height: 1.3;
}

.dap-current-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

/* Player Controls */
.dap-player-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dap-progress-container {
    width: 100%;
}

.dap-time-info {
    display: flex;
    justify-content: space-between;
    color: var(--dap-bg-white);
    font-size: 13px;
    font-weight: 500;
    margin-block-end: 10px;
    opacity: 0.95;
    font-family: 'Courier New', monospace;
}

.dap-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: height 0.2s;
}

.dap-progress-bar:hover {
    height: 12px;
}

.dap-progress-fill {
    height: 100%;
    background: var(--dap-bg-white);
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.dap-progress-fill::after {
    content: '';
    position: absolute;
    inset-inline-end: -8px;
    inset-block-start: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--dap-bg-white);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.dap-progress-bar:hover .dap-progress-fill::after {
    opacity: 1;
}

/* Control Buttons */
.dap-control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.dap-control-btn {
    width: 55px;
    height: 55px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--dap-bg-white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--dap-transition);
    backdrop-filter: blur(10px);
}

.dap-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.dap-control-btn:active {
    transform: scale(0.95);
}

.dap-control-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.dap-play-pause {
    width: 70px;
    height: 70px;
    background: var(--dap-bg-white);
    color: var(--dap-primary-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.dap-play-pause:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
}

.dap-play-pause .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

/* Volume Control (Horizontal) */
.dap-volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dap-bg-white);
    margin-inline-end: 20px;
}

.dap-volume-control .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.dap-volume-slider {
    width: 120px;
    height: 6px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.dap-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--dap-bg-white);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.dap-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.dap-volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--dap-bg-white);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Scrollbar Customization
=================================== */
.dap-playlist-section::-webkit-scrollbar {
    width: 10px;
}

.dap-playlist-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dap-playlist-section::-webkit-scrollbar-thumb {
    background: var(--dap-primary-gradient);
    border-radius: 10px;
}

.dap-playlist-section::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5568d3, #6a3f8f);
}

/* ===================================
   Pagination Styles
=================================== */
.dap-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 30px 0 15px;
    flex-wrap: wrap;
}

.dap-pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--dap-bg-white);
    border: 2px solid var(--dap-border-color);
    border-radius: 10px;
    color: var(--dap-text-dark);
    text-decoration: none;
    transition: var(--dap-transition);
    cursor: pointer;
}

.dap-pagination-btn:hover {
    background: var(--dap-primary-color);
    border-color: var(--dap-primary-color);
    color: var(--dap-bg-white);
    transform: translateY(-2px);
    box-shadow: var(--dap-shadow-md);
}

.dap-pagination-btn.dap-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.dap-pagination-btn .fa-solid {
    font-size: 14px;
}

.dap-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dap-pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--dap-bg-white);
    border: 2px solid var(--dap-border-color);
    border-radius: 10px;
    color: var(--dap-text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--dap-transition);
    cursor: pointer;
}

.dap-pagination-number:hover {
    background: var(--dap-bg-light);
    border-color: var(--dap-primary-color);
    color: var(--dap-primary-color);
    transform: translateY(-2px);
    box-shadow: var(--dap-shadow-sm);
}

.dap-pagination-number.dap-active {
    background: var(--dap-primary-gradient);
    border-color: var(--dap-primary-color);
    color: var(--dap-bg-white);
    box-shadow: var(--dap-shadow-md);
    cursor: default;
}

.dap-pagination-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 40px;
    color: var(--dap-text-light);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 2px;
    user-select: none;
}

.dap-pagination-info {
    text-align: center;
    color: var(--dap-text-medium);
    font-size: 14px;
    margin-bottom: 20px;
}

.dap-no-items {
    text-align: center;
    padding: 40px 20px;
    color: var(--dap-text-light);
    font-size: 16px;
    background: var(--dap-bg-light);
    border-radius: 15px;
    margin: 20px 0;
}

/* In RTL, swap the arrow positions and directions */
[dir="rtl"] .dap-pagination-prev .fa-chevron-left::before {
    content: "\f054"; /* point left (acts as next in RTL since it's on the right) */
}

[dir="rtl"] .dap-pagination-next .fa-chevron-right::before {
    content: "\f053"; /* point right (acts as prev in RTL since it's on the left) */
}

/* ===================================
   Responsive Design
=================================== */
@media (max-width: 768px) {
    .dap-player-wrapper {
        margin: 20px 10px;
        border-radius: 15px;
    }

    .dap-playlist-section {
        padding: 20px;
        max-height: 500px;
    }

    .dap-section-title {
        font-size: 22px;
        margin-block-end: 20px;
    }

    .dap-audio-item {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .dap-audio-thumbnail {
        width: 50%;
        height: auto;
        max-width: 200px;
    }

    .dap-audio-duration {
        text-align: center;
        margin-block-start: 10px;
    }

    /* Fixed Bottom Player Mobile */
    .dap-player-content-bottom {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }

    .dap-player-left {
        width: 100%;
        max-width: 100%;
        margin-block-end: 10px;
    }

    .dap-player-left .dap-progress-bar-bottom {
        border-radius: 0;
        background: rgba(255, 255, 255, 0.1);
    }

    .dap-player-right {
        width: 100%;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        justify-content: space-between;
        border-block-start: 1px solid rgba(255, 255, 255, 0.1);
        padding-block-start: 10px;
    }

    .dap-current-info-bottom {
        text-align: start;
        flex: 1;
        margin-inline-end: 15px;
    }

    .dap-current-thumbnail-bottom {
        width: 40px;
        height: 40px;
    }

    .dap-controls-right {
        margin-inline-start: auto;
    }

    .dap-volume-control-bottom .dashicons,
    .dap-menu-btn-bottom .dashicons {
        font-size: 20px;
    }

    /* Sticky Player Mobile */
    .dap-fixed-player {
        padding: 20px;
    }

    .dap-player-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .dap-current-thumbnail {
        width: 100px;
        height: 100px;
    }

    .dap-control-buttons {
        gap: 10px;
    }

    .dap-control-btn {
        width: 50px;
        height: 50px;
    }

    .dap-play-pause {
        width: 65px;
        height: 65px;
    }

    .dap-volume-control {
        width: 100%;
        justify-content: center;
        margin-inline-end: 0;
        margin-block-start: 10px;
    }
}

@media (max-width: 480px) {
    .dap-section-title {
        font-size: 20px;
    }

    .dap-audio-title {
        font-size: 17px;
    }

    .dap-audio-description {
        font-size: 13px;
    }

    .dap-current-title {
        font-size: 18px;
    }

    .dap-volume-slider {
        width: 100px;
    }
}