/* =========================================================
   Awan Audio Player v1.3.0 - Rashid Awan
   Mobile-first. All variables are scoped to .aap-player so the
   plugin can never leak styles into the theme (v1.2 used :root).
   ========================================================= */

.aap-player {
    --aap-accent: #3b82f6;
    --aap-bg-1: #16203a;
    --aap-bg-2: #0b1020;
    --aap-border: rgba(255, 255, 255, .09);
    --aap-text: #f5f7fb;
    --aap-muted: #93a1bb;
    --aap-surface: rgba(255, 255, 255, .06);
    --aap-surface-hi: rgba(255, 255, 255, .12);
    --aap-radius: 20px;

    position: relative !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 28px 0 !important;
    padding: 16px !important;
    background: linear-gradient(155deg, var(--aap-bg-1) 0%, var(--aap-bg-2) 100%) !important;
    border: 1px solid var(--aap-border) !important;
    border-radius: var(--aap-radius) !important;
    box-shadow: 0 12px 34px rgba(3, 8, 22, .35) !important;
    overflow: visible !important;
    isolation: isolate;

    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-areas:
        "top"
        "progress"
        "tools"
        "fallback";
    gap: 14px 12px !important;

    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.aap-player * {
    box-sizing: border-box;
}

/* Soft accent glow in the corner */
.aap-player::before {
    content: "";
    position: absolute;
    top: -70px;
    right: -50px;
    width: 190px;
    height: 190px;
    background: var(--aap-accent);
    filter: blur(70px);
    opacity: .22;
    pointer-events: none;
    z-index: -1;
}

/* ---------------- Row 1: transport + meta ---------------- */
.aap-top {
    grid-area: top;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0;
}

.aap-transport {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: none;
}

.aap-player button {
    font-family: inherit !important;
    cursor: pointer !important;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.aap-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 50% !important;
    transition: transform .18s cubic-bezier(.4, 0, .2, 1), background .18s, box-shadow .18s !important;
}

.aap-btn-seek {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    background: var(--aap-surface) !important;
    border: 1px solid var(--aap-border) !important;
    color: var(--aap-text) !important;
}

.aap-btn-seek svg { fill: currentColor !important; }

.aap-btn-play {
    position: relative;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    border: none !important;
    color: #fff !important;
    background: var(--aap-accent) !important;
    box-shadow: 0 6px 18px -4px var(--aap-accent) !important;
}

.aap-btn-play svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.aap-icon-pause { display: none; }

/* Loading spinner while we wait for the speech engine */
.aap-spinner {
    display: none;
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(255, 255, 255, .9);
    animation: aap-spin .8s linear infinite;
}

.aap-loading .aap-spinner { display: block; }

@keyframes aap-spin { to { transform: rotate(360deg); } }

.aap-btn:active { transform: scale(.92) !important; }

@media (hover: hover) {
    .aap-btn-seek:hover { background: var(--aap-surface-hi) !important; }
    .aap-btn-play:hover { transform: scale(1.06) !important; }
}

/* Meta block */
.aap-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.aap-title {
    font-size: .98rem !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    color: var(--aap-text) !important;
    margin: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.aap-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.aap-time {
    font-size: .74rem !important;
    color: var(--aap-muted) !important;
    background: var(--aap-surface) !important;
    border: 1px solid var(--aap-border) !important;
    padding: 2px 9px !important;
    border-radius: 20px !important;
    white-space: nowrap;
}

/* Equalizer */
.aap-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}

.aap-eq i {
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 3px;
    background: var(--aap-accent);
}

.aap-eq.playing i { animation: aap-bounce .85s ease infinite alternate; }
.aap-eq.playing i:nth-child(2) { animation-delay: .18s; }
.aap-eq.playing i:nth-child(3) { animation-delay: .36s; }
.aap-eq.playing i:nth-child(4) { animation-delay: .1s; }

@keyframes aap-bounce {
    10%  { height: 4px; }
    50%  { height: 15px; }
    100% { height: 7px; }
}

/* ---------------- Row 2: progress ---------------- */
.aap-progress {
    grid-area: progress;
    position: relative;
    width: 100% !important;
    height: 6px !important;
    background: rgba(255, 255, 255, .1) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    outline: none;
}

/* Invisible padded hit-area so it is easy to tap on a phone */
.aap-progress::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    bottom: -12px;
}

.aap-progress:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--aap-accent) 45%, transparent);
}

.aap-fill {
    height: 100% !important;
    width: 0%;
    background: var(--aap-accent) !important;
    border-radius: 10px !important;
    position: relative;
    transition: width .15s linear;
}

.aap-fill::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--aap-accent), 0 2px 5px rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.aap-playing .aap-fill::after,
.aap-progress:hover .aap-fill::after { opacity: 1; }

/* ---------------- Row 3: tools ---------------- */
.aap-tools {
    grid-area: tools;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    overflow: visible !important;
    position: relative;
    z-index: 10;
}

.aap-speed,
.aap-voice {
    position: relative;
    flex: 1 1 calc(50% - 6px);
    z-index: 100;
}

.aap-btn-suspense,
.aap-btn-stop {
    flex: 1 1 calc(50% - 6px);
}

/* ---- Speed Trigger Button ---- */
.aap-speed-trigger {
    width: 100%;
    min-height: 42px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    background: linear-gradient(135deg, rgba(59,130,246,.18) 0%, rgba(99,102,241,.12) 100%) !important;
    border: 1px solid rgba(99, 102, 241, .35) !important;
    border-radius: 14px !important;
    color: var(--aap-text) !important;
    font-size: .85rem !important;
    font-weight: 600 !important;
    transition: all .2s ease !important;
    box-shadow: 0 2px 8px rgba(59,130,246,.15) !important;
}

.aap-speed-trigger:hover,
.aap-speed.open .aap-speed-trigger {
    background: linear-gradient(135deg, rgba(59,130,246,.30) 0%, rgba(99,102,241,.22) 100%) !important;
    border-color: rgba(99, 102, 241, .6) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.18), 0 4px 16px rgba(59,130,246,.25) !important;
    transform: translateY(-1px);
}

.aap-speed-label {
    color: rgba(148,163,184,.85);
    font-weight: 500;
    font-size: .78rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.aap-speed-val {
    color: #c7d2fe !important;
    font-weight: 700;
    font-size: .9rem;
}

.aap-chevron {
    fill: rgba(148,163,184,.7);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    margin-left: 2px;
}

.aap-speed.open .aap-chevron { transform: rotate(180deg); }

/* ---- Speed Dropdown Menu ---- */
.aap-speed-menu {
    display: none !important;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 140px;
    background: linear-gradient(160deg, #0f172a 0%, #131d35 100%) !important;
    border: 1px solid rgba(99,102,241,.35) !important;
    border-radius: 16px !important;
    box-shadow:
        0 0 0 1px rgba(59,130,246,.12),
        0 8px 16px rgba(0,0,0,.5),
        0 24px 48px rgba(0,0,0,.6),
        0 0 40px rgba(59,130,246,.08) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 999999 !important;
    overflow: hidden;
    padding: 8px !important;
}

/* Gradient top accent line */
.aap-speed-menu::before {
    content: '';
    display: block;
    height: 2px;
    margin: -8px -8px 8px -8px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,.6), var(--aap-accent), rgba(99,102,241,.6), transparent);
}

.aap-speed.open .aap-speed-menu {
    display: block !important;
    animation: aap-menu-pop .22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes aap-menu-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Speed Items ---- */
.aap-speed-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-height: 40px;
    padding: 9px 14px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 10px !important;
    color: #94a3b8 !important;
    font-size: .88rem !important;
    font-weight: 500 !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: all .15s ease !important;
    position: relative;
}

/* ---- Speed Item Spans ---- */
.aap-sp-num {
    font-weight: 700 !important;
    color: #f8fafc !important;
    font-size: .88rem !important;
}

.aap-sp-tag {
    font-size: .72rem !important;
    color: rgba(148,163,184,.75) !important;
    font-weight: 500 !important;
    margin-left: auto;
}

.aap-speed-item.active .aap-sp-num {
    color: #60a5fa !important;
}

.aap-speed-item.active .aap-sp-tag {
    color: #93c5fd !important;
    font-weight: 700 !important;
}

/* ---- Voice Gender Selector ---- */
.aap-voice {
    position: relative;
    flex: 1 1 auto;
    z-index: 100;
}

.aap-voice-trigger {
    width: 100%;
    min-height: 42px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    background: linear-gradient(135deg, rgba(168,85,247,.18) 0%, rgba(147,51,234,.12) 100%) !important;
    border: 1px solid rgba(168,85,247,.35) !important;
    border-radius: 14px !important;
    color: var(--aap-text) !important;
    font-size: .85rem !important;
    font-weight: 600 !important;
    transition: all .2s ease !important;
    box-shadow: 0 2px 8px rgba(168,85,247,.15) !important;
}

.aap-voice-trigger:hover,
.aap-voice.open .aap-voice-trigger {
    background: linear-gradient(135deg, rgba(168,85,247,.30) 0%, rgba(147,51,234,.22) 100%) !important;
    border-color: rgba(168,85,247,.6) !important;
    box-shadow: 0 0 0 3px rgba(168,85,247,.18), 0 4px 16px rgba(168,85,247,.25) !important;
    transform: translateY(-1px);
}

.aap-voice.open .aap-chevron { transform: rotate(180deg); }

.aap-voice-menu {
    display: none !important;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 150px;
    background: linear-gradient(160deg, #0f172a 0%, #1e112a 100%) !important;
    border: 1px solid rgba(168,85,247,.35) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 40px rgba(0,0,0,.7), 0 0 30px rgba(168,85,247,.15) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999999 !important;
    padding: 8px !important;
}

.aap-voice.open .aap-voice-menu {
    display: block !important;
    animation: aap-menu-pop .22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.aap-voice-item {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 40px;
    padding: 9px 14px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 10px !important;
    color: #e2e8f0 !important;
    font-size: .88rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all .15s ease !important;
}

.aap-voice-item:hover {
    background: rgba(168,85,247,.2) !important;
    color: #ffffff !important;
    transform: translateX(3px) !important;
}

.aap-voice-item.active {
    background: linear-gradient(135deg, rgba(168,85,247,.3) 0%, rgba(147,51,234,.25) 100%) !important;
    color: #f3e8ff !important;
    font-weight: 700 !important;
    border: 1px solid rgba(168,85,247,.4) !important;
}

/* ---- Audio Language Selector ---- */
.aap-lang {
    position: relative;
    flex: 1 1 auto;
    z-index: 100;
}

.aap-lang-trigger {
    width: 100%;
    min-height: 42px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    background: linear-gradient(135deg, rgba(59,130,246,.18) 0%, rgba(37,99,235,.12) 100%) !important;
    border: 1px solid rgba(59,130,246,.35) !important;
    border-radius: 14px !important;
    color: var(--aap-text) !important;
    font-size: .85rem !important;
    font-weight: 600 !important;
    transition: all .2s ease !important;
    box-shadow: 0 2px 8px rgba(59,130,246,.15) !important;
    cursor: pointer !important;
}

.aap-lang-trigger:hover,
.aap-lang.open .aap-lang-trigger {
    background: linear-gradient(135deg, rgba(59,130,246,.30) 0%, rgba(37,99,235,.22) 100%) !important;
    border-color: rgba(59,130,246,.6) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.18), 0 4px 16px rgba(59,130,246,.25) !important;
    transform: translateY(-1px);
}

.aap-lang.open .aap-chevron { transform: rotate(180deg); }

.aap-lang-menu {
    display: none !important;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 160px;
    max-height: 220px;
    overflow-y: auto !important;
    background: linear-gradient(160deg, #0f172a 0%, #16203a 100%) !important;
    border: 1px solid rgba(59,130,246,.35) !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 40px rgba(0,0,0,.75), 0 0 30px rgba(59,130,246,.2) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999999 !important;
    padding: 8px !important;
}

.aap-lang.open .aap-lang-menu {
    display: block !important;
    animation: aap-menu-pop .22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.aap-lang-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 38px;
    padding: 8px 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 10px !important;
    color: #e2e8f0 !important;
    font-size: .88rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all .15s ease !important;
}

.aap-lang-item:hover {
    background: rgba(59,130,246,.2) !important;
    color: #ffffff !important;
    transform: translateX(3px) !important;
}

.aap-lang-item.active {
    background: linear-gradient(135deg, rgba(59,130,246,.3) 0%, rgba(37,99,235,.25) 100%) !important;
    color: #dbeafe !important;
    font-weight: 700 !important;
    border: 1px solid rgba(59,130,246,.4) !important;
}

/* ---- Suspense Mode Button ---- */
.aap-btn-suspense {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 42px;
    padding: 8px 14px !important;
    background: linear-gradient(135deg, rgba(239,68,68,.12) 0%, rgba(185,28,28,.08) 100%) !important;
    border: 1px solid rgba(239, 68, 68, .3) !important;
    border-radius: 14px !important;
    color: #fca5a5 !important;
    font-size: .85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all .2s ease !important;
    box-shadow: 0 2px 8px rgba(239,68,68,.1) !important;
}

.aap-btn-suspense:hover {
    background: linear-gradient(135deg, rgba(239,68,68,.25) 0%, rgba(185,28,28,.18) 100%) !important;
    border-color: rgba(239, 68, 68, .5) !important;
    box-shadow: 0 0 12px rgba(239,68,68,.25) !important;
    transform: translateY(-1px);
}

.aap-btn-suspense.active {
    background: linear-gradient(135deg, rgba(239,68,68,.4) 0%, rgba(185,28,28,.35) 100%) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 0 18px rgba(239,68,68,.5), 0 0 0 2px rgba(239,68,68,.2) !important;
    animation: aap-pulse-glow 2s infinite ease-in-out;
}

@keyframes aap-pulse-glow {
    0%, 100% { box-shadow: 0 0 14px rgba(239,68,68,.4), 0 0 0 2px rgba(239,68,68,.2); }
    50% { box-shadow: 0 0 22px rgba(239,68,68,.7), 0 0 0 3px rgba(239,68,68,.3); }
}

.aap-btn-stop {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    min-height: 42px;
    padding: 8px 16px !important;
    background: var(--aap-surface) !important;
    border: 1px solid var(--aap-border) !important;
    border-radius: 14px !important;
    color: var(--aap-muted) !important;
    font-size: .85rem !important;
    font-weight: 550 !important;
    transition: background .2s, color .2s, border-color .2s;
}

.aap-btn-stop svg { fill: currentColor !important; }

@media (hover: hover) {
    .aap-btn-stop:hover {
        background: rgba(239, 68, 68, .16) !important;
        border-color: rgba(239, 68, 68, .4) !important;
        color: #f87171 !important;
    }
}

.aap-btn-stop:active { transform: scale(.96); }

/* ---------------- Fallback card (in-app browsers) ---------------- */
.aap-fallback {
    grid-area: fallback;
    background: rgba(251, 191, 36, .1);
    border: 1px solid rgba(251, 191, 36, .3);
    border-radius: 14px;
    padding: 13px 14px;
    animation: aap-fade .25s ease;
}

.aap-fallback[hidden] { display: none !important; }

@keyframes aap-fade { from { opacity: 0; transform: translateY(6px); } }

.aap-fallback-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fbbf24;
    margin-bottom: 6px;
}

.aap-fallback-head strong {
    font-size: .88rem;
    line-height: 1.3;
    color: #fde68a;
}

.aap-fb-text {
    margin: 0 0 11px !important;
    font-size: .82rem !important;
    line-height: 1.5 !important;
    color: var(--aap-muted) !important;
}

.aap-fallback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.aap-fb-open,
.aap-fb-copy {
    flex: 1 1 auto;
    min-height: 42px;
    padding: 9px 16px !important;
    border-radius: 12px !important;
    font-size: .85rem !important;
    font-weight: 600 !important;
    border: 1px solid transparent !important;
}

.aap-fb-open {
    background: var(--aap-accent) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px -6px var(--aap-accent) !important;
}

.aap-fb-copy {
    background: var(--aap-surface) !important;
    border-color: var(--aap-border) !important;
    color: var(--aap-text) !important;
}

/* Hide controls that are meaningless once TTS is confirmed unavailable */
.aap-player.aap-unsupported .aap-tools,
.aap-player.aap-unsupported .aap-progress { opacity: .35; pointer-events: none; }

/* ---------------- Sentence highlight inside the article ---------------- */
.aap-reading {
    background: rgba(59, 130, 246, .2) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .2), 0 2px 12px rgba(59, 130, 246, .15) !important;
    border-radius: 6px;
    transition: all .25s ease-in-out;
    scroll-margin-top: 140px;
    scroll-margin-bottom: 140px;
}

/* ---------------- Desktop / tablet ---------------- */
@media (min-width: 620px) {
    .aap-player {
        padding: 20px 24px !important;
        grid-template-columns: 1fr;
        grid-template-areas:
            "top"
            "progress"
            "tools"
            "fallback";
        gap: 16px 18px !important;
    }

    .aap-top { gap: 14px !important; }
    .aap-title { font-size: 1.05rem !important; -webkit-line-clamp: 1; }
    .aap-tools {
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
    }
    .aap-speed,
    .aap-voice,
    .aap-btn-suspense,
    .aap-btn-stop {
        flex: 0 0 auto !important;
    }
    .aap-speed-trigger,
    .aap-voice-trigger {
        min-width: 125px;
    }
    .aap-speed-menu,
    .aap-voice-menu {
        bottom: auto !important;
        top: calc(100% + 8px) !important;
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        width: auto !important;
        min-width: 150px !important;
    }
    .aap-speed.open .aap-speed-menu,
    .aap-voice.open .aap-voice-menu {
        animation: aap-menu-pop-down .2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    .aap-btn-stop span { display: inline; }
}

@keyframes aap-menu-pop-down {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Very small phones: drop the "Speed" word, keep the value */
@media (max-width: 359px) {
    .aap-speed-label { display: none; }
    .aap-btn-stop span { display: none; }
    .aap-btn-stop { flex: none; width: 46px; padding: 8px !important; }
}

/* ---------------- Accessibility ---------------- */
.aap-player button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .aap-player *,
    .aap-player *::before,
    .aap-player *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ---------------- Floating Sticky Mini Player (Bottom Corner) ---------------- */
.aap-sticky-pill[hidden] {
    display: none !important;
}

.aap-sticky-pill:not([hidden]) {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 10px 20px 10px 14px !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(26, 21, 59, 0.94) 100%) !important;
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    border-radius: 50px !important;
    box-shadow:
        0 0 0 1px rgba(168, 85, 247, 0.2),
        0 16px 45px rgba(0, 0, 0, 0.8),
        0 0 35px rgba(168, 85, 247, 0.25) !important;
    backdrop-filter: blur(24px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
    z-index: 999990 !important;
    animation: aap-pill-pop .35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (max-width: 480px) {
    .aap-sticky-pill:not([hidden]) {
        bottom: 16px !important;
        right: 16px !important;
        left: 16px !important;
        justify-content: space-between !important;
    }
}

@keyframes aap-pill-pop {
    from { opacity: 0; transform: translateY(30px) scale(0.88); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Stylish Play Button with Vibrant Neon Gradient & Glow */
.aap-pill-play {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #6366f1 100%) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.45) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.7), 0 0 0 3px rgba(79, 172, 254, 0.25) !important;
    cursor: pointer !important;
    transition: all .2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 0 !important;
    position: relative !important;
}

.aap-sticky-pill.aap-playing .aap-pill-play {
    animation: aap-play-pulse 2s infinite ease-in-out;
}

@keyframes aap-play-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(79, 172, 254, 0.7), 0 0 0 3px rgba(79, 172, 254, 0.25); }
    50%      { box-shadow: 0 6px 28px rgba(0, 242, 254, 0.9), 0 0 0 6px rgba(0, 242, 254, 0.4); }
}

.aap-pill-play:hover {
    transform: scale(1.12) translateY(-1px);
    box-shadow: 0 8px 30px rgba(0, 242, 254, 0.95), 0 0 0 5px rgba(0, 242, 254, 0.45) !important;
}

.aap-pill-play:active { transform: scale(0.94); }

.aap-pill-icon-play,
.aap-pill-icon-pause {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    fill: #ffffff !important;
    margin: 0 auto !important;
}

/* Icon visibility toggle based on .aap-playing state */
.aap-sticky-pill.aap-playing .aap-pill-icon-play,
.aap-playing .aap-pill-icon-play {
    display: none !important;
}

.aap-sticky-pill.aap-playing .aap-pill-icon-pause,
.aap-playing .aap-pill-icon-pause {
    display: block !important;
}

.aap-sticky-pill:not(.aap-playing) .aap-pill-icon-play {
    display: block !important;
}

.aap-sticky-pill:not(.aap-playing) .aap-pill-icon-pause {
    display: none !important;
}

/* Stylish Stop Button with Crimson Glow */
.aap-pill-stop {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(185, 28, 28, 0.2) 100%) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all .2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3) !important;
    padding: 0 !important;
}

.aap-pill-stop svg {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    fill: #fca5a5 !important;
    display: block !important;
    margin: 0 auto !important;
    transition: fill .2s ease !important;
}

.aap-pill-stop:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.45) 0%, rgba(185, 28, 28, 0.35) 100%) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6) !important;
    transform: scale(1.1);
}

.aap-pill-stop:hover svg {
    fill: #ffffff !important;
}

.aap-pill-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    min-width: 120px;
    max-width: 170px;
}

.aap-pill-meta {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
}

.aap-pill-title {
    font-size: .82rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .02em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* Audio Bass Equalizer Bars inside Sticky Pill */
.aap-pill-eq {
    display: flex !important;
    align-items: flex-end !important;
    gap: 3px !important;
    height: 14px;
}

.aap-pill-eq span {
    display: block !important;
    width: 3.5px !important;
    height: 4px;
    background: linear-gradient(180deg, #c084fc 0%, #60a5fa 100%) !important;
    border-radius: 3px !important;
    transition: height .2s ease;
}

.aap-sticky-pill.aap-playing .aap-pill-eq span,
.aap-playing .aap-pill-eq span {
    animation: aap-pill-bass .8s infinite ease-in-out;
}

.aap-sticky-pill.aap-playing .aap-pill-eq span:nth-child(1),
.aap-playing .aap-pill-eq span:nth-child(1) { animation-delay: 0s; }
.aap-sticky-pill.aap-playing .aap-pill-eq span:nth-child(2),
.aap-playing .aap-pill-eq span:nth-child(2) { animation-delay: .2s; }
.aap-sticky-pill.aap-playing .aap-pill-eq span:nth-child(3),
.aap-playing .aap-pill-eq span:nth-child(3) { animation-delay: .4s; }
.aap-sticky-pill.aap-playing .aap-pill-eq span:nth-child(4),
.aap-playing .aap-pill-eq span:nth-child(4) { animation-delay: .15s; }

@keyframes aap-pill-bass {
    0%, 100% { height: 4px; background: #60a5fa; }
    50%      { height: 14px; background: #c084fc; box-shadow: 0 0 8px #c084fc; }
}

.aap-pill-progress {
    height: 5px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.aap-pill-fill {
    height: 100% !important;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6 0%, #c084fc 100%) !important;
    box-shadow: 0 0 10px #c084fc !important;
    transition: width .2s ease !important;
}
