/* 📻 O CARTÃO DA RÁDIO NO BiP (03/10/26, ordem do dono: *"faça um lindo card... com um botão play"*).
   Usado no feed, na thread, no perfil, na prévia do compositor, na janela de compartilhar e na página
   256bip.com/radio/<uuid>. O cartão é escuro nos dois temas de propósito: ele é uma PINTURA (a rádio retrô com as
   ondas em neon, assets/img/radio-cartao.webp, feita no Higgsfield), e o texto branco vive em cima do véu.
   Quem monta: assets/js/bip-radio.js. */

.bip-radio {
    --bip-radio-azul: #4070B0;
    --bip-radio-violeta: #7B5CFF;
    --bip-radio-rosa: #E24FB2;
    position: relative;
    isolation: isolate;
    display: block;
    margin-top: 10px;
    min-height: 196px;
    border-radius: 18px;
    overflow: hidden;
    background: #0B0D2A;
    color: #FFFFFF;
    box-shadow: 0 10px 30px -14px rgba(64, 40, 160, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

.bip-radio__arte {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 78% 50%;
    z-index: -2;
    transform: scale(1.02);
    transition: transform 6s ease;
}

.bip-radio.is-playing .bip-radio__arte {
    transform: scale(1.08);
}

.bip-radio__veu {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(7, 9, 34, 0.94) 0%, rgba(7, 9, 34, 0.82) 38%, rgba(7, 9, 34, 0.25) 72%, rgba(7, 9, 34, 0.05) 100%),
        linear-gradient(0deg, rgba(7, 9, 34, 0.55) 0%, rgba(7, 9, 34, 0) 45%);
}

.bip-radio__corpo {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 196px;
    padding: 16px 18px 14px;
    max-width: 74%;
    box-sizing: border-box;
}

.bip-radio__selo {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bip-radio__ponto {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FF4D6D;
    box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6);
    animation: bip-radio-pulso 1.8s ease-out infinite;
}

.bip-radio.is-off .bip-radio__ponto {
    background: #9AA0AE;
    animation: none;
}

@keyframes bip-radio-pulso {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(255, 77, 109, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); }
}

.bip-radio__linha {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bip-radio__logo {
    position: relative;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 15px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--bip-radio-azul), var(--bip-radio-violeta) 60%, var(--bip-radio-rosa));
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.bip-radio__logo.tem-logo {
    background: #FFFFFF;
}

.bip-radio__logo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
    background: #FFFFFF;
}

.bip-radio__iniciais {
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
}

.bip-radio__textos {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.bip-radio__nome {
    font-size: 17px;
    line-height: 1.22;
    font-weight: 800;
    color: #FFFFFF;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.bip-radio.is-carregando .bip-radio__nome {
    opacity: 0.7;
}

.bip-radio__local {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bip-radio__local:empty,
.bip-radio__tags:empty {
    display: none;
}

.bip-radio__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bip-radio__tags span {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.bip-radio__acoes {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.bip-radio__play {
    position: relative;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--bip-radio-azul) 0%, var(--bip-radio-violeta) 55%, var(--bip-radio-rosa) 100%);
    box-shadow: 0 8px 22px -6px rgba(123, 92, 255, 0.85), 0 0 0 3px rgba(255, 255, 255, 0.22);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.bip-radio__play:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 28px -6px rgba(123, 92, 255, 1), 0 0 0 3px rgba(255, 255, 255, 0.32);
}

.bip-radio__play:active {
    transform: scale(0.96);
}

.bip-radio__play:focus-visible,
.bip-radio__icone:focus-visible {
    outline: 3px solid #FFFFFF;
    outline-offset: 2px;
}

/* ▶ desenhado em CSS (sem fonte de ícone): o triângulo, e as duas barras do ⏸ quando toca. */
.bip-radio__tri {
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #FFFFFF;
}

.bip-radio.is-playing .bip-radio__tri {
    margin-left: 0;
    width: 16px;
    height: 18px;
    border: 0;
    background: linear-gradient(90deg, #FFFFFF 0 5px, transparent 5px 11px, #FFFFFF 11px 16px);
}

.bip-radio.is-loading .bip-radio__play::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #FFFFFF;
    animation: bip-radio-gira 0.9s linear infinite;
}

@keyframes bip-radio-gira {
    to { transform: rotate(360deg); }
}

.bip-radio.is-off .bip-radio__play {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: none;
    cursor: not-allowed;
}

.bip-radio__dica {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.bip-radio__eq {
    display: none;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
}

.bip-radio.is-playing .bip-radio__eq {
    display: inline-flex;
}

.bip-radio__eq i {
    width: 3px;
    border-radius: 2px;
    background: #FFFFFF;
    animation: bip-radio-eq 0.9s ease-in-out infinite;
}

.bip-radio__eq i:nth-child(2) { animation-delay: -0.3s; }
.bip-radio__eq i:nth-child(3) { animation-delay: -0.6s; }
.bip-radio__eq i:nth-child(4) { animation-delay: -0.15s; }

@keyframes bip-radio-eq {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

.bip-radio__espaco {
    flex: 1 1 auto;
}

.bip-radio__icone {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #FFFFFF;
    display: grid;
    place-items: center;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.bip-radio__icone:hover {
    background: rgba(255, 255, 255, 0.22);
}

.bip-radio__icone.is-on {
    color: #FF5C85;
}

.bip-radio__icone[disabled] {
    opacity: 0.6;
}

/* Compacto: prévia do compositor e janela de compartilhar. */
.bip-radio--compacto,
.bip-radio--compacto .bip-radio__corpo {
    min-height: 150px;
}

.bip-radio--compacto .bip-radio__corpo {
    padding: 12px 14px;
    gap: 8px;
}

.bip-radio--compacto .bip-radio__logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
}

.bip-radio--compacto .bip-radio__nome {
    font-size: 15px;
}

.bip-radio--compacto .bip-radio__play {
    width: 44px;
    height: 44px;
}

.bip-radio--compacto [data-radio-share] {
    display: none;
}

/* Grande: a página do link. */
.bip-radio--grande,
.bip-radio--grande .bip-radio__corpo {
    min-height: 300px;
}

.bip-radio--grande {
    margin-top: 0;
    border-radius: 24px;
}

.bip-radio--grande .bip-radio__corpo {
    padding: 24px 26px 22px;
    gap: 14px;
}

.bip-radio--grande .bip-radio__logo {
    width: 84px;
    height: 84px;
    border-radius: 20px;
}

.bip-radio--grande .bip-radio__nome {
    font-size: 24px;
}

.bip-radio--grande .bip-radio__local {
    font-size: 15px;
}

.bip-radio--grande .bip-radio__play {
    width: 68px;
    height: 68px;
}

.bip-radio--grande .bip-radio__dica {
    font-size: 16px;
}

@media (max-width: 560px) {
    .bip-radio__corpo {
        max-width: 100%;
    }

    .bip-radio__veu {
        background:
            linear-gradient(90deg, rgba(7, 9, 34, 0.9) 0%, rgba(7, 9, 34, 0.7) 60%, rgba(7, 9, 34, 0.35) 100%),
            linear-gradient(0deg, rgba(7, 9, 34, 0.6) 0%, rgba(7, 9, 34, 0) 50%);
    }

    .bip-radio--grande .bip-radio__nome {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bip-radio__ponto,
    .bip-radio__eq i,
    .bip-radio.is-loading .bip-radio__play::after {
        animation: none;
    }

    .bip-radio__arte {
        transition: none;
    }
}

/* ── A PRÉVIA NO COMPOSITOR ─────────────────────────────────────────────────────────────────────────── */
.compose-radio-preview {
    position: relative;
    margin: 8px 0 4px;
}

.compose-radio-preview[hidden] {
    display: none;
}

.compose-radio-preview .bip-radio {
    margin-top: 0;
}

.compose-radio-preview__x {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #FFFFFF;
    font-size: 14px;
    cursor: pointer;
}

.compose-radio-preview__x:hover {
    background: rgba(0, 0, 0, 0.75);
}

/* ── A JANELA DE COMPARTILHAR ───────────────────────────────────────────────────────────────────────── */
.bip-radio-folha {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.bip-radio-folha[hidden] {
    display: none;
}

.bip-radio-folha__fundo {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 20, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.bip-radio-folha__caixa {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 20px;
    background: var(--surface, #FFFFFF);
    color: var(--text, #1D2129);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.5);
    padding: 14px 16px 16px;
    box-sizing: border-box;
}

.bip-radio-folha__topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 17px;
}

.bip-radio-folha__x {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 24px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.bip-radio-folha__x:hover {
    background: var(--surface-3, rgba(0, 0, 0, 0.05));
}

.bip-radio-folha__opcoes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
}

.bip-radio-folha__op {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.bip-radio-folha__op:hover,
.bip-radio-folha__op:focus-visible {
    background: var(--surface-3, rgba(0, 0, 0, 0.05));
    outline: none;
}

.bip-radio-folha__op > i {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 21px;
    background: var(--surface-2, #F0F2F5);
    color: #4070B0;
}

.bip-radio-folha__op--feed > i {
    color: #FFFFFF;
    background: linear-gradient(135deg, #4070B0, #7B5CFF);
}

.bip-radio-folha__op[data-radio-op="whatsapp"] > i {
    color: #FFFFFF;
    background: #25D366;
}

.bip-radio-folha__op span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bip-radio-folha__op b {
    font-size: 15px;
}

.bip-radio-folha__op small {
    font-size: 12.5px;
    color: var(--text-muted, #667085);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bip-radio-folha__op[hidden] {
    display: none;
}

@media (max-width: 560px) {
    .bip-radio-folha {
        align-items: flex-end;
        padding: 0;
    }

    .bip-radio-folha__caixa {
        width: 100%;
        border-radius: 20px 20px 0 0;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
}

.bip-radio--grande [data-radio-share] {
    display: none;
}

/* ── A PÁGINA DO LINK (256bip.com/radio/<uuid>) ─────────────────────────────────────────────────────── */
.radio-link-pagina {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 32px;
}

.radio-link-pagina__topo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
}

.radio-link-pagina__icone {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 26px;
    color: #FFFFFF;
    background: linear-gradient(135deg, #4070B0, #7B5CFF 60%, #E24FB2);
    box-shadow: 0 8px 20px -10px rgba(123, 92, 255, 0.9);
}

.radio-link-pagina__titulo {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--text, #1D2129);
}

.radio-link-pagina__sub {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--text-muted, #667085);
}

.radio-link-pagina__acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-link-pagina__botao {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    background: var(--surface, #FFFFFF);
    color: var(--text, #1D2129);
    font: inherit;
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.radio-link-pagina__botao i {
    font-size: 19px;
}

.radio-link-pagina__botao:hover {
    background: var(--surface-3, rgba(0, 0, 0, 0.04));
}

.radio-link-pagina__botao--forte {
    border-color: transparent;
    color: #FFFFFF;
    background: linear-gradient(135deg, #4070B0, #7B5CFF);
    box-shadow: 0 8px 20px -10px rgba(64, 112, 176, 0.9);
}

.radio-link-pagina__botao--forte:hover {
    background: linear-gradient(135deg, #3A66A2, #6E4FF0);
}

.radio-link-pagina__nota {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted, #667085);
}

@media (max-width: 560px) {
    .radio-link-pagina__botao {
        flex: 1 1 100%;
        justify-content: center;
    }
}

/* O link escrito e selecionado quando o navegador não deixa copiar sozinho (03/10/26). */
.bip-radio-folha__manual {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
    background: var(--surface-2, #F4F5F7);
    color: var(--text, #1D2129);
    font: inherit;
    font-size: 13.5px;
    box-sizing: border-box;
}

.bip-radio-folha__manual[hidden] {
    display: none;
}
