/* ==========================================================================
   Islam92 player
   - slim bottom bar: cover, title, play/pause, download and a pull-up arrow
   - full player that opens from the bar
   - audio cards and rows: one tap plays
   Loaded after styles.css, so these rules win over the old player styles.
   ========================================================================== */

/* ---------- room for the bar ---------- */
.pb-show-player {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

body.pb-fp-open {
    overflow: hidden;
}

/* ---------- bottom bar ---------- */
#pb_player.pb-mini {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    min-height: 68px;
    padding: 12px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 -8px 28px rgba(16, 19, 22, .14);
    color: var(--color-grey-700);
    transform: translate3d(0, 110%, 0);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}

.pb-show-player #pb_player.pb-mini {
    transform: none;
}

.pb-theme-dark #pb_player.pb-mini {
    background: rgba(34, 39, 46, .96);
    color: #fff;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .5);
}

/* small handle that tells the user the bar can be pulled up */
#pb_player .pb-mini__grab {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 4px;
    background: currentColor;
    opacity: .18;
    pointer-events: none;
}

/* seek line along the top edge of the bar */
#pb_player .pb-mini__seek {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 16px;
    z-index: 2;
}

#pb_player .pb-mini__seek:before {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    top: 0;
    height: 3px;
    border-radius: 3px;
    background: currentColor;
    opacity: .12;
}

#pb_player .pb-mini__seek input[type=range] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 16px;
    margin: 0;
    padding: 0;
    z-index: 3;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

#pb_player .pb-mini__seek progress {
    position: absolute;
    left: 16px;
    top: 0;
    width: calc(100% - 32px);
    height: 3px;
    border: 0;
    border-radius: 3px;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

#pb_player .pb-mini__seek progress::-webkit-progress-bar {
    background: transparent;
}

#pb_player .pb-mini__seek progress::-webkit-progress-value {
    background: var(--theme-primary-color);
    border-radius: 3px;
    transition: width .2s linear;
}

#pb_player .pb-mini__seek progress::-moz-progress-bar {
    background: var(--theme-primary-color);
    border-radius: 3px;
}

#pb_player .pb-mini__seek .pb-mini__buffered::-webkit-progress-value {
    background: rgba(128, 138, 148, .35);
}

#pb_player .pb-mini__seek .pb-mini__buffered::-moz-progress-bar {
    background: rgba(128, 138, 148, .35);
}

#pb_player .pb-mini__seek .pb-mini__played {
    z-index: 1;
}

/* cover + title (tap to open the full player) */
#pb_player.pb-mini .pb-mini__open {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#pb_player .pb-mini__cover {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(120, 130, 140, .2);
}

#pb_player .pb-mini__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

#pb_player .pb-mini__title,
#pb_player .pb-mini__artist {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#pb_player .pb-mini__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-grey-700);
}

.pb-theme-dark #pb_player .pb-mini__title {
    color: #fff;
}

#pb_player .pb-mini__artist {
    font-size: 12px;
    opacity: .7;
}

/* buttons */
#pb_player .pb-mini__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

#pb_player.pb-mini .pb-mini__btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, transform .15s;
    -webkit-appearance: none;
    appearance: none;
}

#pb_player.pb-mini .pb-mini__btn:hover {
    background: rgba(120, 130, 140, .16);
}

#pb_player.pb-mini .pb-mini__btn:active {
    transform: scale(.93);
}

#pb_player.pb-mini .pb-mini__btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

#pb_player.pb-mini .pb-mini__play {
    width: 44px;
    height: 44px;
    background: var(--theme-primary-color);
    color: #fff;
    box-shadow: 0 6px 16px rgba(233, 30, 99, .35);
}

#pb_player.pb-mini .pb-mini__play:hover {
    background: var(--theme-primary-color);
    filter: brightness(1.08);
}

#pb_player.pb-mini .pb-mini__btn.is-busy {
    opacity: .5;
    pointer-events: none;
}

/* the old stylesheet greys the play button while paused (with !important): keep ours pink */
#pb_player.pb-mini button.pb-mini__play.amplitude-play-pause,
#pb_player.pb-mini button.pb-mini__play.amplitude-play-pause:hover,
#pb_fullplayer button.pb-fp__play.amplitude-play-pause,
#pb_fullplayer button.pb-fp__play.amplitude-play-pause:hover {
    background: var(--theme-primary-color) !important;
    color: #fff !important;
    border-radius: 50% !important;
}

/* previous / next only where there is room */
#pb_player.pb-mini .pb-mini__btn--side {
    display: none;
}

@media (min-width: 768px) {
    #pb_player.pb-mini .pb-mini__btn--side {
        display: inline-flex;
    }

    #pb_player.pb-mini {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* the queue panel sits above the new bar */
#pb_playlist {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 520px) {
    #pb_playlist {
        width: calc(100% - 24px);
        right: 12px;
        max-height: calc(100vh - 170px);
    }
}

/* ==========================================================================
   Full player
   ========================================================================== */
#pb_fullplayer {
    position: fixed;
    inset: 0;
    z-index: 1040; /* above the bar, below Bootstrap popups (share / download popup) */
    display: flex;
    flex-direction: column;
    color: #fff;
    background: #14171c;
    transform: translate3d(0, 100%, 0);
    visibility: hidden;
    overflow: hidden;
    transition: transform .38s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .38s;
}

#pb_fullplayer.is-open {
    transform: none;
    visibility: visible;
    transition: transform .38s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}

#pb_fullplayer .pb-fp__bg {
    position: absolute;
    inset: -50px;
    background-size: cover;
    background-position: center;
    filter: blur(48px) saturate(1.35);
    opacity: .6;
    transform: scale(1.1);
}

#pb_fullplayer .pb-fp__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 12, 16, .35) 0%, rgba(10, 12, 16, .88) 100%);
}

#pb_fullplayer .pb-fp__inner {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 22px calc(20px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#pb_fullplayer button,
#pb_fullplayer a {
    -webkit-tap-highlight-color: transparent;
}

#pb_fullplayer .pb-fp__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}

#pb_fullplayer .pb-fp__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .75;
}

#pb_fullplayer .pb-fp__icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s, transform .15s;
}

#pb_fullplayer .pb-fp__icon:hover {
    background: rgba(255, 255, 255, .2);
}

#pb_fullplayer .pb-fp__icon:active {
    transform: scale(.94);
}

#pb_fullplayer .pb-fp__icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

#pb_fullplayer .pb-fp__art {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0 22px;
}

#pb_fullplayer .pb-fp__art img {
    width: 100%;
    max-width: min(100%, 50vh);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 22px;
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 26px 60px rgba(0, 0, 0, .5);
}

#pb_fullplayer .pb-fp__meta {
    flex: 0 0 auto;
    text-align: center;
}

#pb_fullplayer .pb-fp__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

#pb_fullplayer .pb-fp__artist {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: rgba(255, 255, 255, .72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* seek */
#pb_fullplayer .pb-fp__seek {
    position: relative;
    flex: 0 0 auto;
    height: 22px;
    margin-top: 18px;
}

#pb_fullplayer .pb-fp__track,
#pb_fullplayer .pb-fp__seek progress {
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 4px;
    margin-top: -2px;
    border: 0;
    border-radius: 4px;
    overflow: hidden;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

#pb_fullplayer .pb-fp__track {
    background: rgba(255, 255, 255, .22);
}

#pb_fullplayer .pb-fp__seek progress {
    background: transparent;
}

#pb_fullplayer .pb-fp__seek progress::-webkit-progress-bar {
    background: transparent;
}

#pb_fullplayer .pb-fp__seek progress::-webkit-progress-value {
    border-radius: 4px;
    transition: width .2s linear;
}

#pb_fullplayer .pb-fp__buffered::-webkit-progress-value {
    background: rgba(255, 255, 255, .28);
}

#pb_fullplayer .pb-fp__buffered::-moz-progress-bar {
    background: rgba(255, 255, 255, .28);
}

#pb_fullplayer .pb-fp__played::-webkit-progress-value {
    background: var(--theme-primary-color);
}

#pb_fullplayer .pb-fp__played::-moz-progress-bar {
    background: var(--theme-primary-color);
}

#pb_fullplayer .pb-fp__seek input[type=range] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 22px;
    margin: 0;
    padding: 0;
    z-index: 3;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#pb_fullplayer .pb-fp__seek input[type=range]::-webkit-slider-runnable-track {
    background: transparent;
    height: 22px;
}

#pb_fullplayer .pb-fp__seek input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: 4px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}

#pb_fullplayer .pb-fp__seek input[type=range]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}

#pb_fullplayer .pb-fp__times {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, .7);
}

/* controls */
#pb_fullplayer .pb-fp__controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

#pb_fullplayer .pb-fp__ctl {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s, color .15s, opacity .15s;
}

#pb_fullplayer .pb-fp__ctl:active {
    transform: scale(.92);
}

#pb_fullplayer .pb-fp__ctl svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

#pb_fullplayer .pb-fp__ctl--minor {
    opacity: .6;
}

#pb_fullplayer .pb-fp__ctl--minor svg {
    width: 22px;
    height: 22px;
}

#pb_fullplayer .amplitude-shuffle.amplitude-shuffled-on,
#pb_fullplayer .amplitude-repeat.amplitude-repeat-on {
    color: var(--theme-primary-color);
    opacity: 1;
}

#pb_fullplayer .pb-fp__play {
    width: 68px;
    height: 68px;
    background: var(--theme-primary-color);
    box-shadow: 0 10px 28px rgba(233, 30, 99, .45);
}

#pb_fullplayer .pb-fp__play svg {
    width: 30px;
    height: 30px;
}

/* play / pause icon swap (same state classes the player library sets) */
#pb_fullplayer .pb-btn-player__pause,
#pb_fullplayer .pb-btn-player__muted,
#pb_fullplayer .amplitude-playing .pb-btn-player__play,
#pb_fullplayer .amplitude-muted .pb-btn-player__volume {
    display: none;
}

#pb_fullplayer .amplitude-paused .pb-btn-player__play,
#pb_fullplayer .amplitude-playing .pb-btn-player__pause,
#pb_fullplayer .amplitude-muted .pb-btn-player__muted {
    display: block;
}

/* action row: download, favourite, share, lyrics */
#pb_fullplayer .pb-fp__actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-around;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

#pb_fullplayer .pb-fp__act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
    padding: 6px 4px;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, .88);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s, transform .15s;
}

#pb_fullplayer .pb-fp__act:hover {
    color: #fff;
}

#pb_fullplayer .pb-fp__act:active {
    transform: scale(.94);
}

#pb_fullplayer .pb-fp__act svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#pb_fullplayer .pb-fp__act.is-busy {
    opacity: .5;
    pointer-events: none;
}

#pb_fullplayer .pb-fp__act.pb-btn-fav.active {
    color: var(--theme-heart-color);
}

#pb_fullplayer .pb-fp__act.pb-btn-fav.active svg {
    fill: var(--theme-heart-color);
    stroke: var(--theme-heart-color);
}

/* volume (mouse devices only) */
#pb_fullplayer .pb-fp__volume {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

@media (hover: hover) and (min-width: 768px) {
    #pb_fullplayer .pb-fp__volume {
        display: flex;
    }
}

#pb_fullplayer .pb-fp__volume .pb-fp__ctl {
    width: 36px;
    height: 36px;
}

#pb_fullplayer .pb-fp__volume .pb-fp__ctl svg {
    width: 20px;
    height: 20px;
}

#pb_fullplayer .pb-fp__volume input[type=range] {
    flex: 1 1 auto;
    min-width: 0;
    height: 4px;
    margin: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, .3);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#pb_fullplayer .pb-fp__volume input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: #fff;
}

#pb_fullplayer .pb-fp__volume input[type=range]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: #fff;
}

/* short phones */
@media (max-height: 640px) {
    #pb_fullplayer .pb-fp__art {
        padding: 8px 0;
    }

    #pb_fullplayer .pb-fp__art img {
        max-width: 38vh;
    }

    #pb_fullplayer .pb-fp__title {
        font-size: 18px;
    }
}

/* ==========================================================================
   One tap plays: cards and rows
   ========================================================================== */
.pb-card[data-audio-id] .pb-card__image,
.pb-card[data-audio-id] .pb-card__title {
    cursor: pointer;
}

/* touch screens have no hover: always show the play button on audio cards */
@media (hover: none) {
    .pb-card .pb-card__image .pb-btn-play {
        visibility: visible;
        opacity: 1;
    }
}

.pb-collection-list .pb-collection-list__item[data-audio-id] {
    cursor: pointer;
    border-radius: 12px;
    transition: background-color .15s;
}

.pb-collection-list .pb-collection-list__item[data-audio-id]:hover {
    background-color: rgba(120, 130, 140, .1);
}

.pb-collection-list .pb-collection-list__cover {
    cursor: pointer;
}

/* the audio that is playing right now */
.pb-collection-list .pb-collection-list__item:has(.pb-btn-play.active) .pb-collection-list__cover__title,
.pb-card:has(.pb-btn-play.active) .pb-card__title {
    color: var(--theme-primary-color);
}

@media (prefers-reduced-motion: reduce) {
    #pb_player.pb-mini,
    #pb_fullplayer,
    #pb_fullplayer.is-open,
    #pb_player .pb-mini__seek progress::-webkit-progress-value,
    #pb_fullplayer .pb-fp__seek progress::-webkit-progress-value {
        transition: none;
    }
}
