/*
 * Estrutura comum das janelas de pop-up.
 *
 * Diferente da barra, aqui a pagina e a janela inteira: ela abre no tamanho do
 * catalogo (600x230 e 500x170) e nao divide espaco com o site do cliente. Por
 * isso a capa vem grande e o nome da musica ganha uma linha so para ele.
 */

:root {
    --pp-bg: #ffffff;
    --pp-fg: #14161a;
    --pp-muted: #6b7280;
    --pp-accent: #178d72;
    --pp-accent-fg: #ffffff;
    --pp-line: #e2e6ea;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--pp-fg);
    background: var(--pp-bg);
    -webkit-font-smoothing: antialiased;
}

.pp {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
    padding: 20px;
}

/* ---------- capa ---------- */

.pp__art { flex-shrink: 0; }

.pp__disc {
    position: relative;
    display: grid;
    place-items: center;
    width: 116px;
    height: 116px;
    overflow: hidden;
    color: var(--pp-muted);
    border-radius: 8px;
    background: var(--pp-line);
}

.pp__disc img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pp__disc img[hidden] { display: none; }
.pp__disc svg { width: 34px; height: 34px; }
.pp.has-cover .pp__disc svg { display: none; }

/* ---------- texto ---------- */

.pp__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.pp__label {
    font-size: 13px;
    line-height: 1.2;
    color: var(--pp-muted);
}

/* a tag antiga e a que entra e sai na hora certa; o css cuida do esmaecido */
.pp__song {
    width: 100%;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}

/* ---------- controles ---------- */

.pp__row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.pp__play {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    color: var(--pp-accent-fg);
    border: 0;
    border-radius: 50%;
    background: var(--pp-accent);
    cursor: pointer;
    transition: transform .12s ease, filter .12s ease;
}

.pp__play:hover { filter: brightness(1.07); }
.pp__play:active { transform: scale(.95); }
.pp__play:focus-visible { outline: 2px solid var(--pp-accent); outline-offset: 3px; }
.pp__play svg { width: 22px; height: 22px; }
.pp__play svg path { stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }

.pp__play .pl__ico-stop,
.pp.is-playing .pp__play .pl__ico-play { display: none; }
.pp.is-playing .pp__play .pl__ico-stop { display: block; }

.pp.is-loading .pp__play svg { display: none; }

.pp.is-loading .pp__play::after {
    content: "";
    width: 22px;
    height: 22px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: pp-spin .7s linear infinite;
}

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

.pp__ico {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--pp-muted);
    border: 0;
    border-radius: 8px;
    background: none;
    cursor: pointer;
}

.pp__ico[hidden] { display: none; }
.pp__ico:hover { color: var(--pp-fg); }
.pp__ico:focus-visible { outline: 2px solid var(--pp-accent); outline-offset: 1px; }
.pp__ico svg { width: 19px; height: 19px; }

.pp__ico .pl__ico-mute,
.pp.is-mute .pp__ico .pl__ico-sound { display: none; }
.pp.is-mute .pp__ico .pl__ico-mute { display: block; }

.pp.is-casting [data-cast] { color: var(--pp-accent); }

.pp__range {
    --vol: 100%;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 190px;
    height: 18px;
    margin: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.pp__range:focus-visible { outline: 2px solid var(--pp-accent); outline-offset: 4px; }

.pp__range::-webkit-slider-runnable-track {
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--pp-accent) var(--vol), var(--pp-line) var(--vol));
}

.pp__range::-moz-range-track { height: 7px; border-radius: 999px; background: var(--pp-line); }
.pp__range::-moz-range-progress { height: 7px; border-radius: 999px; background: var(--pp-accent); }

.pp__range::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
    margin-top: -4px;
    border: 0;
    border-radius: 50%;
    background: var(--pp-accent);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .22), 0 1px 2px rgba(0, 0, 0, .22);
    -webkit-appearance: none;
    appearance: none;
}

.pp__range::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border: 0;
    border-radius: 50%;
    background: var(--pp-accent);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .22), 0 1px 2px rgba(0, 0, 0, .22);
}
