/* ============================================================
   ANIMES - MyAnimeList | titulos.css — popup com os títulos da obra
   ============================================================ */

/* ── Botão Lista do card: amarelo enquanto a lista da obra não foi importada ── */
.hover-btn.btn-primary.sem-lista {
    background: #f2c94c;
    border-color: #f7d774;
    color: #1a1a1a;
}

.hover-btn.btn-primary.sem-lista:hover {
    background: #ffd95e;
    border-color: #fff0b3;
}

/* ── Popup ── */
#titulos {
    margin: auto;
    width: min(1180px, 95vw);
    max-height: 92vh;
    padding: 0;
    overflow-y: auto;
    border: 1px solid #8b0000;
    border-radius: 14px;
    background: #141414;
    color: #f3f4f6;
    font-family: 'Satoshi', 'Segoe UI', sans-serif;
}

#titulos::backdrop {
    background: rgba(0, 0, 0, 0.78);
}

.tt-cabeca {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 20, 20, 0.97);
}

.tt-capa-obra {
    flex: none;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    background: #0d0d0d;
}

.tt-titulos {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 3px;
}

.tt-titulos h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.tt-resumo {
    margin: 0;
    color: #c9c3bb;
    font-size: 14px;
    font-weight: 600;
}

.tt-coleta {
    margin: 0;
    color: #7c7c7c;
    font-size: 12.5px;
}

/* Busca do MAL: anime pelo nome, só o que ainda não foi lançado */
.tt-mal {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #d63031;
    border-radius: 10px;
    background: #b41414;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s, border-color 0.18s;
}

.tt-mal:hover {
    background: #d11a1a;
}

.tt-mal svg {
    flex: none;
}

.tt-fechar {
    flex: none;
    align-self: flex-start;
    width: 38px;
    height: 38px;
    border: 1px solid #3b3b3b;
    border-radius: 9px;
    background: #242424;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.tt-fechar:hover {
    background: #b41414;
}

/* Filtros por status (segunda linha do topo fixo) */
.tt-cabeca {
    flex-wrap: wrap;
}

.tt-filtros {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tt-filtros[hidden] {
    display: none;
}

.tt-filtro {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border: 1px solid #333;
    border-radius: 99px;
    background: #1d1d1d;
    color: #d8d3cc;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tt-filtro::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--st, #d63031);
}

.tt-filtro b {
    color: #8f8a83;
    font-weight: 800;
}

.tt-filtro:hover {
    background: #262626;
}

.tt-filtro.ativo {
    border-color: var(--st, #d63031);
    background: color-mix(in srgb, var(--st, #b41414) 22%, #161616);
    color: #fff;
}

.tt-filtro.ativo b {
    color: #fff;
}

/* Barra de resumo fixa no rodapé (as contas da extensão) */
.tt-rodape {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 17, 17, 0.97);
    backdrop-filter: blur(6px);
}

.tt-rodape[hidden] {
    display: none;
}

.tt-rodape-barra {
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
}

.tt-rodape-barra i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #8b0000, #d63031);
}

.tt-rodape-linha {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.tt-rodape-cel {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    color: #a59b92;
    font-size: 13px;
    white-space: nowrap;
}

.tt-rodape-cel:last-child {
    border-right: 0;
}

.tt-rodape-cel svg {
    flex: none;
    color: #d63031;
}

.tt-rodape-cel b {
    color: #f0ece4;
    font-variant-numeric: tabular-nums;
}

.tt-rodape-cel.destaque svg {
    color: var(--cor-progresso, #d63031);
}

.tt-rodape-cel.destaque b {
    color: var(--cor-progresso, #fff);
    font-size: 14px;
}

.tt-grade {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
    padding: 18px 20px 22px;
}

/* ── Card de cada título ── */
.tt-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(180deg, #1c1c1c, #161616);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 6px 16px rgba(0, 0, 0, 0.45);
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s ease;
}

.tt-card:hover {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 12px 28px rgba(0, 0, 0, 0.7);
}

.tt-topo {
    position: relative;
    aspect-ratio: 225 / 318;
    overflow: hidden;
    background: #0b0b0b;
}

.tt-capa {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.tt-card:hover .tt-capa {
    transform: scale(1.04);
}

.tt-selos {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tt-tipo,
.tt-exib,
.tt-nota {
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(9, 9, 9, 0.85);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.tt-exib-1 { background: #cc1a1a; }
.tt-exib-3 { background: #6b4bd1; }

.tt-nota {
    position: absolute;
    right: 8px;
    bottom: 8px;
    color: rgb(254 205 98);
}

/* Estatísticas: quantos episódios faltam, no canto da capa */
.tt-falta {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(9, 9, 9, 0.85);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.tt-tempo {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #c9c3bb;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.tt-tempo svg {
    flex: none;
    width: 12px;
    height: 12px;
    color: #d63031;
}

.tt-tempo.tt-tempo-vazio {
    color: #5e5e5e;
    font-weight: 500;
}

.tt-tempo.tt-tempo-vazio svg {
    color: #5e5e5e;
}

.tt-obra {
    overflow: hidden;
    color: #c9c3bb;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tt-corpo {
    align-content: start;     /* card mais alto na mesma fileira não espalha as linhas */
    display: grid;
    gap: 6px;
    padding: 10px 11px 12px;
}

.tt-nome {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.5em;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
}

.tt-periodo {
    color: #8f8a83;
    font-size: 12px;
}

.tt-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
}

.tt-status {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--st);
    filter: brightness(1.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-status::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tt-eps {
    flex: none;
    color: #d8d3cc;
}

.tt-trilha {
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
}

.tt-barra {
    height: 100%;
    background: var(--st);
}

.tt-vazio {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 56px 24px 64px;
    color: #a9a39b;
    text-align: center;
    line-height: 1.6;
}

.tt-vazio strong {
    color: #fff;
    font-size: 18px;
}

@media (max-width: 720px) {
    .tt-cabeca {
        flex-wrap: wrap;
    }

    .tt-mal {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .tt-grade {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 12px;
    }
}

/* ============================================================
   Verificar novas mídias (API do MAL) — link no cabeçalho e janela de resultados
   ============================================================ */
.mv-linha {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 6px 0 0;
    font-size: 13px;
    color: #9a9a9a;
}

.mv-link {
    color: #e8e8e8;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.mv-link:hover { color: #fff; }

.mv-link.desativado {
    color: #6b6b6b;
    pointer-events: none;
}

.mv-ultima { cursor: default; }

.mv-progresso:not(:empty) { color: #f2c94c; }

.mv-cancelar {
    padding: 2px 10px;
    border: 1px solid #3b3b3b;
    border-radius: 7px;
    background: #242424;
    color: #ddd;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

#mal-novas {
    margin: auto;
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 1px solid #2c2c2c;
    border-radius: 14px;
    background: #141414;
    color: #fff;
    overflow: auto;
}

#mal-novas::backdrop { background: rgba(0, 0, 0, 0.72); }

.mv-cabeca {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #262626;
    background: #141414;
}

.mv-cabeca h2 { margin: 0; font-size: 19px; }

.mv-sub { margin: 4px 0 0; color: #9a9a9a; font-size: 13px; }

.mv-corpo { padding: 16px 20px; }

.mv-grade {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 12px;
}

.mv-card {
    display: grid;
    grid-template-columns: auto 64px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 11px;
    background: #1b1b1b;
    cursor: pointer;
}

.mv-card:has(input:checked) { border-color: #b41414; background: #221616; }

.mv-card.ignorado { opacity: 0.55; cursor: default; }

.mv-card input { width: 17px; height: 17px; accent-color: #b41414; }

.mv-capa {
    width: 64px;
    height: 90px;
    border-radius: 7px;
    object-fit: cover;
    background: #222;
}

.mv-info { display: grid; gap: 4px; min-width: 0; }

.mv-nome { color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }

.mv-nome:hover { text-decoration: underline; }

.mv-en, .mv-situacao { color: #9a9a9a; font-size: 12px; }

.mv-selos { display: flex; flex-wrap: wrap; gap: 5px; }

.mv-selo {
    padding: 2px 7px;
    border-radius: 6px;
    background: #262626;
    color: #cfcfcf;
    font-size: 11px;
    font-weight: 700;
}

.mv-lanc-not_yet_aired { background: #2d2a12; color: #f2c94c; }

.mv-lanc-currently_airing { background: #12263b; color: #6cb6ff; }

.mv-ignorar {
    align-self: start;
    padding: 4px 9px;
    border: 1px solid #333;
    border-radius: 7px;
    background: transparent;
    color: #aaa;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.mv-ignorar:hover { color: #fff; border-color: #555; }

.mv-ignorados { margin-top: 16px; color: #9a9a9a; }

.mv-ignorados summary { cursor: pointer; margin-bottom: 10px; }

.mv-aviso {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-left: 3px solid #f2c94c;
    border-radius: 6px;
    background: #221f12;
    color: #f2e3a6;
    font-size: 13px;
}

.mv-vazio, .mv-nota { color: #bdbdbd; font-size: 14px; }

.mv-ok { color: #6fdc8c; }

.mv-falha { color: #ff8a80; }

.mv-plano {
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid #2a2a2a;
    border-radius: 11px;
    background: #1b1b1b;
}

.mv-plano.atencao { border-color: #6b5a17; }

.mv-plano.pendente { opacity: 0.7; }

.mv-campos { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0; color: #cfcfcf; font-size: 13px; }

.mv-acoes {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #262626;
    background: #141414;
}

.mv-acoes:empty { display: none; }

.mv-botao {
    padding: 9px 16px;
    border: 1px solid #d63031;
    border-radius: 10px;
    background: #b41414;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.mv-botao:hover:not(:disabled) { background: #d11a1a; }

.mv-botao:disabled { opacity: 0.45; cursor: default; }

.mv-botao.secundario { border-color: #3b3b3b; background: #242424; }

.mv-espera { color: #f2c94c; font-size: 13px; }

@media (max-width: 600px) {
    .mv-grade { grid-template-columns: 1fr; }
    .mv-card { grid-template-columns: auto 52px 1fr; }
    .mv-capa { width: 52px; height: 74px; }
    .mv-ignorar { grid-column: 2 / -1; justify-self: start; }
}

.mv-link:focus:not(:focus-visible),
#mal-novas .tt-fechar:focus:not(:focus-visible) { outline: none; }

/* Botão "Lista no MAL" (mesmo link do card), ao lado do "Buscar anunciados" */
.tt-mal[hidden] { display: none; }

.tt-mal.tt-mal-lista {
    border-color: #3b3b3b;
    background: #242424;
}

.tt-mal.tt-mal-lista:hover {
    border-color: #555;
    background: #2e2e2e;
}

/* Resumo da investigação (API + IA) */
.mv-motivo { color: #cfcfcf; font-size: 12px; }

.mv-motivo a, .mv-resumo a { color: #9fc7ff; }

.mv-resumo {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #262626;
    border-radius: 11px;
    background: #171717;
    color: #bdbdbd;
    font-size: 13px;
}

.mv-resumo summary { cursor: pointer; color: #e8e8e8; font-weight: 700; }

.mv-resumo ul { margin: 8px 0; padding-left: 18px; }

.mv-resumo li { margin: 2px 0; }

.mv-resumo-nota { margin: 6px 0 0; color: #9a9a9a; }

.mv-resumo-sub { margin: 10px 0 4px; color: #cfcfcf; }

.mv-resumo-item { margin: 3px 0; color: #bdbdbd; }

.mv-resumo .mv-aviso { margin-top: 8px; }

.mv-descartados { margin-top: 10px; }

.mv-descartados summary { cursor: pointer; color: #9a9a9a; font-weight: 400; font-size: 12px; }
