/* ── Video player ────────────────────────────────────────────────────────────── */

.media-player__video {
    display: none;
    position: fixed;

    align-items: center;
    justify-content: center;
    z-index: 200;
    
    inset: 0;
    background: rgba(0,0,0,0.82);
}

.media-player__video .media-player__wrapper {
    position: relative;

    width: 90vw;
    max-width: 1280px;
    max-height: 92vh;

    margin: 4vh auto;
}

.media-player__wrapper video {
    display: block;

    width: 100%;
    height: auto;
    max-height: 88vh;

    border-radius: 10px;

    background: #000;
    object-fit: contain;
    outline: none;
}

/* Modern close button */
.media-player__video .media-player__close {
    position: absolute;
    z-index: 10;

    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;

    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);

    background: rgba(0,0,0,0.35);
    color: #fff;

    font-size: 32px;
    line-height: 40px;
    text-align: center;

    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.media-player__video.show-controls .media-player__close {
    opacity: 1;
    pointer-events: auto;
}

.media-player__close:hover {
    transform: rotate(90deg);
}

/* ── Audio player bar ────────────────────────────────────────────────────────── */

.media-player__audio {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
}

.media-player__audio .media-player__wrapper {
    display: flex;
    position: fixed;

    justify-content: center;

    bottom: 0;
    left: 0;
    right: 0;

    padding: 10px 40px;

    pointer-events: auto;

    background: var(--main-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow: 0 -6px 20px rgba(0,0,0,0.6);
}

.media-player__wrapper audio {
    width: 100%;
    max-width: 860px;
    outline: none;
}

.media-player__audio .media-player__close {
    position: absolute;

    top: 8px;
    right: 12px;
    width: 28px;
    height: 28px;

    border: none;
    border-radius: 50%;

    background: var(--bg-button);
    color: var(--text-primary);

    font-size: 22px;
    line-height: 26px;
    text-align: center;

    cursor: pointer;
    transition: all 0.3s ease;
}

/* ─────── Audio playing overlay ────────────────────────────────────────────── */

.media-player__audio-playing-overlay {
    position: absolute;
    z-index: 2;

    inset: 0;

    opacity: 0;

    transition: opacity 0.5s ease;
    
    pointer-events: none;
}

.audio-playing-overlay__playing-icon {
    display: flex;
    position: absolute;

    left: 10px;
    bottom: 10px;

    align-items: center;
    justify-content: center;
}

body.grid-view.audio-playing .media-player__audio-playing-overlay {
    opacity: 1;
}

.audio-playing-overlay__playing-icon svg {
    width: 60px;
    height: 60px;

    opacity: 0.9;
}

body.grid-view.audio-playing .audio-playing-overlay__playing-icon svg {
    animation: media-result-audio-player-spin 2.4s linear infinite;
    animation-play-state: running;
}

body.grid-view.is-audio-paused .audio-playing-overlay__playing-icon svg {
    animation-play-state: paused;
}

@keyframes media-result-audio-player-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.grid-view.audio-playing .audio-playing-overlay__playing-icon svg {
        animation: none;
    }
}

.audio-playing-overlay__play-icon,
.audio-playing-overlay__pause-icon {
    display: flex;
    position: absolute;

    width: 20%;
    aspect-ratio: 1;

    inset: 0;
    margin: auto;

    align-items: center;
    justify-content: center;

    padding: 4%;
    box-sizing: border-box;

    border-radius: 50%;
    background: rgb(0 0 0 / 55%);

    opacity: 0;
    transform: scale(0);

    transition:
        opacity 0.5s ease,
        transform 0.5s ease;

    backdrop-filter: blur(2px);
}

.audio-playing-overlay__play-icon svg,
.audio-playing-overlay__pause-icon svg {
    width: 100%;
    height: 100%;

    color: rgb(255 255 255 / 85%);
    filter: drop-shadow(0 1px 3px rgb(0 0 0 / 35%));
}

body.grid-view.is-audio-paused .audio-playing-overlay__play-icon {
    opacity: 1;
    transform: scale(1);
}