/* Breadcrumb */
.ct-breadcrumb { font-size: 0.85rem; color: #888; margin-bottom: 20px; }
.ct-breadcrumb a { color: var(--ct-accent); text-decoration: none; }
.ct-breadcrumb a:hover { text-decoration: underline; }
.ct-breadcrumb span { color: #999; }

/* Fondo portada difuminada */
.ct-ficha-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(20px);
    opacity: 0.5;
    z-index: -1;
    transform: scale(1.1);
}

/* Ficha principal */
.ct-ficha {
    display: flex;
    gap: 30px;
    background: rgba(26, 26, 26, 0.5);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    padding: 25px;
    margin-bottom: 30px;
}

.ct-ficha-portada {
    flex-shrink: 0;
    width: 280px;
}

.ct-ficha-portada img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: block;
}

.ct-ficha-no-portada {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--ct-dark);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ct-light);
    font-size: 1rem;
}

.ct-ficha-info {
    flex: 1;
    min-width: 0;
}

/* Título */
.ct-ficha-titulo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px;
    line-height: 1.2;
}

/* Botón editar admin */
.ct-btn-editar {
    display: inline-block;
    background: #333;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.ct-btn-editar:hover { background: var(--ct-accent); }

/* Tabla de datos estilo FilmAffinity */
.ct-ficha-datos {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.ct-ficha-datos tr {
    border-bottom: 1px solid #2a2a2a;
}

.ct-ficha-datos tr:last-child {
    border-bottom: none;
}

.ct-ficha-datos th {
    text-align: left;
    padding: 10px 15px 10px 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #aaa;
    white-space: nowrap;
    vertical-align: top;
    width: 100px;
}

.ct-ficha-datos td {
    padding: 10px 0;
    font-size: 0.9rem;
    color: #bbb;
    line-height: 1.5;
}

/* Tags de género */
.ct-tag {
    display: inline-block;
    background: #333;
    color: #fff;
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 3px;
    margin: 2px 4px 2px 0;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.ct-tag:hover {
    background: var(--ct-accent);
    color: #000;
}

/* Productora inline */
.ct-productora-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ct-productora-portada {
    height: 60px;
    width: auto;
    max-width: 180px;
    border-radius: 4px;
    object-fit: contain;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

/* Saga inline */
.ct-saga-inline {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.ct-saga-portada {
    width: 60px;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.ct-saga-listado {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ct-saga-item {
    display: inline-block;
    background: #333;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 3px;
    text-decoration: none;
    transition: background 0.2s;
}

.ct-saga-item:hover {
    background: var(--ct-accent);
    color: #000;
}

.ct-saga-item-actual {
    background: var(--ct-accent);
    color: #000;
    font-weight: 700;
}

/* Personas inline (miniaturas en tabla) */
.ct-personas-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ct-persona-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 70px;
    transition: transform 0.2s;
}

.ct-persona-thumb:hover {
    transform: translateY(-2px);
}

.ct-persona-thumb img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.ct-persona-thumb-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--ct-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ct-persona-thumb-placeholder svg {
    width: 22px;
    height: 22px;
    color: #ccc;
}

.ct-persona-thumb span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #bbb;
    margin-top: 4px;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.ct-persona-thumb:hover span {
    color: var(--ct-accent);
}

/* Sinopsis */
.ct-ficha-sinopsis {
    margin-bottom: 20px;
}

.ct-ficha-sinopsis h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #aaa;
    margin: 0 0 8px;
}

.ct-ficha-sinopsis p {
    font-size: 0.9rem;
    color: #999;
    line-height: 1.7;
    margin: 0;
}

/* Trailer */
.ct-ficha-trailer {
    margin-bottom: 20px;
}

.ct-ficha-trailer h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #aaa;
    margin: 0 0 8px;
}

.ct-trailer-embed {
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.ct-trailer-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Stats */
.ct-ficha-stats {
    display: flex;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid #2a2a2a;
}

.ct-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #777;
    font-weight: 500;
}

.ct-stat svg {
    width: 16px;
    height: 16px;
}

/* Section title */
.ct-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 15px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--ct-accent);
    display: inline-block;
}

/* Películas relacionadas (dentro de la ficha) */
.ct-ficha-relaciones {
    margin-bottom: 20px;
}

.ct-ficha-relaciones h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #aaa;
    margin: 0 0 8px;
}

.ct-relacion-tipo {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ct-accent);
    margin: 14px 0 10px;
}

.ct-relacion-tipo:first-of-type {
    margin-top: 4px;
}

.ct-relaciones-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.ct-relacion-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 120px;
    transition: transform 0.2s;
}

.ct-relacion-card:hover {
    transform: translateY(-3px);
}

.ct-relacion-card img {
    width: 120px;
    height: 170px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ct-relacion-no-portada {
    width: 120px;
    height: 170px;
    border-radius: 6px;
    background: var(--ct-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.8rem;
}

.ct-relacion-titulo {
    font-size: 0.8rem;
    font-weight: 600;
    color: #bbb;
    margin-top: 8px;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

.ct-relacion-card:hover .ct-relacion-titulo {
    color: var(--ct-accent);
}

/* Descargas (dentro de la ficha, tras el título) */
.ct-ficha-descargas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 18px;
}

.ct-descarga-btn,
.ct-descarga-btn:visited {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #333;
    color: #ccc;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.ct-descarga-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ct-descarga-btn:hover {
    background: var(--ct-accent);
    color: #000;
}

/* Reparto section */
.ct-reparto-section {
    background: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    padding: 25px;
    margin-bottom: 30px;
}

.ct-reparto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 18px;
}

.ct-actor-card {
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}

.ct-actor-card:hover {
    transform: translateY(-3px);
}

.ct-actor-card:hover .ct-actor-nombre {
    color: var(--ct-accent);
}

.ct-actor-card img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ct-actor-no-foto {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--ct-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.ct-actor-no-foto svg {
    width: 36px;
    height: 36px;
    color: #ccc;
}

.ct-actor-nombre {
    font-size: 0.8rem;
    font-weight: 600;
    color: #bbb;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .ct-ficha {
        flex-direction: column;
    }

    .ct-ficha-portada {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .ct-ficha-titulo {
        font-size: 1.4rem;
        text-align: center;
    }

    .ct-ficha-stats {
        justify-content: center;
    }

}
