@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap');

#upmtv-live {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #ffffff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- TARJETA 1: REPRODUCTOR --- */
.upmtv-card-player {
    background: #000000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.upmtv-video {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    background: #000000;
    position: relative;
    overflow: hidden;
}

#youtube-player,
#youtube-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

#youtube-player.is-playing,
#youtube-player iframe.is-playing {
    opacity: 1 !important;
}

.upmtv-watermark {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 25;
    pointer-events: none;
}

.upmtv-logo-img {
    height: 30px !important;
    width: auto !important;
    display: block;
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.8));
}

/* BOTÓN DE CIERRE PANTALLA COMPLETA - CORREGIDO Y VISIBLE */
.btn-close-fs {
    display: none;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2147483647 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.6) !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
}

.btn-close-fs:hover {
    background: #ff2b2b !important;
    border-color: #ff2b2b !important;
    transform: scale(1.1);
}

.btn-close-fs svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
    display: block !important;
    margin: auto !important;
}

:fullscreen .btn-close-fs,
:-webkit-full-screen .btn-close-fs,
.upmtv-video:fullscreen .btn-close-fs,
.upmtv-video:-webkit-full-screen .btn-close-fs,
.upmtv-video.is-pseudo-fullscreen .btn-close-fs,
.upmtv-video.is-fs-active .btn-close-fs {
    display: flex !important;
}

.upmtv-video.is-pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    padding-bottom: 0 !important;
    z-index: 99999999 !important;
    background: #000 !important;
}

/* --- TARJETA 2: INFO Y CONTROLES --- */
.upmtv-card-info {
    background: #0f1015;
    border-radius: 16px;
    padding: 24px 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.upmtv-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.upmtv-live {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ff2b2b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ff2b2b;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff2b2b;
    animation: livePulse 1.6s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.upmtv-controls {
    display: flex;
    gap: 10px;
}

.upmtv-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 0 16px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s ease;
    gap: 8px;
}

.upmtv-btn:hover {
    background: #ff2b2b;
    border-color: #ff2b2b;
}

.upmtv-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.upmtv-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
}

.upmtv-meta {
    margin-top: 6px;
    color: #8b8c9e;
    font-size: 13px;
    font-weight: 600;
}

.upmtv-next-box {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.upmtv-label {
    color: #ff2b2b;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 800;
}

.upmtv-next {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 600;
    color: #d1d1e0;
}

/* --- TARJETA 3: GUÍA DE PROGRAMACIÓN PROPORCIONAL --- */
.upmtv-card-guide {
    background: #0f1015;
    border-radius: 16px;
    padding: 24px 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.guide-header-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #8b8c9e;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.tv-guide {
    position: relative;
    width: 100%;
}

.guide-hours {
    display: flex;
    margin-bottom: 12px;
    color: #6e6e80;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
}

.guide-hour-item {
    flex: 1;
    text-align: left;
}

.guide-track-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
    padding-top: 10px;
}

.guide-track {
    display: flex;
    gap: 6px;
    width: 100%;
}

.guide-program {
    min-width: 0;
    height: 84px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

.guide-program.current {
    background: rgba(255, 43, 43, 0.1);
    border-color: rgba(255, 43, 43, 0.6);
}

.guide-program.filler {
    background: rgba(255, 255, 255, 0.015);
    border-style: dashed;
    opacity: 0.75;
}

.guide-program.fade-end {
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0.1) 100%);
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0.1) 100%);
}

.program-time {
    font-size: 11px;
    color: #8b8c9e;
    font-weight: 800;
    margin-bottom: 4px;
    white-space: nowrap;
}

.guide-program.current .program-time {
    color: #ff2b2b;
}

.program-title {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* LÍNEA Y ETIQUETA ROJA DE PROGRESO */
.guide-now-line {
    position: absolute;
    top: -10px;
    bottom: 0;
    width: 2px;
    background: #ff2b2b;
    z-index: 50;
    box-shadow: 0 0 10px rgba(255, 43, 43, 0.9);
    pointer-events: none;
    transform: translateX(-50%);
}

.guide-now-time {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff2b2b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* --- ADAPTACIÓN MÓVIL --- */
@media(max-width: 768px) {
    .upmtv-card-info, .upmtv-card-guide { padding: 18px 16px; }
    .upmtv-title { font-size: 20px; }

    .btn-close-fs {
        top: 12px !important;
        left: 12px !important;
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }

    .btn-close-fs svg {
        width: 18px !important;
        height: 18px !important;
    }

    .guide-track-wrapper { 
        overflow-x: auto; 
        padding-bottom: 12px; 
        -webkit-overflow-scrolling: touch;
    }
    .guide-track { 
        min-width: 650px; 
    } 
    .guide-program.fade-end { 
        mask-image: none; 
        -webkit-mask-image: none; 
    }
}