/* CONFIGURACIÓN BASE (Fondo Puro Diez TV) */
.epg-dieztv-main-container {
    background-color: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 20px;
    border-radius: 6px;
    margin: 15px auto;
    width: 100%;
    box-sizing: border-box;
}

.epg-error {
    background: rgba(0, 86, 179, 0.1);
    border-left: 4px solid #0056b3;
    padding: 15px;
    color: #fff;
}

/* BARRA DE FILTROS */
.epg-control-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.epg-filter-days, .epg-filter-slots {
    display: flex;
    gap: 6px;
    align-items: center;
}
.epg-btn-day, .epg-btn-slot {
    background: #111111;
    border: 1px solid #252525;
    color: #999999;
    padding: 7px 14px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}
.epg-btn-day:hover, .epg-btn-slot:hover {
    background: #1c1c1c;
    color: #fff;
}
.epg-btn-day.active, .epg-btn-slot.active {
    background: #0056b3;
    border-color: #0056b3;
    color: #ffffff;
}

/* Botón especial AHORA */
.epg-btn-now-action {
    background: #ffffff;
    color: #000000;
    border: 1px solid #ffffff;
    padding: 7px 14px;
    border-radius: 3px;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    margin-right: 8px;
    transition: transform 0.2s;
}
.epg-btn-now-action:hover {
    transform: scale(1.04);
    background: #0056b3;
    color: #fff;
    border-color: #0056b3;
}

/* ESTRUCTURA DE PISTAS MULTICANAL */
.epg-channels-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.epg-channel-track {
    display: flex;
    background: #080808;
    border: 1px solid #141414;
    border-radius: 4px;
    overflow: hidden;
}
.epg-channel-sidebar {
    width: 140px;
    min-width: 140px;
    background: #0f0f0f;
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}
.epg-ch-logo {
    max-width: 85px;
    max-height: 38px;
    object-fit: contain;
    margin-bottom: 5px;
}
.epg-ch-name {
    font-size: 12px;
    font-weight: 700;
    color: #cccccc;
    text-transform: uppercase;
    text-align: center;
}
.epg-events-timeline {
    flex-grow: 1;
    overflow: hidden;
}
.epg-events-track-render {
    display: flex;
    width: 100%;
}

/* COMPORTAMIENTO DE TARJETAS */
.epg-card {
    background: #141414;
    border-right: 1px solid #222222;
    position: relative;
    display: flex;
    box-sizing: border-box;
    transition: min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
}

/* EMISIÓN EN DIRECTO DESTACADA (Borde y Fondo Azul Eléctrico Tematizado) */
.epg-card.live-active {
    border: 1px solid #0056b3 !important;
    background: linear-gradient(135deg, #021226 0%, #141414 100%);
    z-index: 2;
}
.epg-live-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #0056b3;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 2px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* TEXTOS Y CONTENIDOS */
.epg-card-contents {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.epg-card-header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.epg-time-badge {
    color: #0056b3;
    font-weight: 700;
    font-size: 12px;
}
.epg-cat-badge {
    background: rgba(255, 255, 255, 0.04);
    color: #888;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 2px;
    text-transform: uppercase;
}

/* ETIQUETAS TÉCNICAS XMLTV (HD, CC, AUDIO) */
.epg-meta-tech {
    font-size: 9px;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 2px;
    color: #ffffff;
    background: #333333;
}
.epg-meta-tech.hd { background: #0056b3; }
.epg-meta-tech.cc { background: #7f8c8d; }
.epg-meta-tech.audio { background: #27ae60; }

.epg-card-title {
    margin: 2px 0;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}
.epg-card-subtitle {
    margin: 1px 0 0 0;
    color: #777;
    font-size: 11px;
    font-style: italic;
}

/* SISTEMA CUADRADO FIJO DE EDADES (Esquina Superior Derecha) */
.epg-card-rating-fixed {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    z-index: 4;
}
.epg-card-rating-fixed span {
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    font-family: monospace, sans-serif;
}
/* Código cromático oficial de Clasificación de contenidos */
.epg-rating-tp { background-color: #2ed573; }
.epg-rating-7  { background-color: #ffa502; }
.epg-rating-12 { background-color: #ff7f50; }
.epg-rating-16 { background-color: #ff4757; }
.epg-rating-18 { background-color: #57606f; }
.epg-rating-generic { background-color: #333333; }


/* ==========================================
   FORMATO: PARRILLA HORIZONTAL
   ========================================== */
.format-horizontal .epg-events-timeline {
    overflow-x: auto;
}
.format-horizontal .epg-events-timeline::-webkit-scrollbar {
    height: 5px;
}
.format-horizontal .epg-events-timeline::-webkit-scrollbar-thumb {
    background: #0056b3;
}
.format-horizontal .epg-card {
    flex-direction: column;
    justify-content: space-between;
    height: 125px;
}
.format-horizontal .epg-card-contents {
    justify-content: flex-start;
    padding-top: 30px; 
}
.format-horizontal .epg-card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Efecto Hover Elástico para Programas Cortos */
.format-horizontal .epg-card:hover {
    min-width: 280px !important;
    background: #1a1a1a;
    border-color: #0056b3;
    z-index: 10;
}
.format-horizontal .epg-card:hover .epg-card-title {
    white-space: normal;
    overflow: visible;
}

/* ==========================================
   FORMATO: PARRILLA VERTICAL UNIFICADA
   ========================================== */
.format-vertical .epg-channel-track {
    flex-direction: column;
}
.format-vertical .epg-channel-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 15px;
    border-right: none;
    border-bottom: 1px solid #1a1a1a;
}
.format-vertical .epg-events-track-render {
    flex-direction: column;
}
.format-vertical .epg-card {
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid #1c1c1c;
    width: 100%;
}
.format-vertical .epg-card:hover {
    background: #0e0e0e;
}
.format-vertical .epg-card-media {
    width: 140px;
    min-width: 140px;
    height: 80px;
    overflow: hidden;
}
.format-vertical .epg-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.format-vertical .epg-card-desc {
    color: #999999;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}
.format-vertical .epg-card.live-active .epg-card-contents {
    padding-top: 35px;
}

@media (max-width: 768px) {
    .format-vertical .epg-card { flex-direction: column; align-items: flex-start; }
    .format-vertical .epg-card-media { width: 100%; height: 130px; }
    .epg-control-bar { flex-direction: column; align-items: flex-start; }
}