/* ══════════════════════════════════════════════════════════
   RESET
   ══════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #fff;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

/* ══════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #161616;
    border: 1px solid #222;
    border-radius: 12px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 22px;
    color: #fff;
    letter-spacing: -0.3px;
}

.clock {
    font-size: 22px;
    font-weight: 700;
    color: #f00;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* ══════════════════════════════════════════════════════════
   ÁREA DE PLAYERS (GRADE + PAINEL AO VIVO)
   ══════════════════════════════════════════════════════════ */
.player-area {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 24px;
    flex-wrap: nowrap;
}

/* O player da grade — 100% por padrão, 50% quando tem painel */
.player-container {
    flex: 1 1 100%;
    min-width: 0;
    transition: flex 0.35s ease;
}

.player-area.ao-vivo .player-container {
    flex: 1 1 50%;
}

.player-wrapper {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
}

#youtube-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    pointer-events: none;
}

#youtube-player iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

.player-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 10;
    cursor: default;
}

.player-locked-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.5);
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-family: monospace;
    z-index: 20;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   BOTÃO INICIAL "ASSISTIR AO VIVO"
   ══════════════════════════════════════════════════════════ */
.live-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.live-button-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
    animation: girar 12s linear infinite;
}

@keyframes girar {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.live-button {
    text-align: center;
    padding: 40px 60px;
    background: rgba(255, 68, 68, 0.95);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 1;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.live-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(255, 68, 68, 0.8);
}

.live-button-icon {
    font-size: 72px;
    margin-bottom: 18px;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

.live-button h2 {
    color: #fff;
    font-size: 26px;
    margin-bottom: 8px;
}

.live-button p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.1); opacity: 0.8; }
}

/* ══════════════════════════════════════════════════════════
   INFORMAÇÕES DO PROGRAMA
   ══════════════════════════════════════════════════════════ */
.program-info {
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
    padding: 18px;
    border-top: 3px solid #f00;
    position: relative;
    z-index: 5;
}

.program-info h2 {
    font-size: 18px;
    margin-bottom: 6px;
    color: #fff;
}

.program-info p {
    font-size: 13px;
    margin-bottom: 12px;
    opacity: 0.85;
    line-height: 1.5;
}

.schedule-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.time-badge,
.category-badge {
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.time-badge {
    background: #1e3a5f;
    color: #7cb3ff;
}

.category-badge {
    background: #2a1a3a;
    color: #c084fc;
}

.next-program {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    margin-top: 12px;
    border-left: 3px solid #f00;
}

.next-program h3 {
    font-size: 10px;
    color: #f00;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.next-program .program-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.next-program .program-time {
    font-size: 12px;
    opacity: 0.8;
}

.next-program .program-desc {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.65;
    line-height: 1.4;
}

.btn-voltar-grade {
    margin-top: 12px;
    padding: 9px 16px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.btn-voltar-grade:hover {
    background: #333;
    border-color: #f00;
}

/* ══════════════════════════════════════════════════════════
   🔴 PAINEL AO VIVO — INJETADO VIA JS
   ══════════════════════════════════════════════════════════ */

/* Host do painel — escondido por padrão */
#live-panel-host {
    display: none;
    min-width: 0;
}

/* Quando ao vivo, o host vira flex-item de 50% */
.player-area.ao-vivo #live-panel-host {
    display: flex;
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
}

/* Painel em si — ocupa 100% do host */
.live-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #161616;
    border: 2px solid #f00;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.35);
    animation: surgirLive 0.4s ease-out;
    min-height: 0;
}

@keyframes surgirLive {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.live-cabecalho {
    padding: 14px 16px 10px;
    background: linear-gradient(180deg, rgba(255, 0, 0, 0.25), transparent);
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
    flex-shrink: 0;
}

.live-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f00;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    margin-bottom: 10px;
}

.live-dot-pulse {
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    animation: pulseLive 1.2s infinite;
}

@keyframes pulseLive {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.4); opacity: 0.5; }
}

.live-titulo {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.live-desc {
    color: #aaa;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Preview do vídeo — cresce para preencher o espaço */
.live-video-wrapper {
    width: 100%;
    background: #000;
    position: relative;
    cursor: pointer;
    flex: 1 1 auto;
    min-height: 200px;
    overflow: hidden;
}

#youtube-live {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    pointer-events: none;
}

#youtube-live iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

/* Overlay "clique para assistir" */
.live-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 5;
    cursor: pointer;
}

.live-video-wrapper:hover .live-video-overlay {
    opacity: 1;
}

.live-video-overlay span {
    background: #f00;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Botões */
.live-acoes {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    background: #111;
    border-top: 1px solid #222;
    flex-shrink: 0;
}

.live-acoes button {
    flex: 1;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-live-assistir {
    background: #f00;
    color: #fff;
}

.btn-live-assistir:hover {
    background: #d00;
    transform: scale(1.02);
}

.btn-live-continuar {
    background: transparent;
    color: #ccc;
    border: 1px solid #333;
    font-size: 11px !important;
}

.btn-live-continuar:hover {
    background: #1a1a1a;
    border-color: #555;
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   OUTROS CANAIS AO VIVO
   ══════════════════════════════════════════════════════════ */
.canais-ao-vivo {
    margin-top: 20px;
    padding: 15px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 10px;
    border: 1px solid #222;
}

.canais-titulo {
    color: #fff;
    font-size: 15px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.canais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.canal-card {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 2px solid transparent;
}

.canal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.35);
    border-color: #f00;
}

.canal-card.ativo {
    border-color: #f00;
}

.canal-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.canal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.live-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #f00;
    color: #fff;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.viewers {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
}

.canal-info {
    padding: 9px;
}

.canal-nome {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
}

.canal-titulo {
    color: #aaa;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVO
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .player-area {
        flex-direction: column;
    }

    .player-area.ao-vivo .player-container {
        flex: 1 1 auto;
        width: 100%;
    }

    .live-panel {
        width: 100%;
        flex: 1 1 auto;
    }

    .live-acoes {
        flex-direction: column;
    }

    .live-acoes button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 12px 14px;
    }

    .header h1 {
        font-size: 18px;
    }

    .clock {
        font-size: 16px;
    }

    .program-info h2 {
        font-size: 16px;
    }

    .live-button {
        padding: 30px 40px;
        margin: 20px;
    }

    .live-button-icon {
        font-size: 52px;
    }

    .live-button h2 {
        font-size: 22px;
    }
}

@media (max-width: 600px) {
    .canais-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
}

/* ══════════════════════════════════════════════════════════
   CARD DA RÁDIO (dentro da seção "Também no ar")
   ══════════════════════════════════════════════════════════ */
.canal-card.radio-card {
    background: linear-gradient(135deg, #1a2130 0%, #1e1a2e 100%);
    border: 2px solid rgba(79, 140, 255, 0.35);
    text-decoration: none;
    color: inherit;
    display: block;
}

.canal-card.radio-card:hover {
    border-color: #4f8cff;
    box-shadow: 0 6px 24px rgba(79, 140, 255, 0.4);
    transform: translateY(-3px);
}

.radio-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1e3a5f 0%, #2a1a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.radio-thumb::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.15) 0%, transparent 65%);
    animation: girarRadio 12s linear infinite;
}

@keyframes girarRadio {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.radio-icon {
    font-size: 54px;
    position: relative;
    z-index: 2;
    animation: pulseRadio 2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(79, 140, 255, 0.6));
}

@keyframes pulseRadio {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.08); opacity: 0.85; }
}

.radio-badge {
    background: #4f8cff !important;
    box-shadow: 0 0 12px rgba(79, 140, 255, 0.6);
}

.canal-card.radio-card .canal-nome {
    color: #7cb3ff;
}

.canal-card.radio-card:hover .canal-nome {
    color: #a5c8ff;
}

/* Seta indicando que sai do site */
.canal-card.radio-card .canal-titulo::after {
    content: ' ↗';
    opacity: 0.5;
    font-size: 10px;
}