/* AREA DO RESUMO*/

/* ═══════════════════════════════════════════════════════════════════════
   resumo.css — Sistema de Resumos  (v5 — blocos colapsáveis)
════════════════════════════════════════════════════════════════════════ */

/* ── Toggle de modo ──────────────────────────────────────────────────── */
.mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    margin-bottom: 1.2rem;
}

.mode-btn {
    padding: .38rem 1rem;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.4);
    font-family: 'DM Sans', sans-serif;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.mode-btn i { font-size: .7rem; }
.mode-btn.active { background: rgba(255,255,255,.09); color: rgba(255,255,255,.88); }
.mode-btn:not(.active):hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.6); }


/* ── Wrapper dos resumos ─────────────────────────────────────────────── */
.panel-resumos {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: ckFadeUp .3s ease both;
}

.resumo-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1rem;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    margin-bottom: 2px;
}
.resumo-header-bar .rh-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #b8b8b8;
}
.resumo-header-bar .rh-count {
    font-size: .72rem;
    color: #b8b8b8;
}


/* ── Card da AULA (wrapper externo) ─────────────────────────────────── */
.resumo-card {
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .25s;
    animation: ckFadeUp .35s ease both;
}
.resumo-card:nth-child(2) { animation-delay: .04s; }
.resumo-card:nth-child(3) { animation-delay: .08s; }
.resumo-card:nth-child(4) { animation-delay: .12s; }
.resumo-card:nth-child(5) { animation-delay: .16s; }
.resumo-card:nth-child(6) { animation-delay: .20s; }
.resumo-card:hover { border-color: rgba(255,255,255,.11); }

/* Cabeçalho da aula */
.resumo-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.resumo-card-header:hover { background: rgba(255,255,255,.03); }

.resumo-card-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
}
.resumo-card-icon i { font-size: .75rem; color: rgba(255,255,255,.5); }

.resumo-card.disc-design .resumo-card-icon { background: rgba(231,133,176,.12); border-color: rgba(231,133,176,.2); }
.resumo-card.disc-design .resumo-card-icon i { color: #e785b0; }
.resumo-card.disc-banco  .resumo-card-icon { background: rgba(96,174,245,.12);  border-color: rgba(96,174,245,.2); }
.resumo-card.disc-banco  .resumo-card-icon i { color: #60aef5; }
.resumo-card.disc-redes  .resumo-card-icon { background: rgba(168,85,247,.12);  border-color: rgba(168,85,247,.2); }
.resumo-card.disc-redes  .resumo-card-icon i { color: #a855f7; }
.resumo-card.disc-poo    .resumo-card-icon { background: rgba(245,184,76,.12);  border-color: rgba(245,184,76,.2); }
.resumo-card.disc-poo    .resumo-card-icon i { color: #f5b84c; }

.resumo-card-meta { flex: 1; min-width: 0; }
.resumo-card-titulo {
    font-size: .855rem;
    font-weight: 700;
    color: #eaeaea;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.01em;
    font-family: 'DM Sans', sans-serif;
}
.resumo-card-sub { font-size: .68rem; color: rgba(255,255,255,.38); margin-top: 2px; }

.resumo-chevron {
    color: rgba(255,255,255,.25);
    font-size: .72rem;
    transition: transform .25s ease, color .2s;
    flex-shrink: 0;
}
.resumo-card.expanded .resumo-chevron { transform: rotate(180deg); color: rgba(255,255,255,.5); }


/* ── Corpo expansível ────────────────────────────────────────────────── */
.resumo-card-body {
    display: none;
    border-top: 1px solid rgba(255,255,255,.06);
}
.resumo-card.expanded .resumo-card-body {
    display: block;
    animation: resumoExpand .28s ease;
}
@keyframes resumoExpand {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── Grid de tópicos ─────────────────────────────────────────────────── */
.resumo-body-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 14px 6px;
}


/* ── Bloco de tópico (colapsável) ────────────────────────────────────── */
.resumo-bloco {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    overflow: hidden;
    transition: background .18s, border-color .18s;
}
.resumo-bloco:hover {
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.1);
}

/* Header clicável do bloco */
.resumo-bloco-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    gap: .5rem;
    transition: background .15s;
}
.resumo-bloco-header:hover {
    background: rgba(255,255,255,.03);
}

/* Chevron do bloco */
.bloco-chevron {
    color: rgba(255,255,255,.2);
    font-size: .6rem;
    transition: transform .22s ease, color .15s;
    flex-shrink: 0;
    margin-left: auto;
}
.resumo-bloco.bloco-aberto .bloco-chevron {
    transform: rotate(180deg);
    color: rgba(255,255,255,.4);
}

/* Conteúdo colapsável do bloco */
.resumo-bloco-conteudo {
    display: none;
    padding: 12px 14px 14px;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,.05);
}
.resumo-bloco.bloco-aberto .resumo-bloco-conteudo {
    display: flex;
    animation: resumoExpand .2s ease both;
}


/* ── Título do bloco (chip) ──────────────────────────────────────────── */
.resumo-bloco-titulo {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    align-self: flex-start;
    padding: 3px 10px 3px 8px;
    border-radius: 20px;
    border: 1px solid transparent;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    line-height: 1.3;
    font-family: 'DM Sans', sans-serif;
}
.resumo-bloco-titulo i { font-size: .56rem; opacity: .8; }

.resumo-card.disc-design .resumo-bloco-titulo {
    background: rgba(231,133,176,.1);
    border-color: rgba(231,133,176,.22);
    color: #e785b0;
}
.resumo-card.disc-banco .resumo-bloco-titulo {
    background: rgba(96,174,245,.1);
    border-color: rgba(96,174,245,.22);
    color: #60aef5;
}
.resumo-card.disc-redes .resumo-bloco-titulo {
    background: rgba(168,85,247,.1);
    border-color: rgba(168,85,247,.22);
    color: #a855f7;
}
.resumo-card.disc-poo .resumo-bloco-titulo {
    background: rgba(245,184,76,.1);
    border-color: rgba(245,184,76,.22);
    color: #f5b84c;
}

.resumo-bloco-texto {
    font-size: .875rem;
    line-height: 1.7;
    color: rgba(255,255,255,.82);
    font-weight: 400;
    letter-spacing: .005em;
    font-family: 'DM Sans', sans-serif;
    margin: 0;
}


/* ── Barra de ações ──────────────────────────────────────────────────── */
.resumo-card-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255,255,255,.04);
}

.resumo-action-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .8rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.5);
    font-family: 'DM Sans', sans-serif;
    font-size: .72rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s;
    white-space: nowrap;
}
.resumo-action-btn i { font-size: .64rem; }
.resumo-action-btn:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: rgba(255,255,255,.8);
}
.resumo-action-btn.btn-copiar.copied {
    background: rgba(124,90,243,.1);
    border-color: rgba(124,90,243,.3);
    color: #a78bfa;
}

/* Botão expandir/contrair todos os tópicos */
.resumo-action-btn.btn-expandir-blocos {
    margin-left: auto;
}


/* ── Toast ───────────────────────────────────────────────────────────── */
.resumo-toast {
    position: fixed;
    bottom: 2rem; left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: rgba(20,20,20,.95);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    padding: .55rem 1.1rem;
    font-size: .8rem;
    color: rgba(255,255,255,.85);
    display: flex; align-items: center; gap: .5rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    z-index: 999;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}
.resumo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.resumo-toast i { color: #34d399; font-size: .75rem; }


/* ── Responsivo ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .mode-toggle { margin-left: 0; }
    .resumo-body-inner { padding: 10px 8px 4px; gap: 6px; }
    .resumo-bloco-header { padding: 9px 12px; }
    .resumo-bloco-conteudo { padding: 10px 12px 12px; }
    .resumo-bloco-texto { font-size: .845rem; }
    .resumo-card-actions { padding: 10px 12px 14px; }
}

.resumo-lista {
    margin: 0;
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resumo-lista li {
    font-size: .875rem;
    line-height: 1.65;
    color: rgba(255,255,255,.78);
    font-family: 'DM Sans', sans-serif;
    padding-left: 0.2rem;
}

/* ── Botões Flutuantes — Tab lateral retrátil ────────────────────────── */
.fab-group {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    z-index: 50;

    --fab-w: 40px;
}

/* Trilho interno que desliza */
.fab-group-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    padding: .6rem .5rem;
    background: rgba(14,14,14,.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08);
    border-right: none;
    border-radius: 14px 0 0 14px;
    box-shadow: -4px 0 24px rgba(0,0,0,.45);

    /* Escondida para fora — padrão desktop */
    transform: translateX(calc(100% + 1px));
    opacity: 0;
    transition: transform .5s cubic-bezier(.4, 0, .2, 1),
                opacity .4s ease;
    pointer-events: none;
}

/* Orelha — visível apenas no desktop */
.fab-ear {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 80px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    border-right: none;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: width .22s ease, background .18s;
    box-shadow: -3px 0 12px rgba(0,0,0,.4);
}
.fab-ear::before {
    content: '';
    width: 2px;
    height: 22px;
    background: rgba(255,255,255,.45);
    border-radius: 2px;
    transition: background .18s;
}

/* ── Desktop: abre no hover ──────────────────────────────────────────── */
@media (min-width: 721px) {
    .fab-group:hover .fab-group-inner {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
    .fab-group:hover .fab-ear {
        width: 12px;
        background: rgba(255,255,255,.12);
    }
    .fab-group:hover .fab-ear::before {
        background: rgba(255,255,255,.7);
    }
}

/* ── Mobile: trilho sempre visível, orelha oculta ────────────────────── */
@media (max-width: 720px) {
    .fab-group {
        top: auto;
        bottom: 5rem;
        transform: none;
    }
    .fab-group-inner {
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        border-radius: 14px;
        border-right: 1px solid rgba(255,255,255,.08);
    }
    .fab-ear {
        display: none !important;
    }
}


/* Botões individuais */
.fab-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.45);
    font-size: .75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s, border-color .18s, color .18s, transform .15s;
    flex-shrink: 0;
}
.fab-btn:hover {
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.18);
    color: rgba(255,255,255,.9);
    transform: scale(1.07);
}
.fab-btn:active { transform: scale(.93); }

.fab-btn.fab-collapse {
    border-color: rgba(124,90,243,.2);
    color: rgba(167,139,250,.7);
}
.fab-btn.fab-collapse:hover {
    background: rgba(124,90,243,.12);
    border-color: rgba(124,90,243,.45);
    color: #c4b5fd;
}

/* Divisor entre botões */
.fab-divider {
    width: 22px;
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: .05rem 0;
}


/* ── Imagens de Topologia ────────────────────────────────────────────── */
.resumo-bloco-imagem {
    width: 100%;
    max-width: 420px;
    margin-right: auto;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.2);
}

.resumo-bloco-imagem img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: contain;
    transition: transform .3s ease, opacity .3s ease;
}

.resumo-bloco-imagem img[src=""],
.resumo-bloco-imagem img:not([src]) {
    display: none;
}