/* =========================================================================
   mural.css - SISTEMA VISUAL DO MURAL, AGENDA E ALERTAS PEDAGÓGICOS
   Portal do Careca • Prof. Raphael Paulino
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. ANIMAÇÕES LOCAIS (AUTONOMIA MODULAR)
   ------------------------------------------------------------------------- */
@keyframes fadeInMural {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------------------------------------------------------------
   2. ESTRUTURA GERAL (GRID DESKTOP)
   ------------------------------------------------------------------------- */
.mural-layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
    box-sizing: border-box;
    margin-top: 16px;
}

/* -------------------------------------------------------------------------
   3. BANNERS DE ALERTA PRIORITÁRIO & GRAUS DE URGÊNCIA
   ------------------------------------------------------------------------- */
.mural-stack-alertas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.mural-banner-urgente {
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    animation: fadeInMural 0.25s ease forwards;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card, #23324d);
    transition: all 0.2s ease;
}

/* 3.1 Visto Devolvido (Prioridade Máxima) */
.mural-banner-urgente.alerta-devolvido {
    border-left: 3px solid var(--accent-rose, #f43f5e);
}
.alerta-devolvido .mural-banner-titulo { color: var(--text-main, #f8fafc); }
.alerta-devolvido .destaque-vermelho { color: #fca5a5; font-weight: 700; }
.alerta-devolvido .mural-banner-btn {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fca5a5;
}
.alerta-devolvido .mural-banner-btn:hover {
    background: rgba(244, 63, 94, 0.22);
    color: #ffffff;
}

/* 3.2 É Hoje (D-0, até às 23:59) */
.mural-banner-urgente.alerta-hoje {
    background: rgba(249, 115, 22, 0.06);
    border-color: rgba(249, 115, 22, 0.25);
    border-left: 3px solid #f97316;
}
.alerta-hoje .mural-banner-titulo { color: #fdba74; }
.alerta-hoje .mural-banner-btn {
    background: rgba(249, 115, 22, 0.14);
    border: 1px solid rgba(249, 115, 22, 0.45);
    color: #fb923c;
    font-weight: 800;
}
.alerta-hoje .mural-banner-btn:hover {
    background: rgba(249, 115, 22, 0.24);
    color: #ffffff;
}

/* 3.3 Amanhã (D-1, 24 horas) */
.mural-banner-urgente.alerta-24h {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.22);
    border-left: 3px solid var(--accent-amber, #f59e0b);
}
.alerta-24h .mural-banner-titulo { color: #fde68a; }
.alerta-24h .mural-banner-btn {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}
.alerta-24h .mural-banner-btn:hover {
    background: rgba(245, 158, 11, 0.22);
    color: #ffffff;
}

/* 3.4 Em 48 Horas (D-2) */
.mural-banner-urgente.alerta-48h {
    background: rgba(56, 189, 248, 0.04);
    border-color: rgba(56, 189, 248, 0.2);
    border-left: 3px solid var(--accent-blue, #38bdf8);
}
.alerta-48h .mural-banner-titulo { color: #bae6fd; }
.alerta-48h .mural-banner-btn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent-blue, #38bdf8);
}
.alerta-48h .mural-banner-btn:hover {
    background: rgba(56, 189, 248, 0.22);
    color: #ffffff;
}

/* 3.5 Visto Avaliado Recentemente */
.mural-banner-urgente.alerta-vistado {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.25);
    border-left: 3px solid var(--accent-emerald, #10b981);
}
.alerta-vistado .mural-banner-titulo { color: #6ee7b7; }
.alerta-vistado .mural-banner-btn {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--accent-emerald, #10b981);
}

.mural-banner-conteudo {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.mural-banner-titulo {
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mural-banner-sub {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.35;
}

.mural-banner-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mural-banner-btn {
    padding: 6px 14px;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-dispensar-banner {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-card, #23324d);
    color: var(--text-muted, #94a3b8);
    padding: 6px 14px;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    height: 30px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-dispensar-banner:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main, #f8fafc);
    border-color: #475569;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

/* -------------------------------------------------------------------------
   4. FEED DE COMUNICADOS & CARDS DE RECADOS
   ------------------------------------------------------------------------- */
.mural-feed-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mural-card-recado {
    background: var(--bg-card, #182238);
    border: 1px solid var(--border-card, #23324d);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.mural-card-recado:hover { 
    border-color: rgba(56, 189, 248, 0.35); 
}

.mural-card-recado.tipo-PROVA { border-left: 3px solid #818cf8; }
.mural-card-recado.tipo-URGENTE { border-left: 3px solid var(--accent-rose, #f43f5e); }
.mural-card-recado.tipo-TRABALHO { border-left: 3px solid var(--accent-amber, #f59e0b); }
.mural-card-recado.tipo-AVISO { border-left: 3px solid var(--accent-blue, #38bdf8); }
.mural-card-recado.tipo-LEMBRETE { border-left: 3px solid var(--accent-emerald, #10b981); }

.mural-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.mural-card-tags {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mural-pill-tipo {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tipo-PROVA .mural-pill-tipo { background: rgba(129, 140, 248, 0.15); color: #a5b4fc; }
.tipo-URGENTE .mural-pill-tipo { background: rgba(244, 63, 94, 0.15); color: #fca5a5; }
.tipo-TRABALHO .mural-pill-tipo { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.tipo-AVISO .mural-pill-tipo { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.tipo-LEMBRETE .mural-pill-tipo { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

.txt-fixado-tag {
    font-size: 0.65rem;
    color: var(--accent-amber, #f59e0b);
    font-weight: 700;
}

.mural-card-data { 
    font-size: 0.72rem; 
    color: var(--text-muted, #94a3b8); 
}

.mural-card-titulo { 
    font-size: 0.95rem; 
    font-weight: 700; 
    color: var(--text-main, #f8fafc); 
    margin: 0; 
}

.mural-card-corpo { 
    font-size: 0.82rem; 
    color: #cbd5e1; 
    line-height: 1.45; 
    white-space: pre-line; 
}

/* Proteção para fórmulas matemáticas dentro do corpo do recado */
.mural-card-corpo mjx-container {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    vertical-align: middle !important;
}

.mural-card-rodape {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border-card, #23324d);
    padding-top: 8px;
    margin-top: 2px;
}

.mural-btn-ciente {
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
    color: var(--accent-blue, #38bdf8);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.mural-btn-ciente:hover { 
    background: rgba(56, 189, 248, 0.18); 
}

.mural-btn-ciente:disabled,
.mural-btn-ciente.confirmado {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald, #10b981);
    cursor: default;
    opacity: 0.8;
    box-shadow: none;
}

.mural-vazio-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border-card, #23324d);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted, #94a3b8);
}

.mural-vazio-titulo {
    color: var(--text-main, #f8fafc);
    display: block;
    margin-bottom: 2px;
    font-weight: 700;
}

/* -------------------------------------------------------------------------
   5. HISTÓRICO RETRÁTIL DE COMUNICADOS
   ------------------------------------------------------------------------- */
.mural-historico-secao {
    margin-top: 28px;
    border-top: 1px dashed var(--border-card, #23324d);
    padding-top: 14px;
}

.mural-historico-titulo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    margin-bottom: 12px;
}

.mural-historico-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mural-timeline-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-timeline-recado {
    display: flex;
    gap: 10px;
    font-size: 0.76rem;
    line-height: 1.35;
    padding-left: 2px;
}

.dot-timeline-recado {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
    background: #64748b;
}

.item-timeline-recado-corpo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.txt-recado-hist-titulo { color: #e2e8f0; font-weight: 600; }
.txt-recado-hist-conteudo { color: var(--text-muted, #94a3b8); font-size: 0.72rem; }
.txt-recado-hist-ciente { color: var(--accent-emerald, #10b981); font-size: 0.68rem; font-style: italic; margin-top: 2px; }

/* -------------------------------------------------------------------------
   6. AGENDA LATERAL & TOLERÂNCIA DE 15 DIAS
   ------------------------------------------------------------------------- */
.mural-lateral-coluna {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mural-widget-card {
    background: var(--bg-card, #182238);
    border: 1px solid var(--border-card, #23324d);
    border-radius: 10px;
    padding: 16px;
    box-sizing: border-box;
}

.mural-widget-titulo {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-card, #23324d);
}

.mural-agenda-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mural-agenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-card, #23324d);
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* 6.1 Status: É Hoje (D-0) */
.mural-agenda-item.status-hoje {
    background: rgba(245, 158, 11, 0.08);
    border: 1.5px solid var(--accent-amber, #f59e0b);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}
.mural-agenda-item.status-hoje .mural-agenda-data-box {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #0b0f19;
}
.mural-agenda-item.status-hoje .mural-agenda-dia,
.mural-agenda-item.status-hoje .mural-agenda-mes {
    color: #0b0f19;
    font-weight: 900;
}
.mural-agenda-item.status-hoje .mural-agenda-countdown {
    color: #f59e0b;
    font-weight: 800;
}

/* 6.2 Status: Tolerância (1 a 15 dias de atraso) */
.mural-agenda-item.status-tolerancia {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.4);
    border-left: 3px solid #f97316;
}
.mural-agenda-item.status-tolerancia .mural-agenda-data-box {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.35);
    color: #fb923c;
}
.mural-agenda-item.status-tolerancia .mural-agenda-countdown {
    color: #fb923c;
    font-weight: 700;
}

/* 6.3 Status: Próximos (1 a 7 dias) */
.mural-agenda-item.status-urgente {
    border-color: rgba(56, 189, 248, 0.4);
}
.mural-agenda-item.status-urgente .mural-agenda-data-box {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
    color: var(--accent-blue, #38bdf8);
}
.mural-agenda-item.status-urgente .mural-agenda-countdown {
    color: var(--accent-blue, #38bdf8);
}

/* 6.4 Status: Distantes (> 7 dias) */
.mural-agenda-item.status-distante {
    opacity: 0.65;
    border-color: rgba(35, 50, 77, 0.5);
    background: rgba(0, 0, 0, 0.15);
}
.mural-agenda-item.status-distante .mural-agenda-data-box {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-card, #23324d);
    color: var(--text-muted, #94a3b8);
}
.mural-agenda-item.status-distante .mural-agenda-countdown {
    color: var(--text-muted, #94a3b8);
    font-weight: 400;
}

.mural-agenda-data-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border-card, #23324d);
}
.mural-agenda-dia { font-size: 0.92rem; font-weight: 800; line-height: 1; }
.mural-agenda-mes { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.mural-agenda-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; flex: 1; }
.mural-agenda-nome { font-size: 0.78rem; font-weight: 700; color: var(--text-main, #f8fafc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mural-agenda-countdown { font-size: 0.68rem; font-weight: 600; }

/* 6.5 Bloco Retrátil de Anteriores / Concluídos */
.mural-agenda-passados-bloco {
    margin-top: 12px;
    border-top: 1px dashed var(--border-card, #23324d);
    padding-top: 10px;
}

.btn-toggle-passados-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card, #23324d);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
}

.btn-toggle-passados-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.3);
}

.lbl-passados-btn {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-qtd-passados {
    background: var(--bg-secondary, #131b2e);
    border: 1px solid var(--border-card, #23324d);
    color: var(--text-main, #f8fafc);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 8px;
}

.mural-agenda-item.status-encerrado {
    opacity: 0.55;
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.25);
}
.mural-agenda-item.status-encerrado .mural-agenda-data-box {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
}
.mural-agenda-item.status-encerrado .mural-agenda-countdown {
    color: #ef4444;
    font-weight: 700;
}

.mural-agenda-item.status-concluido {
    opacity: 0.6;
    background: rgba(16, 185, 129, 0.04);
}
.mural-agenda-item.status-concluido .mural-agenda-data-box {
    color: var(--accent-emerald, #10b981);
    border-color: rgba(16, 185, 129, 0.2);
}
.mural-agenda-item.status-concluido .mural-agenda-countdown {
    color: var(--accent-emerald, #10b981);
}

.badge-alerta-sidebar {
    background: var(--danger, #ef4444);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: auto;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* -------------------------------------------------------------------------
   7. ITENS DO DROPDOWN DE NOTIFICAÇÕES (SININHO DO TOPO)
   ------------------------------------------------------------------------- */
.notif-item {
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, transform 0.15s ease;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.notif-duvida {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-left: 3px solid var(--accent-emerald, #10b981);
}

.notif-devolvido {
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.35);
    border-left: 3px solid var(--accent-rose, #f43f5e);
}

.notif-avaliado {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-left: 3px solid var(--accent-emerald, #10b981);
}

.notif-aviso-geral {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-card, #23324d);
    border-left: 3px solid var(--accent-blue, #38bdf8);
}

.notif-conteudo-clamp {
    font-size: 0.72rem;
    color: #cbd5e1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   8. RESPONSIVIDADE UNIFICADA (BREAKPOINTS NO FINAL)
   ------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .mural-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .mural-layout-grid {
        margin-top: 10px;
        gap: 16px;
    }

    .mural-banner-urgente {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }

    .mural-banner-conteudo {
        width: 100%;
    }

    .mural-banner-titulo {
        font-size: 0.84rem;
        line-height: 1.3;
    }

    .mural-banner-sub {
        font-size: 0.75rem;
    }

    .mural-banner-acoes {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .mural-banner-acoes .mural-banner-btn,
    .mural-banner-acoes .btn-dispensar-banner {
        width: 100%;
        height: 34px;
        justify-content: center;
        text-align: center;
        font-size: 0.75rem;
    }

    .mural-card-recado {
        padding: 12px 14px;
    }

    .mural-card-titulo {
        font-size: 0.9rem;
    }

    .mural-widget-card {
        padding: 12px;
    }

    .mural-agenda-item {
        padding: 8px;
    }
}

@media (hover: none) {
    .btn-dispensar-banner:hover {
        background: rgba(255, 255, 255, 0.04);
        box-shadow: none;
    }
}