/* ========== RESET Y BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a0a0f 0%, #12121a 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(20, 20, 30, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ========== HEADER Y BOTÓN VOLVER ========== */
.header {
    margin-bottom: 30px;
}

.btn-volver {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
    display: none !important;
    align-items: center;
    gap: 8px;
}

.btn-volver:hover {
    background: rgba(255,215,0,0.2);
    border-color: #ffd700;
    transform: translateX(-5px);
}

/* ========== INFO DEL PROGRAMA ========== */
.programa-info {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    padding: 20px;
}

/* Portada */
.programa-portada {
    width: 180px;
    height: 270px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border: 3px solid #ffd700;
    background: #2a2a40;
    flex-shrink: 0;
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.programa-portada-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a40, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    color: white;
}

/* Detalles */
.programa-detalles {
    flex: 1;
    min-width: 200px;
}

.programa-titulo {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
    word-break: break-word;
}

.programa-categoria {
    display: inline-block;
    background: rgba(255,215,0,0.2);
    color: #ffd700;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 15px;
    border: 1px solid #ffd700;
}

.programa-stats {
    display: flex;
    gap: 20px;
    color: rgba(255,255,255,0.7);
    font-size: 0.95em;
    flex-wrap: wrap;
}

.programa-stats i {
    color: #ffd700;
    margin-right: 5px;
}

/* ========== EPISODIOS ========== */
.episodios-titulo {
    color: white;
    font-size: 1.6rem;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,215,0,0.3);
}

.episodios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.episodio-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.episodio-card:hover {
    transform: translateY(-5px);
    border-color: #ffd700;
    box-shadow: 0 10px 20px rgba(255,215,0,0.2);
}

.episodio-fecha {
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.episodio-dia-semana {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.1);
    padding: 3px 10px;
    border-radius: 15px;
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,215,0,0.3);
}

.episodio-enlaces {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Botones base */
.btn-enlace {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-enlace.sd {
    background: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
}
.btn-enlace.sd:hover {
    background: #3498db;
}

.btn-enlace.hd {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
}
.btn-enlace.hd:hover {
    background: #2ecc71;
}

.btn-enlace.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* LIVE - una sola URL */
.btn-enlace.live-single {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    grid-column: span 2;
}
.btn-enlace.live-single:hover {
    background: linear-gradient(135deg, #b02a37, #8b1a1a);
}

/* LIVE - múltiples URLs */
.live-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    grid-column: span 2;
}
.btn-enlace.live-number {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    text-align: center;
    font-weight: bold;
    padding: 10px;
}
.live-placeholder {
    visibility: hidden;
}

/* Loading y errores */
.loading, .error-container {
    text-align: center;
    padding: 50px;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
}
.loading i {
    color: #ffd700;
}
.error-container i {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 15px;
}
.error-container h2 {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 700px) {
    .programa-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .programa-detalles {
        text-align: center;
    }
    .programa-categoria {
        display: inline-block;
        margin: 0 auto 15px;
    }
    .episodios-grid {
        grid-template-columns: 1fr;
    }
    .btn-volver {
        width: 100%;
        justify-content: center;
    }
}
