/* ══════════════════════════════════════════════════════════
   Boton EN VIVO en el nav
   ══════════════════════════════════════════════════════════ */
.nav-item .nav-live-btn,
.nav-live-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    background: #e00 !important;
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 12px !important;
    letter-spacing: 1px !important;
    padding: 5px 14px !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    transition: background 0.3s !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(220,0,0,0.4) !important;
}
.nav-item .nav-live-btn:hover,
.nav-live-btn:hover {
    background: #c00 !important;
    color: #fff !important;
    transform: none !important;
}
.nav-item .nav-live-btn::after { display: none !important; }

.header-live-wrap { display: none; }
@media (max-width: 768px) {
    .header-live-wrap {
        display: flex;
        align-items: center;
        margin-left: auto;
        margin-right: 10px;
    }
    .nav-live-movil { font-size: 11px !important; padding: 5px 11px !important; }
    .nav-en-vivo { display: none !important; }
}
.nav-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    animation: livePulse 1s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.3; transform: scale(1.5); }
}

/* ══════════════════════════════════════════════════════════
   Pagina EN VIVO — Layout tipo Twitch
   ══════════════════════════════════════════════════════════ */
.live-page {
    background: #0e0e10 !important;
    min-height: 100vh;
}

/* Override header para pagina en vivo: fondo oscuro */
.live-page header {
    background: #18181b !important;
    border-bottom: 1px solid #2f2f35 !important;
    box-shadow: none !important;
}
.live-page .church-name h1,
.live-page .Ministerio-Movimiento,
.live-page .Gloria-Los-Redimidos,
.live-page .nav-item a {
    color: #dedee3 !important;
}
.live-page .nav-item a:hover {
    background: #2f2f35 !important;
    color: #fff !important;
}
.live-page .nav-item.active a {
    background: #bf94ff !important;
    color: #0e0e10 !important;
}
.live-page .menu-toggle {
    color: #dedee3 !important;
    border-color: #53535f !important;
}

/* Reset live-root inline styles */
#live-root {
    min-height: auto !important;
    display: block !important;
    align-items: initial !important;
    justify-content: initial !important;
    padding-top: 74px; /* altura del header fixed */
}

/* ── Barra superior: titulo + compartir ── */
.tv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #18181b;
    border-bottom: 1px solid #2f2f35;
    gap: 10px;
}
.tv-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.tv-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e00;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 4px;
    flex-shrink: 0;
}
.tv-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: livePulse 1s ease-in-out infinite;
}
.tv-title {
    color: #efeff1;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Outfit', sans-serif;
}
.tv-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.tv-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 6px;
    background: #2f2f35;
    color: #dedee3;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}
.tv-share-btn:hover { background: #464649; color: #fff; }

/* ══════════════════════════════════════════════════════════
   DESKTOP — video + sidebar
   ══════════════════════════════════════════════════════════ */
.tv-layout {
    display: flex;
    /* Ocupa todo el viewport menos header(74) y topbar(~50) */
    height: calc(100vh - 124px);
}

/* Video — ocupa todo el espacio restante */
.tv-player-col {
    flex: 1;
    min-width: 0;
    background: #000;
}
.tv-player-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}
.tv-player-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* Sidebar — ancho fijo */
.tv-sidebar {
    width: 340px;
    flex-shrink: 0;
    background: #18181b;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #2f2f35;
}

/* Tabs */
.tv-tabs {
    display: flex;
    border-bottom: 1px solid #2f2f35;
    flex-shrink: 0;
}
.tv-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #adadb8;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
}
.tv-tab:hover { color: #efeff1; }
.tv-tab.active {
    color: #bf94ff;
    border-bottom-color: #bf94ff;
}
.tv-tab i { font-size: 13px; }

/* Paneles */
.tv-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.tv-panel.active { display: flex; }

/* Chat msgs */
.live-chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.live-chat-msgs::-webkit-scrollbar { width: 4px; }
.live-chat-msgs::-webkit-scrollbar-thumb { background: #3a3a3d; border-radius: 4px; }

.chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.chat-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-body { flex: 1; min-width: 0; }
.chat-author {
    font-size: 12px;
    font-weight: 700;
    color: #bf94ff;
    margin-bottom: 1px;
}
.chat-text {
    font-size: 13px;
    color: #dedee3;
    line-height: 1.4;
    word-break: break-word;
}
.chat-empty {
    color: #53535f;
    font-size: 13px;
    text-align: center;
    margin-top: 40px;
}

/* ── Panel Comentarios ── */
.tv-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tv-comments-list::-webkit-scrollbar { width: 4px; }
.tv-comments-list::-webkit-scrollbar-thumb { background: #3a3a3d; border-radius: 4px; }

.web-comment {
    background: #26262c;
    border-radius: 8px;
    padding: 10px 12px;
}
.web-comment-autor {
    font-size: 12px;
    font-weight: 700;
    color: #00e6cb;
    margin-bottom: 2px;
}
.web-comment-texto {
    font-size: 13px;
    color: #dedee3;
    line-height: 1.4;
    word-break: break-word;
}
.web-comment-hora {
    font-size: 10px;
    color: #53535f;
    margin-top: 4px;
}

/* Form comentarios */
.tv-comments-form {
    padding: 10px 12px;
    border-top: 1px solid #2f2f35;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.tv-comments-form input,
.tv-comments-form textarea {
    background: #fff !important;
    border: 1px solid #3a3a3d !important;
    border-radius: 6px;
    padding: 8px 10px;
    color: #111 !important;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    resize: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.tv-comments-form input:focus,
.tv-comments-form textarea:focus {
    border-color: #bf94ff;
}
.tv-comments-form textarea { height: 48px; }
.tv-msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.tv-msg-row textarea { flex: 1; }
.tv-msg-row button {
    width: 38px; height: 38px;
    border-radius: 6px;
    background: #bf94ff;
    color: #0e0e10;
    border: none;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tv-msg-row button:hover { background: #a970ff; }

/* ── Sin directo ── */
.live-offline {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    color: #53535f;
}
.live-offline i { font-size: 4rem; color: #2f2f35; margin-bottom: 24px; }
.live-offline h2 { color: #efeff1 !important; font-size: 1.5rem; margin-bottom: 12px; }
.live-offline p  { font-size: 15px; max-width: 420px; }
.live-offline a  { color: #bf94ff; text-decoration: none; font-weight: 700; }

/* Ocultar footer en pagina en vivo (como Twitch, todo pantalla) */
.live-page .footer,
.live-page .site-credit {
    display: none;
}

/* ══════════════════════════════════════════════════════════
   MOVIL — video arriba, chat debajo, todo apilado
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #live-root {
        padding-top: 74px;
    }

    /* Topbar mas compacto */
    .tv-topbar {
        padding: 8px 10px;
        gap: 8px;
    }
    .tv-title { font-size: 0.8rem; }
    .tv-share-btn { width: 30px; height: 30px; font-size: 12px; }
    .tv-live-badge { font-size: 10px; padding: 3px 8px; }

    /* Layout apilado */
    .tv-layout {
        flex-direction: column;
        height: auto;
    }

    /* Video: ancho completo, 16:9, PRIMERO */
    .tv-player-col {
        width: 100%;
        flex: none;
        order: 0;
    }
    .tv-player-wrap {
        position: relative;
        width: 100%;
        height: 0;
        padding-top: 56.25%; /* 16:9 */
    }
    .tv-player-wrap iframe {
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
    }

    /* Sidebar debajo del video */
    .tv-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #2f2f35;
        height: 55vh;
        min-height: 300px;
        order: 1;
    }

    /* Nav movil fondo oscuro */
    .live-page .main-nav {
        background: #18181b !important;
    }
    .live-page .main-nav .nav-item a {
        color: #dedee3 !important;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1100px) {
    .tv-sidebar { width: 280px; }
}
