/* Transport buttons, volume bars and the playback option buttons. */

.transport {
    width: min(100%, 40rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1rem, 3vw, 2rem);
}

.transport__btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 3.5rem;
    aspect-ratio: 1;
    padding: 0;
    border: 2px ridge #000;
    border-radius: 50%;
    background: #000;
    transition: background 100ms ease;

    &::before {
        content: "";
        width: 0;
        height: 0;
        border-style: solid;
        border-color: transparent transparent transparent rgb(255 255 255 / 0.75);
        border-width: 0.8rem 0 0.8rem 1.1rem;
        translate: 0.15rem 0;
    }

    &:hover {
        background: radial-gradient(circle, rgb(110 44 0) 0%, #000 55%);

        &::before {
            border-left-color: #fff;
        }
    }
}

.transport__btn--prev::before,
.transport__btn--next::before {
    box-shadow: none;
    border-width: 0.65rem 0 0.65rem 0.85rem;
    filter: drop-shadow(0.55rem 0 0 rgb(255 255 255 / 0.75));
    translate: -0.2rem 0;
}

.transport__btn--prev::before {
    scale: -1 1;
    translate: 0.2rem 0;
}

.transport__btn--play {
    width: 6.5rem;

    &::before {
        border-width: 1.9rem 0 1.9rem 3rem;
        translate: 0.4rem 0;
    }

    &:hover {
        background: radial-gradient(circle, rgb(0 10 75) 0%, #000 60%);
    }

    &.is-playing::before {
        width: 2.6rem;
        height: 3.2rem;
        border-width: 0;
        border-inline: 0.9rem solid rgb(255 255 255 / 0.85);
        translate: 0;
    }
}

.transport__share {
    display: grid;
    place-items: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 2px ridge #000;
    border-radius: 50%;
    color: rgb(255 255 255 / 0.8);
    background: #000;

    &:hover {
        color: #fff;
        background: radial-gradient(circle, rgb(110 44 0) 0%, #000 55%);
    }
}

.volume {
    grid-area: volume;
    position: relative;
    min-height: 8rem;

    &.is-muted .volume__bar:last-child {
        fill: #a00;
    }
}

.volume__bars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.volume__bar.is-off {
    fill: #3e3e3e;
}

/* Vertical native slider over the bars: click, drag, keyboard. */
.volume__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    writing-mode: vertical-lr;
    direction: rtl;
}

.volume:has(.volume__input:focus-visible) {
    outline: 3px solid var(--kp-focus);
    outline-offset: 2px;
}

.viz-switch {
    display: grid;
    gap: 0.25rem;
    width: 8.5rem;
    font-family: var(--kp-font-ui);
    font-size: 0.75rem;
}

.viz-switch__label {
    color: #6dbdff;
    text-align: center;
}

.viz-switch__row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 999px;
    background: #000;
}

.viz-switch__step {
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: rgb(255 255 255 / 0.8);
    font-family: system-ui, sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    background: none;

    &:hover {
        color: #fff;
        background: #092a8e;
    }
}

.viz-switch__name {
    overflow: hidden;
    color: var(--kp-mint);
    font-weight: 700;
    text-align: center;
    white-space: nowrap;

    .is-off & {
        color: var(--kp-text-muted);
    }
}

.viz-switch__off {
    justify-self: center;
    min-height: 1.75rem;
    padding: 0 0.7rem;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 999px;
    color: var(--kp-text-muted);
    background: #000;

    &:hover {
        color: #fff;
    }

    &[aria-pressed="true"] {
        border-color: goldenrod;
        color: #fff;
        background: #5a0000;
    }
}

.modes {
    grid-area: modes;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: end;
    gap: 0.35rem;
}

.mode {
    width: 2.75rem;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: #000 center / 70% no-repeat;
    transition: box-shadow 250ms ease-out;

    &:hover {
        border-color: goldenrod;
        background-color: #092a8e;
        box-shadow: 0 0 8px 4px rgb(255 255 255 / 0.6);
    }

    &[aria-pressed="true"] {
        border: 2px ridge goldenrod;
        background-color: #023f00;
        box-shadow: 0 0 3px 1px rgb(255 136 0 / 0.58);
    }
}

.mode--tooltips { background-image: url("../../images/player/tooltip.png"); }
.mode--repeat-one { background-image: url("../../images/player/repeat1.png"); }
.mode--repeat-all { background-image: url("../../images/player/repeatAll.png"); }
.mode--shuffle { background-image: url("../../images/player/shuffle.png"); }

.mode--share {
    display: grid;
    place-items: center;
    color: rgb(255 255 255 / 0.8);

    &:hover {
        color: #fff;
    }
}

@media (orientation: portrait), (max-width: 56rem) {
    .transport__btn {
        width: 3rem;
    }

    .transport__btn--play {
        width: 4.75rem;

        &::before {
            border-width: 1.4rem 0 1.4rem 2.2rem;
        }

        &.is-playing::before {
            width: 1.9rem;
            height: 2.4rem;
            border-inline-width: 0.65rem;
        }
    }

    .volume {
        min-height: 6.5rem;
    }

    .viz-switch {
        width: 7.5rem;
    }

    .modes {
        flex-direction: row;
        justify-content: center;
    }
}
