/* Actualizaciones en vivo (js/live-updates.js) */

/* ─── Etiqueta "En vivo" ───────────────────────────────────────────────────── */

.ht-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #d31414;
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.03em;
    line-height: 1.4;
    text-shadow: none; /* los títulos de la portada llevan sombra */
    text-transform: uppercase;
    vertical-align: middle;
}

/* En las tarjetas de la portada, sobre la esquina inferior derecha de la miniatura. */
.ht-live-pill.is-thumb {
    position: absolute;
    right: 4px;
    bottom: 4px;
    gap: 4px;
    padding: 1px 6px;
    border: 1px solid #fff;
    font-size: 0.6rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.ht-live-pill.is-thumb .ht-live-dot {
    width: 6px;
    height: 6px;
}

.ht-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: ht-live-pulse 1.4s ease-in-out infinite;
}

@keyframes ht-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* ─── Recuadro: última actualización e historial ──────────────────────────── */

.ht-live-box.is-empty {
    display: none;
}

.ht-live-box {
    margin: 0 0 16px;
    padding: 8px 12px;
    border: 1px solid #3fa4c9;
    border-radius: 6px;
    background: #eaf6fa;
    color: #004960;
    font-size: 13px;
}

.ht-live-box.is-live {
    border-color: #e8a0a0;
    background: #fff3f3;
}

.ht-live-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.ht-live-updated {
    font-weight: bold;
}

.ht-live-toggle {
    margin-left: auto;
    padding: 3px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.ht-live-toggle:hover {
    background: rgba(0, 73, 96, 0.08);
}

.ht-live-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #004960;
    color: #fff;
    font-size: 0.8em;
    text-align: center;
}

.ht-live-chevron {
    transition: transform 0.15s;
}

.ht-live-box.is-open .ht-live-chevron {
    transform: rotate(180deg);
}

.ht-live-log {
    max-height: 220px;
    margin: 8px 0 0;
    padding: 8px 0 0;
    overflow-y: auto;
    border-top: 1px solid rgba(0, 73, 96, 0.15);
    list-style: none;
}

.ht-live-log li {
    display: flex;
    gap: 10px;
    padding: 3px 0;
}

.ht-live-time {
    flex: 0 0 auto;
    min-width: 105px;
    color: #3d6f80;
    font-variant-numeric: tabular-nums;
}

/* ─── Aviso flotante ──────────────────────────────────────────────────────── */

.ht-live-bar {
    position: fixed;
    top: 62px;
    left: 50%;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 8px 8px 8px 12px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: rgb(0, 120, 160);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -12px);
    transition: opacity 0.2s, transform 0.2s;
}

.ht-live-bar.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.ht-live-bar-icon {
    font-size: 1.1em;
}

.ht-live-bar.is-loading .ht-live-bar-icon i {
    animation: fa-spin 1s linear infinite;
}

.ht-live-bar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.ht-live-bar-count {
    font-size: 0.8em;
    opacity: 0.85;
}

.ht-live-bar-note {
    overflow: hidden;
    font-size: 0.85em;
    opacity: 0.9;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ht-live-bar-view {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 2px solid #fff;
    border-radius: 6px;
    background: rgb(28, 140, 70);
    color: #fff;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.ht-live-bar-view:hover {
    filter: brightness(1.1);
}

.ht-live-bar-close {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.ht-live-bar-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Bloques nuevos o cambiados tras "Ver cambios" ───────────────────────── */

.ht-live-changed {
    border-radius: 4px;
    animation: ht-live-highlight 6s ease-out;
}

@keyframes ht-live-highlight {
    0%, 40% { background-color: #fff3b0; box-shadow: 0 0 0 4px #fff3b0; }
    100% { background-color: transparent; box-shadow: 0 0 0 4px transparent; }
}

@media (max-width: 560px) {
    .ht-live-bar {
        top: auto;
        bottom: 16px;
        width: calc(100% - 32px);
        transform: translate(-50%, 12px);
    }

    .ht-live-bar.is-visible {
        transform: translate(-50%, 0);
    }

    .ht-live-bar-text strong {
        font-size: 0.9em;
    }
}

/* Notificación "Se actualizó X, que tienes en tus guardados" (ajax-scripts.js). */
.jBox-Notice .ht-notice-link {
    color: inherit;
    text-decoration: underline;
}
