/* =============================================================================
   GRILLA DE COLECCIONES
   ============================================================================= */
.sp-colecciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.sp-coleccion-card {
    position: relative;
}

.sp-coleccion-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* =============================================================================
   MOSAICO: hasta 4 backdrops en el espacio de UNA sola imagen
   ============================================================================= */
.sp-coleccion-mosaico {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    display: grid;
    gap: 2px;
    transition: transform 0.3s ease;
}

.sp-coleccion-card-link:hover .sp-coleccion-mosaico {
    transform: scale(1.02);
}

.sp-coleccion-mosaico img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.sp-coleccion-card-link:hover .sp-coleccion-mosaico img {
    transform: scale(1.08);
}

/* 1 sola foto: ocupa todo */
.sp-coleccion-mosaico[data-count="1"] {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

/* 2 fotos: mitad y mitad, lado a lado */
.sp-coleccion-mosaico[data-count="2"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

/* 3 fotos: una grande a la izquierda, 2 apiladas a la derecha */
.sp-coleccion-mosaico[data-count="3"] {
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.sp-coleccion-mosaico[data-count="3"] img:first-child {
    grid-row: 1 / 3;
}

/* 4 fotos: mosaico parejo 2x2 */
.sp-coleccion-mosaico[data-count="4"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.sp-coleccion-mosaico-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .75) 100%);
    pointer-events: none;
}

.sp-coleccion-mosaico-vacio {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    opacity: 0.3;
}

.sp-coleccion-card-info {
    padding: 10px 4px 0;
}

.sp-coleccion-card-nombre {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-coleccion-card-count {
    font-size: 12px;
    color: #a3a3a3;
}

.sp-coleccion-eliminar-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.sp-coleccion-card:hover .sp-coleccion-eliminar-btn {
    opacity: 1;
}

.sp-coleccion-eliminar-btn:hover {
    background: #ff2c2c;
}

@media (max-width: 600px) {
    .sp-colecciones-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .sp-coleccion-eliminar-btn {
        opacity: 1;
    }
}

/* =============================================================================
   BOTÓN DE RENOMBRAR (página de detalle de una colección)
   ============================================================================= */
.sp-mcd-renombrar-btn {
    background: rgba(255, 255, 255, .08);
    border: none;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 8px;
}

.sp-mcd-renombrar-btn:hover {
    background: rgba(255, 255, 255, .16);
}

/* =============================================================================
   ENLACE "VOLVER A MIS COLECCIONES"
   ============================================================================= */
.sp-mcd-volver-link {
    color: #a3a3a3;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sp-mcd-volver-link:hover {
    color: #ff2c2c;
    text-decoration: underline;
}

/* =============================================================================
   LISTADO DE ACTORES / DIRECTORES: tarjetas con foto grande + nombre debajo
   ============================================================================= */
.sp-personas-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
}

.sp-persona-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    text-align: center;
}

.sp-persona-card-foto {
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid #333;
    margin-bottom: 10px;
}

.sp-persona-card-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.sp-persona-card:hover .sp-persona-card-foto img {
    transform: scale(1.06);
}

.sp-persona-card:hover .sp-persona-card-foto {
    border-color: #ff2c2c;
}

.sp-persona-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #555;
}

.sp-persona-card-nombre {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.sp-persona-card-count {
    color: #a3a3a3;
    font-size: 12px;
    margin-top: 3px;
}

@media (max-width: 600px) {
    .sp-personas-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .sp-persona-card-nombre {
        font-size: 12px;
    }
}

/* =============================================================================
   FOTO DE PERFIL DE ACTOR/DIRECTOR (estilo TMDB: círculo encima del nombre)
   ============================================================================= */
.sp-persona-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sp-persona-foto-grande {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 14px;
    border: 3px solid #333;
}

.sp-persona-foto-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    font-size: 48px;
    color: #555;
}

/* Foto chica: quedó sin uso (era del diseño anterior en pills, ahora
   reemplazado por las tarjetas de sp-persona-card-foto de más arriba) */

@media (max-width: 600px) {
    .sp-persona-foto-grande {
        width: 90px;
        height: 90px;
    }
}