/* ============================================================
   CAST SDK — Bouton Cast dans la Room view + overlay "en lecture sur TV"
   ============================================================ */

/* === Bouton Cast (topbar Room view) === */
.jb-cast-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: rgba(11, 18, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--jb-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.jb-cast-btn:hover {
    background: rgba(11, 18, 39, 0.85);
    border-color: rgba(255, 255, 255, 0.3);
}
.jb-cast-btn.is-unavailable {
    opacity: 0.55;
}
.jb-cast-btn.is-unavailable:hover {
    opacity: 0.85;
}
.jb-cast-btn.is-connected {
    background: rgba(255, 59, 107, 0.15);
    border-color: rgba(255, 59, 107, 0.5);
    color: var(--jb-accent);
}
.jb-cast-btn.is-connected::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--jb-accent);
    box-shadow: 0 0 0 0 rgba(255, 59, 107, 0.6);
    animation: jbCastDotPulse 1.6s ease-out infinite;
}
@keyframes jbCastDotPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 107, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(255, 59, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 107, 0); }
}

.jb-cast-btn svg { display: block; }
.jb-cast-btn__label { font-family: var(--jb-font-display, inherit); }

@media (max-width: 768px) {
    .jb-cast-btn__label { display: none; }
    .jb-cast-btn { padding: 9px; }
}

/* === Overlay "En lecture sur ta TV" ===
   Recouvre le player local quand une session Cast est active. */
.jb-cast-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: radial-gradient(ellipse at center, #1a2348 0%, #0b1227 70%);
    border-radius: inherit;
    text-align: center;
    z-index: 50;
    animation: jbCastOverlayIn .35s ease-out;
}
@keyframes jbCastOverlayIn {
    from { opacity: 0; transform: scale(.96); }
    to { opacity: 1; transform: scale(1); }
}
.jb-cast-overlay__icon {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 59, 107, 0.14);
    color: var(--jb-accent);
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border: 2px solid rgba(255, 59, 107, 0.3);
    position: relative;
}
.jb-cast-overlay__icon::before {
    /* Wave anime pour signaler la diffusion en cours */
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--jb-accent);
    opacity: 0;
    animation: jbCastWave 2s ease-out infinite;
}
@keyframes jbCastWave {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.5); opacity: 0; }
}
.jb-cast-overlay h2 {
    font-size: 24px;
    margin: 0 0 12px;
    font-weight: 700;
    color: var(--jb-text);
}
.jb-cast-overlay h2 span {
    color: var(--jb-accent);
}
.jb-cast-overlay p {
    font-size: 14px;
    color: var(--jb-text-muted);
    margin: 0 0 24px;
    max-width: 380px;
    line-height: 1.5;
}
