/* ============================================================
   Anti Stream — Front-end Player Styles  v4.0.0
   Author: Abdulrahman Alili | antiradio.net
   
   v4.0.0 Changes:
   - Mobile play/pause buttons fully decoupled (.aura-mobile-play-btn / .aura-mobile-pause-btn)
   - Smooth hardware-accelerated transitions (transform3d)
   - Ripple effect on button tap (mobile UX)
   - prefers-reduced-motion support
   - CSS custom property theming expanded
   - Improved touch target sizing (min 44px per WCAG 2.5.5)
   ============================================================ */

:root {
    --aura-track-bg:       rgba(255, 255, 255, 0.10);
    --aura-accent-glass:   rgba(255, 255, 255, 0.20);
    --aura-font:           'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --aura-fade-duration:  200ms;
    --aura-radius-btn:     50px;
    --aura-mobile-btn-h:   40px;
}

/* ── Container ── */
.aura-player-container {
    width: 100% !important;
    height: 150px !important;
    background: #000 !important;
    border-radius: 22px;
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    z-index: 10;
    /* Isolate paint & layout so the browser doesn't repaint the whole
       page when album art or animations update inside the player.   */
    contain: layout paint;
}

/* ── Inner layout ── */
.aura-player-inner {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ── Icon Play / Pause button (Desktop only) ── */
.aura-play-pause {
    position: relative;
    flex-shrink: 0;
    width: 56px !important;
    height: 56px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;

    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.aura-play-pause:hover {
    background: rgba(255, 255, 255, 0.30) !important;
    transform: scale(1.06);
}
.aura-play-pause:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.12);
}

/* Icon SVG swap — driven by is-playing on the container */
.aura-player-container .aura-pause-icon               { display: none; }
.aura-player-container.is-playing .aura-play-icon     { display: none !important; }
.aura-player-container.is-playing .aura-pause-icon    { display: block !important; }

/* ── OLD text btn group — HIDDEN completely (replaced by dedicated mobile buttons) ── */
.aura-text-btn-group { display: none !important; }

/* ============================================================
   MOBILE PLAY / PAUSE BUTTONS
   Completely separate from desktop icon button.
   Use .aura-mobile-play-btn and .aura-mobile-pause-btn.
   Desktop: always hidden.
   Mobile: only one visible at a time (is-hidden toggles).
   ============================================================ */

.aura-mobile-controls {
    display: none; /* hidden on desktop */
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

/* Base style for both mobile buttons */
.aura-mobile-play-btn,
.aura-mobile-pause-btn {
    font-family: var(--aura-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--aura-radius-btn);
    height: var(--aura-mobile-btn-h);
    padding: 0 20px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Smooth appear/disappear */
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;

    /* Ensure min touch target (WCAG 2.5.5) */
    min-width: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    user-select: none;
}

/* Play icon in mobile play button */
.aura-mobile-play-btn::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 9px;
    border-color: transparent transparent transparent #fff;
    flex-shrink: 0;
    margin-right: 2px;
}

/* Pause icon in mobile pause button */
.aura-mobile-pause-btn::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 12px;
    background: linear-gradient(
        to right,
        #fff 0%, #fff 35%,
        transparent 35%, transparent 65%,
        #fff 65%, #fff 100%
    );
    flex-shrink: 0;
    margin-right: 2px;
}

/* Hover states */
.aura-mobile-play-btn:hover,
.aura-mobile-pause-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.04);
}

/* Active / tap feedback */
.aura-mobile-play-btn:active,
.aura-mobile-pause-btn:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.38);
}

/* Ripple effect on tap */
.aura-mobile-play-btn::after,
.aura-mobile-pause-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255,255,255,0.25);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.aura-mobile-play-btn:active::after,
.aura-mobile-pause-btn:active::after {
    opacity: 1;
    transition: none;
}

/* Hidden state — toggled by JS */
.aura-mobile-play-btn.is-hidden,
.aura-mobile-pause-btn.is-hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

/* Initially: play visible, pause hidden */
.aura-mobile-pause-btn { 
    opacity: 0; 
    pointer-events: none;
    position: absolute;
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

/* When playing: swap visibility */
.aura-player-container.is-playing .aura-mobile-pause-btn {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    width: auto;
    min-width: 72px;
    padding: 0 20px;
    overflow: hidden;
}
.aura-player-container.is-playing .aura-mobile-play-btn {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

/* ── Metadata fade transition ── */
.aura-artist-name,
.aura-track-title {
    transition: opacity var(--aura-fade-duration) ease;
}
.aura-artist-name.aura-fading,
.aura-track-title.aura-fading { opacity: 0; }

/* prefers-reduced-motion: disable all transitions */
@media (prefers-reduced-motion: reduce) {
    .aura-artist-name,
    .aura-track-title,
    .aura-mobile-play-btn,
    .aura-mobile-pause-btn,
    .aura-play-pause {
        transition: none !important;
    }
}

/* ── Metadata text ── */
.aura-meta-info {
    flex-grow: 1;
    margin-left: 22px;
    min-width: 0;
}
.aura-artist-name {
    font-family: var(--aura-font);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aura-track-title {
    font-family: var(--aura-font);
    color: rgba(255, 255, 255, 0.60);
    font-size: 15px;
    margin: 4px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Platform search links ── */
.aura-search-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.aura-search-link {
    font-family: var(--aura-font);
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color .2s;
}
.aura-search-link:hover { color: #fff; }
.aura-brand-icon { width: 14px; height: 14px; object-fit: contain; }

/* ── Volume ── */
.aura-volume-wrapper { margin-left: auto; flex-shrink: 0; }
.aura-volume-container { display: flex; align-items: center; gap: 8px; }
.aura-vol-icon { font-size: 13px; color: rgba(255, 255, 255, 0.50); }

.aura-volume-slider {
    -webkit-appearance: none;
    width: 60px;
    height: 3px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    background: var(--aura-track-bg);
    touch-action: none;
}
.aura-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.30);
}
.aura-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ============================================================
   MOBILE — critical structural rules
   ============================================================ */

/* Tablet (768px) */
@media (max-width: 768px) {
    .aura-player-container { height: auto !important; min-height: 80px !important; }
    .aura-player-inner     { flex-wrap: nowrap; align-items: center; gap: 12px; padding: 16px 20px; }

    /* Hide desktop icon button */
    .aura-icon-btn         { display: none !important; }

    /* Show mobile controls */
    .aura-mobile-controls  { display: flex !important; flex-shrink: 0; }

    .aura-volume-slider    { width: 80px; }
    .aura-search-link      { font-size: 11px; }
    .aura-meta-info        { margin-left: 8px; }
    .aura-artist-name      { font-size: 16px; }
    .aura-track-title      { font-size: 13px; }
}

/* Phone (480px) */
@media (max-width: 480px) {
    :root { --aura-mobile-btn-h: 44px; }

    .aura-player-inner     { padding: 14px 16px; gap: 10px; }

    /* Larger touch targets on phone */
    .aura-mobile-play-btn,
    .aura-mobile-pause-btn {
        font-size: 12px;
        padding: 0 16px;
        height: 44px;
        min-width: 68px;
        border-radius: 22px;
    }

    /* Hide volume on smallest screens — save space */
    .aura-volume-wrapper   { display: none !important; }

    .aura-meta-info        { margin-left: 4px; }
    .aura-artist-name      { font-size: 14px; }
    .aura-track-title      { font-size: 12px; }
    .aura-search-panel     { gap: 8px; margin-top: 8px; }
}

/* ============================================================
   PLAY BUTTON STYLES — 10 variants (desktop icon button)
   ============================================================ */

.aura-btn-style-1 .aura-play-pause {
    background: rgba(255,255,255,0.20) !important;
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #fff;
}
.aura-btn-style-2 .aura-play-pause {
    background: #fff !important;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.aura-btn-style-2 .aura-play-pause svg path { fill: #111; }
.aura-btn-style-3 .aura-play-pause {
    background: rgba(0,0,0,0.55) !important;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.aura-btn-style-4 .aura-play-pause {
    background: transparent !important;
    border: 2px solid rgba(255,255,255,0.85);
}
.aura-btn-style-5 .aura-play-pause {
    background: rgba(255,255,255,0.95) !important;
    border: none;
    box-shadow: 0 0 0 5px rgba(255,255,255,0.20),
                0 0 20px rgba(255,255,255,0.50),
                0 0 40px rgba(255,255,255,0.15);
}
.aura-btn-style-5 .aura-play-pause svg path { fill: #111; }
.aura-btn-style-6 .aura-play-pause {
    background: #6c47ff !important;
    border: none;
    box-shadow: 0 4px 20px rgba(108,71,255,0.55);
}
.aura-btn-style-7 .aura-play-pause {
    background: #2563eb !important;
    border: none;
    box-shadow: 0 4px 20px rgba(37,99,235,0.55);
}
.aura-btn-style-8 .aura-play-pause {
    background: rgba(244,114,182,0.80) !important;
    border: 1px solid rgba(255,255,255,0.20);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(244,114,182,0.40);
}
.aura-btn-style-9 .aura-play-pause {
    background: linear-gradient(135deg, #f5c842, #c8921a) !important;
    border: 1px solid rgba(255,220,100,0.4);
    box-shadow: 0 4px 18px rgba(200,146,26,0.50);
}
.aura-btn-style-10 .aura-play-pause {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.40);
    width: 46px !important;
    height: 46px !important;
}
.aura-btn-style-10 .aura-play-pause svg { width: 22px; height: 22px; }

/* ============================================================
   ALBUM ART — Side Thumbnail
   ============================================================ */

.aura-art-zone {
    flex-shrink: 0;
    width: var(--aura-art-size, 110px);
    height: var(--aura-art-size, 110px);
    position: relative;
    z-index: 2;
}

.aura-album-art-wrap {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
    position: relative;
}

.aura-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: scale(1.01); /* tiny crop to avoid white flash at edges */
}

/* Fade in when src is set */
.aura-art-zone.has-art .aura-art-img {
    opacity: 1 !important;
}

/* Subtle pulse on new art load */
@keyframes aura-art-pop {
    0%   { transform: scale(0.97); }
    60%  { transform: scale(1.03); }
    100% { transform: scale(1.01); }
}
.aura-art-zone.has-art .aura-art-img {
    animation: aura-art-pop 0.4s ease forwards;
}

/* ============================================================
   ALBUM ART — Full-bleed Blur Background Layer
   ============================================================ */

.aura-bg-layer {
    position: absolute;
    inset: -20px;          /* extend beyond border-radius so blur covers corners */
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* blur + brightness controlled by admin dynamic CSS */
    filter: blur(50px) brightness(0.35);
    transition: background-image 0.3s ease-in-out, opacity 0.3s ease;

    pointer-events: none;
}

/* Fade during bg swap */
.aura-bg-layer.aura-bg-fading {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.aura-bg-layer:not(.aura-bg-fading) {
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Ensure inner content sits above the bg layer */
.aura-player-inner {
    position: relative;
    z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
    .aura-bg-layer        { transition: none !important; }
    .aura-art-img         { transition: none !important; animation: none !important; }
}
