* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f1a;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.header h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header h1 i {
    color: #ffd700;
    margin-right: 10px;
}

.fecha-actualizacion {
    color: rgba(255,255,255,0.7);
    font-size: 0.95em;
}

.fecha-actualizacion i {
    color: #ffd700;
    margin-right: 5px;
}

/* Grid de portadas */
.portadas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* FILTROS */
.filtros-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    padding: 1px;
    width: 100%;
    flex-wrap: nowrap;
}

.filtro-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

.filtro-btn:hover {
    background: rgba(255,215,0,0.2);
    border-color: #ffd700;
}

.filtro-btn.active {
    background: #ffd700;
    color: #0f0f1a;
    font-weight: bold;
    border-color: #ffd700;
}

.portada-item {
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.portada-item:hover {
    transform: scale(1.05);
}

.portada-imagen {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    margin-bottom: 12px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    background: #2a2a40;
    contain: strict;
}

.portada-item:hover .portada-imagen {
    border-color: #ffd700;
    box-shadow: 0 15px 30px rgba(255, 215, 0, 0.3);
}

.portada-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portada-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a40 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.portada-titulo {
    color: white;
    font-size: 1em;
    font-weight: 500;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portada-categoria {
    color: #ffd700;
    font-size: 0.8em;
    margin-top: 5px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portada-episodios {
    color: rgba(255,255,255,0.5);
    font-size: 0.75em;
    margin-top: 3px;
}

.loading {
    text-align: center;
    padding: 60px;
    color: white;
    font-size: 1.5em;
}

.loading i {
    animation: spin 1s linear infinite;
    color: #ffd700;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stats {
    text-align: center;
    color: rgba(255,255,255,0.6);
    margin-top: 30px;
    padding: 15px;
    font-size: 0.9em;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.stats i {
    color: #ffd700;
    margin: 0 5px;
}

/* Skeleton loader */
#content {
    min-height: 400px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.skeleton-card {
    aspect-ratio: 2/3;
    background: linear-gradient(90deg, #2a2a40 25%, #3a3a50 50%, #2a2a40 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tablet */
@media (max-width: 1024px) {
    .portadas-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }
    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }
}

/* Móvil */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        margin-bottom: 15px;
        padding: 15px;
    }

    .filtros-container {
        gap: 4px;
        margin: 10px 0 15px 0;
        padding: 1px;
    }

    .filtro-btn {
        padding: 6px 10px;
        font-size: 0.7em;
    }

    .portadas-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 0 0 10px 0;
    }

    .skeleton-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* Móvil muy pequeño */
@media (max-width: 400px) {
    .filtro-btn {
        padding: 5px 8px;
        font-size: 0.6em;
    }
    
    .portadas-grid {
        gap: 8px;
    }
    
    .portada-titulo {
        font-size: 0.85em;
    }
    
    .portada-categoria {
        font-size: 0.7em;
    }
    
    .portada-episodios {
        font-size: 0.65em;
    }

    .header h1 {
        font-size: 1.8em;
    }
}

/* ========== AJUSTES DE ALINEACIÓN PARA PC ========== */

/* Ajustes para pantallas grandes (PC) */
@media (min-width: 1025px) {
    body {
        padding: 20px;
        display: flex;
        justify-content: center;
    }
    
    .container {
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .portadas-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 25px;
    }
    
    .filtros-container {
        justify-content: center;
        gap: 15px;
    }
    
    .filtro-btn {
        padding: 12px 28px;
        font-size: 1em;
    }
    
    .header h1 {
        font-size: 3em;
    }
}

/* Ajustes para la página de programa en PC */
@media (min-width: 1025px) {
    .programa-info {
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    .programa-detalles {
        text-align: left;
    }
}

/* Ajustes para móvil - mantener centrado */
@media (max-width: 768px) {
    .programa-info {
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .programa-detalles {
        text-align: center;
    }
}
