@use 'mixins' as *;

.chapterThumbTextContainer,
.videoOsdBottom {
    user-select: none;
}

.videoOsdBottom {
    bottom: 0;
    left: 0;
    right: 0;
    position: fixed;
    background: linear-gradient(0deg, rgba(16, 16, 16, 0.75) 0%, rgba(16, 16, 16, 0) 100%);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-top: 7.5em;
    display: flex;
    flex-direction: row;
    justify-content: center;
    will-change: opacity;
    transition: opacity 0.3s ease-out;
    color: #fff;
    user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;

    @include conditional-max(padding-bottom, 1.75em, env(safe-area-inset-bottom));
}

.skinHeader-withBackground.osdHeader {
    transition: opacity 0.3s ease-out;
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(16, 16, 16, 0.75) 0%, rgba(16, 16, 16, 0) 100%);
    backdrop-filter: none;
    color: #eee;
    height: 7.5em;
    pointer-events: none;
}

.osdHeader-hidden {
    opacity: 0;
}

.osdHeader .headerTop {
    pointer-events: all;
    max-height: 3.5em;
}

.osdHeader .headerButton:not(.headerBackButton):not(.headerCastButton):not(.headerSyncButton) {
    display: none;
}

.chapterThumbContainer {
    box-shadow: 0 0 1.9vh #000;
    flex-grow: 1;
}

.chapterBubblePosition {
    position: relative !important;
}

.chapterThumb {
    background-position: center center;
    background-size: contain;
    background-repeat: no-repeat;
    border: 0;
    height: 20vh;
    min-width: 20vh;
}

@media all and (orientation: portrait) {
    .chapterThumb {
        height: 30vw;
        min-width: 30vw;
    }
}

@media all and (max-height: 50em) and (orientation: landscape) {
    .chapterThumb {
        height: 30vh;
        min-width: 30vh;
    }
}

.chapterThumbTextContainer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: none;
    padding: 0.25em 0.5em;
    user-select: none;
    min-width: fit-content;
}

.chapterThumbText {
    padding: 0.25em 0;
    margin: 0;
    opacity: 1;
    color: #fff;
    text-shadow: 0 0 25px #000, 0 0 6px #000;
    white-space: nowrap;
    min-width: fit-content;
}

.chapterThumbText-dim {
    opacity: 0.9;
}

.videoOsdBottom-hidden {
    opacity: 0;
}

.osdControls {
    pointer-events: all;
    flex-grow: 1;
    padding: 0 0.8em;
}

.videoOsdBottom .buttons {
    padding: 0.25em 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    [dir="rtl"] & {
        flex-direction: row-reverse;
    }
}

.osdVolumeSliderContainer {
    width: 9em;
    flex-grow: 1;
}

.osdMediaInfo,
.volumeButtons {
    display: flex;
    align-items: center;
}

.volumeButtons {
    margin: 0 1em 0 0.29em;
    display: flex;
    align-items: center;
}

.osdTimeText {
    margin-left: 1em;
    margin-right: auto;
    user-select: none;
}

.osdTitle,
.osdTitleSmall {
    margin: 0 1em 0 0;
}

.osdMediaInfo {
    display: flex;
    align-items: center;
}

.osdSecondaryMediaInfo {
    padding-left: 0.6em !important;
}

.osdTextContainer {
    display: flex;
    align-items: center;
    user-select: none;
    margin-bottom: 0.7em;
    padding-left: 0.5em;
}

.osdMainTextContainer {
    align-items: baseline;
}

.osdMediaStatus {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.osdMediaStatus span:first-child {
    margin-right: 0.125rem;
}

.osdMediaStatus .animate {
    animation: spin-clockwise 4s linear infinite;
}

@media all and (max-width: 30em) {
    .btnUserRating,
    .osdMediaInfo,
    .osdPoster {
        display: none !important;
    }
}

@media all and (max-width: 33.75em) {
    .videoOsdBottom .paper-icon-button-light {
        margin: 0;
    }
}

@media all and (max-width: 43em) {
    .videoOsdBottom .volumeButtons,
    .osdMediaStatus span {
        display: none !important;
    }
}

@media all and (max-width: 50em) {
    .videoOsdBottom .btnFastForward,
    .videoOsdBottom .btnRewind {
        display: none !important;
    }
}

@media all and (max-width: 75em) {
    .videoOsdBottom .endsAtText {
        display: none !important;
    }
}

.syncPlayContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    pointer-events: none;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
}

.primary-icon {
    position: absolute;
    font-size: 64px;
    align-self: center;
}

.primary-icon.spin {
    font-size: 76px !important;
    animation: spin-counterclockwise 2s linear infinite;
}

.secondary-icon {
    position: absolute;
    font-size: 24px;
}

.secondary-icon.centered {
    font-size: 28px !important;
    align-self: center;
}

.secondary-icon.shifted {
    right: 0;
    bottom: 0;
    font-size: 52px;
}

.syncPlayIconCircle {
    position: relative;
    visibility: hidden;
    display: flex;
    justify-content: center;

    border-radius: 50%;
    margin: 60px;
    height: 96px;
    width: 96px;

    color: rgba(0, 164, 220, 0);
    background: rgba(0, 164, 220, 0);
    box-shadow: 0 0 0 0 rgba(0, 164, 220, 0);
    transform: scale(1);
}

.syncPlayIconCircle.oneShotPulse {
    animation: pulse 1.5s 1;
}

.syncPlayIconCircle.infinitePulse {
    animation: infinite-pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        color: rgba(0, 164, 220, 0.7);
        background: rgba(0, 164, 220, 0.3);
        box-shadow: 0 0 0 0 rgba(0, 164, 220, 0.3);
    }

    70% {
        transform: scale(1);
        color: rgba(0, 164, 220, 0);
        background: rgba(0, 164, 220, 0);
        box-shadow: 0 0 0 60px rgba(0, 164, 220, 0);
    }

    100% {
        transform: scale(0.95);
        color: rgba(0, 164, 220, 0);
        background: rgba(0, 164, 220, 0);
        box-shadow: 0 0 0 0 rgba(0, 164, 220, 0);
    }
}

@keyframes infinite-pulse {
    0% {
        transform: scale(0.95);
        color: rgba(0, 164, 220, 0.7);
        background: rgba(0, 164, 220, 0.3);
        box-shadow: 0 0 0 0 rgba(0, 164, 220, 0.3);
    }

    70% {
        transform: scale(1);
        color: rgba(0, 164, 220, 0.6);
        background: rgba(0, 164, 220, 0);
        box-shadow: 0 0 0 60px rgba(0, 164, 220, 0);
    }

    100% {
        transform: scale(0.95);
        color: rgba(0, 164, 220, 0.7);
        background: rgba(0, 164, 220, 0.3);
        box-shadow: 0 0 0 0 rgba(0, 164, 220, 0);
    }
}

@keyframes spin-counterclockwise {
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes spin-clockwise {
    100% {
        transform: rotate(360deg);
    }
}
