/**
 * Modern Audio Player - Frontend Stylesheet
 * @package ModernAudioPlayer
 * @version 1.0.0
 * @author SoulPixelCraft
 */

.modern-audio-player-wrapper {
    overflow-anchor: none !important;
}

/* ========== Opacity & Visibility Control ========== */

.modern-audio-player-wrapper:not(.elementor-editor-preview) {
    opacity: 0;
    transition: opacity var(--popup-transition) var(--ease-in);
}

.modern-audio-player-wrapper:not(.elementor-editor-preview).player-ready {
    opacity: 1;
}

.elementor-editor-preview,
.elementor-widget-modern-audio-player .modern-audio-player-wrapper {
    opacity: 1 !important;
}

/* ========== Main Player Wrapper ========== */

.modern-audio-player-wrapper {
    position: relative;
    text-align: center;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    isolation: isolate;
    transition: all 0.3s ease;
    background-origin: border-box;
    background-clip: border-box;
    display: flex;
    flex-direction: column;
}

.modern-audio-player-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    pointer-events: none;
    z-index: -2;
    border-radius: inherit;
}

.modern-audio-player-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* ========== Player Header & Title ========== */

.modern-audio-player-wrapper .player-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.modern-audio-player-wrapper .player-title {
    flex: 1;
    text-align: center;
}

.modern-audio-player-wrapper .player-title h3 {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    text-align: center;
}

/* ========== Settings Button ========== */

.modern-audio-player-wrapper .settings-button {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 45px;
    height: 45px;
    background: transparent !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modern-audio-player-wrapper .settings-button:hover,
.modern-audio-player-wrapper .settings-button:focus,
.modern-audio-player-wrapper .settings-button:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.modern-audio-player-wrapper .settings-button .dots-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.modern-audio-player-wrapper .settings-button:hover .dots-container {
    opacity: 1;
}

.modern-audio-player-wrapper .settings-button .dot {
    width: 20px !important;
    height: 3px !important;
    background: currentColor;
    border-radius: 2px;
    display: block;
}

/* ========== Album Cover Thumbnail ========== */

.modern-audio-player-wrapper .album-cover-thumb {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
}

.modern-audio-player-wrapper .album-cover-thumb:hover {
    transform: scale(1.08);
}

.modern-audio-player-wrapper .album-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modern-audio-player-wrapper:not(.elementor-editor-preview)
    .album-cover-thumb:has(img[src*='placeholder.png']) {
    display: none !important;
}

.modern-audio-player-wrapper:not(.elementor-editor-preview)
    .album-cover-popup:has(img[src*='placeholder.png']) {
    display: none !important;
}

/* ========== Album Cover Popup ========== */

.modern-audio-player-wrapper {
    position: relative !important;
}

.modern-audio-player-wrapper .album-cover-popup {
    position: absolute !important;
    top: 5px !important;
    left: 5px !important;
    width: 320px !important;
    height: auto !important;
    min-height: 320px !important;
    background: transparent !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    transform: scale(0.15) translateZ(0) !important;
    transform-origin: top left !important;
    z-index: 1000 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1),
        opacity 0.7s cubic-bezier(0.25, 0.8, 0.25, 1),
        visibility 0s linear 0.7s !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    will-change: transform, opacity !important;
    backface-visibility: hidden !important;
}

.modern-audio-player-wrapper .album-cover-popup.scaling {
    transform: scale(1) translateZ(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1),
        opacity 0.7s cubic-bezier(0.25, 0.8, 0.25, 1),
        visibility 0s linear 0s !important;
}

.modern-audio-player-wrapper .album-cover-popup img {
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    transform: translateZ(0) !important;
}

.modern-audio-player-wrapper .close-cover {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    color: #fff !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: opacity 0.25s ease !important;
    opacity: 0 !important;
    transform: translateZ(0) !important;
    z-index: 20;
}

.modern-audio-player-wrapper .album-cover-popup.scaling .close-cover {
    opacity: 1 !important;
    transition-delay: 0.5s !important;
}

.modern-audio-player-wrapper .close-cover:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

body.album-popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ========== Current Track Display ========== */

.modern-audio-player-wrapper .current-track-display {
    padding: 18px;
    border-radius: 12px;
    margin: 0 0 16px 0;
}

.current-track-display {
  text-align: center;
}

.track-title,
.track-artist {
  white-space: nowrap;
  display: inline-block;
}

/* ========== Controls Container ========== */

.modern-audio-player-wrapper .controls-container {
    width: calc(100% - 40px);
    min-width: 200px;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 8px;
    overflow: visible;
    box-sizing: border-box;
}

.modern-audio-player-wrapper .controls-inner {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    overflow: visible;
    isolation: isolate;
    container-type: inline-size;
    container-name: controls-area;
    z-index: 100;
}

.modern-audio-player-wrapper .controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, calc(24cqw * 0.138), 18px);
    width: 100%;
    position: relative;
    z-index: 100;
    padding: 8px 0;
    flex-wrap: nowrap;
    overflow: visible;
}

/* ========== Control Buttons ========== */

.modern-audio-player-wrapper .control-button {
    flex: 0 0 auto;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: transform var(--button-hover-duration) var(--ease-smooth),
        filter var(--button-hover-duration) var(--ease-smooth),
        background var(--button-hover-duration) var(--ease-smooth),
        color var(--button-hover-duration) var(--ease-smooth);
    transform-origin: center center;
    overflow: visible;
    position: relative;
    z-index: 2;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.modern-audio-player-wrapper .control-button:focus {
    outline: none;
}

.modern-audio-player-wrapper .control-button:active {
    transform: scale(0.95);
}

.modern-audio-player-wrapper .small-button {
    width: clamp(var(--small-btn-min), 18cqw, var(--small-btn-max));
    min-width: var(--small-btn-min);
    min-height: var(--small-btn-min);
    aspect-ratio: 1 / 1;
    font-size: clamp(12px, 8cqw, 20px);
    transition: all var(--button-hover-duration) var(--ease-smooth);
}

.modern-audio-player-wrapper .small-button:hover {
    transform: scale(1.08) translateZ(0);
}

.modern-audio-player-wrapper .small-button svg {
    width: 1em;
    height: 1em;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.modern-audio-player-wrapper .play-btn {
    width: clamp(var(--play-btn-min), 24cqw, var(--play-btn-max));
    min-width: var(--play-btn-min);
    min-height: var(--play-btn-min);
    aspect-ratio: 1 / 1;
    font-size: clamp(16px, 10cqw, 28px);
    transition: all var(--button-hover-duration) var(--ease-smooth);
}

.modern-audio-player-wrapper .play-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.06) translateZ(0);
}

/* ========== Play/Pause Icons ========== */

.modern-audio-player-wrapper .play-triangle {
    width: 0;
    height: 0;
    border-left: 18px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 6px;
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.modern-audio-player-wrapper .pause-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.modern-audio-player-wrapper .pause-bar {
    width: 4px;
    height: 16px;
    background-color: white;
    border-radius: 1px;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ========== Volume Control ========== */
.modern-audio-player-wrapper .volume-control {
    position: relative;
    display: inline-block;
}
.modern-audio-player-wrapper .volume-popup {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    z-index: 100000 !important;
}
.elementor-editor-active .modern-audio-player-wrapper .volume-popup {
    display: block !important;
}
.modern-audio-player-wrapper .volume-control:hover .volume-popup,
.modern-audio-player-wrapper .volume-control:focus-within .volume-popup {
    display: block;
}
.modern-audio-player-wrapper .volume-slider {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    touch-action: none;
}
.modern-audio-player-wrapper .volume-track-fill {
    fill: #667EEA;
    transition: y var(--volume-slider-transition) ease,
        height var(--volume-slider-transition) ease;
    will-change: transform;
}
.modern-audio-player-wrapper .volume-thumb {
    stroke: #667EEA;
    transition: cy var(--volume-slider-transition) ease;
    cursor: pointer;
    will-change: transform;
}

/* ========== Volume Indicator (OSD) ========== */

.volume-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8) translateZ(0);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 1000;
    will-change: transform, opacity;
    backface-visibility: hidden;
}
.volume-indicator.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateZ(0);
}

/* ========== Progress Bar & Time Display ========== */


.modern-audio-player-wrapper .progress-section {
    margin-left: 5px;
    margin-right: 5px;
}

.modern-audio-player-wrapper .progress-container {
    width: 100%;
    height: 5px;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.modern-audio-player-wrapper .progress-bar {
    height: 100%;
    width: 0%;
    position: relative;
    transition: none !important;
    will-change: width;
}

.modern-audio-player-wrapper .progress-bar::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%) translateZ(0);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    overflow: visible;
    will-change: transform;
    backface-visibility: hidden;
    transition: none !important;
}

.modern-audio-player-wrapper .time-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
}

.elementor-editor-active .modern-audio-player-wrapper .progress-bar {
    width: 50% !important;
}

.current-time {
    will-change: contents;
}

/* ========== Miscellaneous ========== */

.modern-audio-player-wrapper .audio-element {
    display: none;
}

.modern-audio-player-wrapper .no-tracks-message {
    margin-top: 20px;
    color: #666;
}

.modern-audio-player-wrapper .editor-preview-note {
    margin-top: 15px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    font-size: 12px;
    color: #666;
}

.track-artist {
    font-weight: 400;
}

html {
    scrollbar-gutter: stable;
}

/* ========== Track List ========== */

.modern-audio-player-wrapper .track-list {
    text-align: left;
    margin: 0;
    scroll-behavior: smooth;
    position: relative;
}

.modern-audio-player-wrapper .track-item-wrapper {
    position: relative;
    overflow: hidden;
    transition: opacity 0.4s var(--ease-out);
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

.modern-audio-player-wrapper .track-item {
    display: flex;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--track-separator-color);
    border-left: 4px solid transparent;
    transition: background 0.2s ease, 
                color 0.2s ease, 
                border-color 0.2s ease,
                margin-bottom var(--cover-open-duration) var(--ease-out);
    will-change: background, color, border-color, margin-bottom;
}

@media (max-width: 767px) {
    .modern-audio-player-wrapper .track-item {
        margin-bottom: 5px;
    }
}

.track-info {
    padding-left: 15px;
}

.modern-audio-player-wrapper .track-item strong {
    color: inherit;
    transition: color 0.2s ease;
}

.modern-audio-player-wrapper .track-list.has-playing-track > .track-item-wrapper:first-child .track-item {
    background: var(--track-active-bg, rgba(255, 255, 255, 0.05));
    color: var(--track-active-color, #fff);
    border-left-color: var(--accent-color, #00d9ff);
}

.modern-audio-player-wrapper .track-item-wrapper.cover-open .track-item,
.modern-audio-player-wrapper.has-open-cover .track-list.has-playing-track > .track-item-wrapper:first-child .track-item {
    margin-bottom: 0px !important;
}

.modern-audio-player-wrapper.carousel-open .track-list > .track-item-wrapper:first-child .track-item {
    margin-bottom: 0px !important;
}

/* ========== Song Cover Expanded ========== */

.modern-audio-player-wrapper .song-cover-expanded {
    width: 100%;
    height: 0;
    max-height: 320px;
    overflow: hidden;
    padding: 0;
    transform: scaleY(0) translate3d(0, 0, 0);
    transform-origin: top;
    opacity: 0;
    transition: height var(--cover-open-duration) var(--ease-out),
                transform var(--cover-open-duration) var(--ease-out),
                opacity var(--cover-open-duration) var(--ease-out),
                padding var(--cover-open-duration) var(--ease-out);
    will-change: transform, opacity, height;
    backface-visibility: hidden;
}

.modern-audio-player-wrapper .track-item-wrapper.active.cover-open .song-cover-expanded {
    height: 320px;
    transform: scaleY(1) translate3d(0, 0, 0);
    opacity: 1;
}

.modern-audio-player-wrapper .song-cover-expanded img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.modern-audio-player-wrapper .track-item-wrapper.active.cover-open + .track-item-wrapper .track-item {
    margin-top: 0 !important;
}

.modern-audio-player-wrapper[data-cover-animation='vinyl-spin'] .song-cover-expanded,
.modern-audio-player-wrapper[data-cover-animation='flip'] .song-cover-expanded,
.modern-audio-player-wrapper[data-cover-animation='zoom'] .song-cover-expanded {
    display: none !important;
}

/* ========== Song Cover Thumbnail ========== */

.modern-audio-player-wrapper .song-cover-thumb {
    margin-left: 5px;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.modern-audio-player-wrapper .song-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== Download Popup ========== */

.map-download-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: all var(--popup-transition) ease;
}

.map-download-popup-overlay.show {
    background: rgba(0, 0, 0, 0.75);
    opacity: 1;
}

.map-download-popup {
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    max-width: 280px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(30px) scale(0.9);
    transition: all var(--popup-transition) ease;
}

.map-download-popup-overlay.show .map-download-popup {
    transform: translateY(0) scale(1);
}

.map-popup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.map-popup-icon {
    margin-bottom: 8px;
}

.map-popup-icon svg {
    width: 32px;
    height: 32px;
    stroke: #3498db;
}

.map-download-popup h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.map-download-popup p {
    margin: 0 0 12px;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.map-popup-ok {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 8px 22px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--popup-transition);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.map-popup-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ========== Collapse Animation Mode ========== */

.modern-audio-player-wrapper[data-cover-animation='collapse'] .song-cover-expanded {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.modern-audio-player-wrapper[data-cover-animation='collapse'] .song-cover-expanded img {
    width: 280px !important;
    height: 280px !important;
    max-width: 280px;
    max-height: 280px;
    object-fit: cover;
    border-radius: 12px;
}

/* ========== Slide-Through Animation Mode ========== */

.modern-audio-player-wrapper[data-cover-animation='slide-through'] .song-cover-expanded img {
    width: 280px !important;
    height: 280px !important;
    max-width: 280px;
    max-height: 280px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.modern-audio-player-wrapper[data-cover-animation='slide-through']
    .track-item-wrapper:first-child.cover-open {
    height: 304px;
    transition: all var(--cover-close-duration) var(--ease-smooth) !important;
}

.modern-audio-player-wrapper[data-cover-animation='slide-through']
    .track-item-wrapper:first-child:not(.cover-open) {
    height: auto;
    transition: all var(--cover-close-duration) var(--ease-smooth) !important;
}

.modern-audio-player-wrapper[data-cover-animation='slide-through']
    .track-item-wrapper:first-child {
    position: relative;
    overflow: hidden;
}

.modern-audio-player-wrapper[data-cover-animation='slide-through'] .song-cover-expanded {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(0);
    opacity: 1;
    transition: none;
    z-index: 5;
}

.modern-audio-player-wrapper[data-cover-animation='slide-through'] .track-item-wrapper {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    transform: translateZ(0);
}

.modern-audio-player-wrapper[data-cover-animation='slide-through']
    .track-item-wrapper:not(:first-child)
    .song-cover-expanded {
    display: none;
}

/* ========== Carousel Cover Container (GPU Optimized) ========== */

.modern-audio-player-wrapper[data-cover-animation] .cover-carousel-container {
    width: 100%;
    height: 0;
    max-height: 320px;
    overflow: hidden;
    position: relative;
    background: transparent !important;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
    transform: scaleY(0) translate3d(0, 0, 0);
    transform-origin: top;
    opacity: 0;
    transition: height var(--carousel-height-transition) var(--ease-smooth),
                transform var(--carousel-height-transition) var(--ease-smooth),
                opacity var(--carousel-height-transition) var(--ease-smooth);
    will-change: transform, opacity, height;
    backface-visibility: hidden;
    perspective: 1000px;
    padding-bottom: 0;
}

.modern-audio-player-wrapper[data-cover-animation].carousel-open .cover-carousel-container {
    height: 320px;
    transform: scaleY(1) translate3d(0, 0, 0);
    opacity: 1;
    margin-bottom: 0px;
}

.modern-audio-player-wrapper[data-cover-animation] .cover-carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 1200px;
}

.modern-audio-player-wrapper[data-cover-animation] .carousel-cover-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    opacity: 0;
    pointer-events: none;
    transition: none;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    will-change: transform, opacity;
}

.modern-audio-player-wrapper[data-cover-animation='vinyl-spin'] .carousel-cover-item {
    border-radius: 50% !important;
}

.modern-audio-player-wrapper[data-cover-animation] .carousel-cover-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modern-audio-player-wrapper[data-cover-animation] .carousel-cover-item.active {
    opacity: 1;
    z-index: 10;
}

/* ========== Settings Panel ========== */

.modern-audio-player-wrapper .settings-panel {
    position: absolute;
    top: 8px;
    right: -220px;
    width: 220px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: right var(--settings-transition) var(--ease-smooth),
        opacity var(--settings-transition) ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    font-family: 'Poppins', sans-serif;
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.modern-audio-player-wrapper .settings-panel.open {
    right: 8px;
    opacity: 1;
    pointer-events: all;
}

.modern-audio-player-wrapper .settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.modern-audio-player-wrapper .settings-panel-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: -0.2px;
    font-family: 'Poppins', sans-serif;
}

.modern-audio-player-wrapper .settings-panel-header h4 svg {
    width: 12px;
    height: 12px;
    color: #aaa;
}

.modern-audio-player-wrapper .settings-close {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #999;
    font-size: 20px;
    line-height: 1;
    font-weight: 300;
}

.modern-audio-player-wrapper .settings-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.05);
}

.modern-audio-player-wrapper .settings-close:active {
    transform: scale(0.95);
}

.modern-audio-player-wrapper .settings-panel-content {
    padding: 10px 12px 12px;
}

.modern-audio-player-wrapper .setting-item {
    margin-bottom: 12px;
}

.modern-audio-player-wrapper .setting-item:last-child {
    margin-bottom: 0;
}

.modern-audio-player-wrapper .setting-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    font-size: 9px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.modern-audio-player-wrapper .setting-label svg {
    width: 11px;
    height: 11px;
    color: #bbb;
    opacity: 0.7;
}

.modern-audio-player-wrapper .setting-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modern-audio-player-wrapper .setting-option {
    display: flex;
    align-items: center;
    padding: 6px 9px;
    background: #fafafa;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    position: relative;
}

.modern-audio-player-wrapper .setting-option:hover {
    background: #f5f5f5;
}

.modern-audio-player-wrapper .setting-option.active {
    background: #fafafa;
    border-color: transparent;
}

.modern-audio-player-wrapper .setting-option input[type='radio'] {
    display: none;
}

.modern-audio-player-wrapper .setting-option.active::after {
    content: '✓';
    position: absolute;
    right: 10px;
    font-size: 14px;
    color: #10b981;
    font-weight: 600;
}

.modern-audio-player-wrapper .setting-option label {
    flex: 1;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
    padding-right: 24px;
    text-align: left;
}

.modern-audio-player-wrapper .setting-option.active label {
    color: #333;
    font-weight: 500;
}

.modern-audio-player-wrapper .setting-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 9px;
    background: #fafafa;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modern-audio-player-wrapper .setting-toggle:hover {
    background: #f5f5f5;
}

.modern-audio-player-wrapper .setting-toggle label {
    font-size: 12px;
    color: #666;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
    text-align: left;
    flex: 1;
}

.modern-audio-player-wrapper .toggle-switch {
    position: relative;
    width: 32px;
    height: 18px;
    background: #e0e0e0;
    border-radius: 9px;
    transition: background 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
}

.modern-audio-player-wrapper .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2.5px;
    left: 2.5px;
    width: 13px;
    height: 13px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s var(--ease-smooth);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.modern-audio-player-wrapper .toggle-switch.active {
    background: #667eea;
}

.modern-audio-player-wrapper .toggle-switch.active::after {
    transform: translateX(14px);
}

.modern-audio-player-wrapper .setting-toggle input[type='checkbox'] {
    display: none;
}

.modern-audio-player-wrapper .settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition: all var(--settings-transition) ease;
    z-index: 99;
}

.modern-audio-player-wrapper .settings-overlay.visible {
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
    pointer-events: all;
}

/* ========== Compact Mode ========== */

.modern-audio-player-wrapper.compact-mode .album-cover-thumb {
    display: none;
}

.modern-audio-player-wrapper.compact-mode .song-cover-thumb {
    display: none;
}

.modern-audio-player-wrapper.compact-mode .song-cover-expanded {
    display: none !important;
}

.modern-audio-player-wrapper.compact-mode .cover-carousel-container {
    display: none !important;
}

.modern-audio-player-wrapper.compact-mode .player-title {
    flex: 1;
    text-align: center;
    padding: 0 0;
}

.modern-audio-player-wrapper.compact-mode .track-item-wrapper {
    pointer-events: auto;
}

.modern-audio-player-wrapper.compact-mode .track-item.active {
    margin-bottom: 15px;
}

/* ========== Firefox Mobile Fallback ========== */

@supports not (container-type: inline-size) {
    .modern-audio-player-wrapper .play-btn {
        width: 55px !important;
        min-width: 55px !important;
        height: 55px !important;
        font-size: 20px !important;
    }

    .modern-audio-player-wrapper .small-button {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        font-size: 16px !important;
    }
}

/* ========== Responsive: Mobile & Tablet ========== */

@media (max-width: 767px) {
    .modern-audio-player-wrapper .settings-button {
        top: 0px;
        right: 0px;
    }
}

@media (max-width: 1024px) {
    .modern-audio-player-wrapper .album-cover-thumb {
        top: 10px;
        left: 10px;
    }
}

@media (max-width: 767px) {
    .modern-audio-player-wrapper .album-cover-thumb {
        top: 7px;
        left: 7px;
    }
}

@media (max-width: 1024px) and (min-width: 768px) {
    .modern-audio-player-wrapper .track-item {
        margin-bottom: 10px;
    }
}

@media (max-width: 767px) {
    .modern-audio-player-wrapper .track-item {
        margin-bottom: 5px;
    }
}

@media (max-width: 1024px) {
    .modern-audio-player-wrapper .track-item-wrapper.cover-open .track-item,
    .modern-audio-player-wrapper.has-open-cover .track-list.has-playing-track > .track-item-wrapper:first-child .track-item,
    .modern-audio-player-wrapper.carousel-open .track-list > .track-item-wrapper:first-child .track-item {
        margin-bottom: 0px !important;
    }
    
    .modern-audio-player-wrapper .song-cover-expanded {
        max-height: 280px;
    }
    
    .modern-audio-player-wrapper .track-item-wrapper.active.cover-open .song-cover-expanded {
        height: 280px;
        padding: 20px 0;
    }
    
    .modern-audio-player-wrapper[data-cover-animation='collapse'] .song-cover-expanded img {
        width: 240px !important;
        height: 240px !important;
        max-width: 240px;
        max-height: 240px;
    }
    
    .modern-audio-player-wrapper[data-cover-animation='slide-through'] .song-cover-expanded img {
        width: 240px !important;
        height: 240px !important;
        max-width: 240px;
        max-height: 240px;
    }
    
    .modern-audio-player-wrapper[data-cover-animation='slide-through']
        .track-item-wrapper:first-child.cover-open {
        height: 280px;
    }
}

@media (max-width: 380px) {
    .modern-audio-player-wrapper .album-cover-popup {
        padding: 10px;
    }

    .modern-audio-player-wrapper .album-cover-popup img {
        border-radius: 10px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 8px 25px rgba(0, 0, 0, 0.5);
    }
}

@media (max-width: 480px) {
    .modern-audio-player-wrapper {
        --play-btn-min: 45px;
        --small-btn-min: 32px;
    }
    
    .modern-audio-player-wrapper[data-cover-animation] .cover-carousel-container {
        max-height: 244px;
        border-radius: 10px 10px 0 0;
    }
    
    .modern-audio-player-wrapper[data-cover-animation].carousel-open .cover-carousel-container {
        height: 244px;
        margin-bottom: 0;
    }
    
    .modern-audio-player-wrapper[data-cover-animation] .carousel-cover-item {
        width: 220px;
        height: 220px;
    }
    
    .modern-audio-player-wrapper .album-cover-thumb {
        width: 40px;
        height: 40px;
    }
    
    .modern-audio-player-wrapper .album-cover-popup.scaling {
        width: 280px;
        height: 280px;
    }
    
    .modern-audio-player-wrapper .song-cover-thumb {
        width: 35px;
        height: 35px;
    }
    
    .modern-audio-player-wrapper .settings-panel {
        width: calc(100% - 16px);
        right: -100%;
        border-radius: 10px;
        top: 8px;
    }
    
    .modern-audio-player-wrapper .settings-panel.open {
        right: 8px;
    }
    
    .modern-audio-player-wrapper .settings-button {
        width: 30px;
        height: 30px;
    }
    
    .modern-audio-player-wrapper .settings-button svg {
        width: 15px;
        height: 15px;
    }
    
    .modern-audio-player-wrapper .song-cover-expanded {
        max-height: 260px;
    }
    
    .modern-audio-player-wrapper .track-item-wrapper.active.cover-open .song-cover-expanded {
        height: 260px;
        padding: 20px 0;
    }
    
    .modern-audio-player-wrapper[data-cover-animation='collapse'] .song-cover-expanded img {
        width: 220px !important;
        height: 220px !important;
        max-width: 220px;
        max-height: 220px;
    }
    
    .modern-audio-player-wrapper[data-cover-animation='slide-through'] .song-cover-expanded img {
        width: 220px !important;
        height: 220px !important;
        max-width: 220px;
        max-height: 220px;
    }
    
    .modern-audio-player-wrapper[data-cover-animation='slide-through']
        .track-item-wrapper:first-child.cover-open {
        height: 260px;
    }
    
    .modern-audio-player-wrapper .album-cover-popup {
        padding: 15px;
    }
    
    .modern-audio-player-wrapper .album-cover-popup img {
        max-width: 100%;
        border-radius: 12px;
    }
    
    .modern-audio-player-wrapper .close-cover {
        top: 15px;
        right: 15px;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 18px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .modern-audio-player-wrapper {
        --play-btn-min: 50px;
        --small-btn-min: 36px;
    }

    .modern-audio-player-wrapper[data-cover-animation].carousel-open .cover-carousel-container {
        height: 260px !important;
        margin-bottom: 0;
    }

    .modern-audio-player-wrapper[data-cover-animation] .carousel-cover-item {
        width: 220px !important;
        height: 220px !important;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .modern-audio-player-wrapper .album-cover-popup img {
        max-width: 60vh;
        max-height: 85vh;
    }
}

@media (max-width: 1024px) and (min-width: 768px) {
    .modern-audio-player-wrapper .current-track-display {
        padding: 12px;
        margin: 12px 0;
    }

    .modern-audio-player-wrapper .progress-section {
        margin-left: 5px;
        margin-right: 5px;
    }

    .modern-audio-player-wrapper .track-list {
        margin: 15px 0;
    }
}