/* ============================================================
 * Arquivo: comentarios/assets/css/ltacm-comentarios.css
 * Projeto: Law Thesis - Área do Aluno
 * Pasta:   comentarios/assets/css/
 * Módulo:  Comentários de Estudantes (LTA_Comentarios)
 * Prefixo CSS: ltacm-  (único, não reutilizar em outros módulos)
 * ============================================================
 * Descrição:
 *   Estilos do widget de comentários. TODAS as classes são
 *   prefixadas com ltacm- para eliminar o vazamento/colisão que
 *   existia no módulo anterior (classes genéricas .loading,
 *   .contador, .separator, .editor-*, etc.). Escopo reforçado pela
 *   raiz .ltacm-widget.
 *
 * Regras:
 *   - NUNCA usar !important (resolver por especificidade)
 *   - Unidades em px
 *   - Todas as classes prefixadas com ltacm-
 *
 * ⚠️ NÃO REMOVER blocos marcados ao longo do arquivo.
 * ============================================================ */

/* ============================================================
   RAIZ E TOKENS (variáveis locais ao widget)
   ============================================================ */
.ltacm-widget {
    --ltacm-bg: #ffffff;
    --ltacm-borda: #2A2D35;
    --ltacm-texto: #1f2d3d;
    --ltacm-suave: #5a6b7b;
    --ltacm-primario: #f2711c;
    --ltacm-primario-hover: #e0600f;
    --ltacm-verde: #21ba45;
    --ltacm-perigo: #db2828;
    --ltacm-bolha: #f5f7f9;
    --ltacm-header: #eef1f4;

    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Sen', Arial, sans-serif;
    color: var(--ltacm-texto);
}

.ltacm-widget *,
.ltacm-widget *::before,
.ltacm-widget *::after {
    box-sizing: border-box;
}

/* ============================================================
   GATILHO "Comentários (N)"
   ============================================================ */
.ltacm-gatilho {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--ltacm-texto);
    transition: color 0.2s ease, background 0.2s ease;
}

.ltacm-gatilho:hover { color: var(--ltacm-primario); }

.ltacm-gatilho__icone { display: inline-flex; align-items: center; color: var(--ltacm-suave); flex-shrink: 0; }

.ltacm-gatilho__contador { color: var(--ltacm-suave); font-weight: 600; }

.ltacm-gatilho__seta { transition: transform 0.25s ease; flex-shrink: 0; }

.ltacm-gatilho--aberto .ltacm-gatilho__seta { transform: rotate(180deg); }

/* ============================================================
   ÁREA EXPANSÍVEL
   ============================================================ */
.ltacm-area {
    margin-top: 6px;
    padding: 10px;
    background: var(--ltacm-bg);
    border: 1px solid var(--ltacm-borda);
    border-radius: 10px;
}

/* ============================================================
   FORMULÁRIO DE NOVO COMENTÁRIO
   ============================================================ */
.ltacm-form {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #2A2D35;
}

.ltacm-form__autor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    width: 88px;
}

.ltacm-form__nome {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ltacm-editor-wrap { flex: 1; min-width: 0; }

/* ============================================================
   EDITOR (toolbar + campo)
   ============================================================ */
.ltacm-editor {
    border: 1px solid var(--ltacm-borda);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.ltacm-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: var(--ltacm-header);
    border-bottom: 1px solid var(--ltacm-borda);
}

.ltacm-tbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 12px;
    padding: 0 5px;
    font-size: 11px;
    color: var(--ltacm-texto);
    background: #ffffff;
    border: 1px solid var(--ltacm-borda);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ltacm-tbtn:hover {
    background: var(--ltacm-primario);
    border-color: var(--ltacm-primario);
    color: #ffffff;
}

/* Ajuste de raio dos botões da toolbar (especificidade extra para
   vencer o arredondamento em pílula vindo do tema/Elementor). */
.ltacm-widget .ltacm-toolbar .ltacm-tbtn {
    border-radius: 6px;
}

/* Aumenta apenas o glifo "×" (botão "X" Limpar da Tollbar), que herdava fonte pequena. */
.ltacm-widget .ltacm-toolbar .ltacm-tbtn[data-ltacm="limpar"] {
    font-size: 30px;
    line-height: 1;
}

.ltacm-sep {
    width: 1px;
    height: 20px;
    background: var(--ltacm-borda);
    margin: 0 3px;
}

.ltacm-editor__campo {
    min-height: 96px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ltacm-texto);
    background: #ffffff;
    cursor: text;
}

.ltacm-editor__campo:empty::before {
    content: attr(data-ltacm-placeholder);
    color: #9aa4ad;
    font-style: italic;
    pointer-events: none;
}

/* ============================================================
   SELETOR DE COR
   ============================================================ */
.ltacm-cor { position: relative; }

.ltacm-cor__menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: 128px;
    padding: 8px;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid var(--ltacm-borda);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.ltacm-cor__menu[hidden] { display: none; }

.ltacm-cor__item {
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.ltacm-cor__item:hover { transform: scale(1.12); border-color: #333333; }

/* ============================================================
   RODAPÉ DO FORMULÁRIO + CONTADOR
   ============================================================ */
.ltacm-form__rodape {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.ltacm-contador { font-size: 12px; color: var(--ltacm-suave); }

.ltacm-contador--alerta { color: var(--ltacm-perigo); }

/* ============================================================
   BOTÕES
   ============================================================ */
.ltacm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.ltacm-btn--primario { background: var(--ltacm-primario); color: #ffffff; }
.ltacm-btn--primario:hover { background: var(--ltacm-primario-hover); }
.ltacm-btn--primario:disabled { background: #c9ced3; cursor: not-allowed; }

.ltacm-btn--cancelar { background: #e2e6ea; color: var(--ltacm-texto); }
.ltacm-btn--cancelar:hover { background: #d3d9de; }

.ltacm-btn--fechar {
    background: transparent;
    color: var(--ltacm-suave);
    padding: 6px 10px;
}
.ltacm-btn--fechar:hover { color: var(--ltacm-primario); }
.ltacm-btn--fechar .ltacm-gatilho__seta,
.ltacm-btn--fechar svg { transform: rotate(180deg); }

.ltacm-btn--mais {
    background: var(--ltacm-verde);
    color: #ffffff;
}
.ltacm-btn--mais:hover { background: #16ab39; }
.ltacm-btn--mais:disabled { background: #c9ced3; cursor: not-allowed; }

/* ============================================================
   AVISO DE LOGIN
   ============================================================ */
.ltacm-login-aviso {
    padding: 22px;
    text-align: center;
    color: var(--ltacm-suave);
    font-size: 15px;
    background: var(--ltacm-bolha);
    border-radius: 8px;
    margin-bottom: 16px;
}

/* ============================================================
   FLASH (mensagens de erro/sucesso)
   ============================================================ */
.ltacm-flash {
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #ffffff;
}
.ltacm-flash--erro { background: var(--ltacm-perigo); }
.ltacm-flash--ok { background: var(--ltacm-verde); }

/* ============================================================
   LISTA E ITENS
   ============================================================ */
.ltacm-lista { margin-top: 4px; }

.ltacm-vazio {
    padding: 8px 10px;
    text-align: center;
    color: var(--ltacm-suave);
    font-size: 14px;
}

.ltacm-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.ltacm-item__autor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    width: 96px;
}

.ltacm-item__nome {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ltacm-item__corpo {
    flex: 1;
    min-width: 0;
    background: var(--ltacm-bolha);
    border: 1px solid var(--ltacm-borda);
    border-radius: 8px;
    overflow: hidden;
}

.ltacm-item__cabecalho {
    padding: 8px 12px;
    background: var(--ltacm-header);
    border-bottom: 1px solid var(--ltacm-borda);
}

.ltacm-item__data { font-size: 12px; color: var(--ltacm-suave); }

.ltacm-item__texto {
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ltacm-texto);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ltacm-item__texto p { margin: 0 0 8px; }
.ltacm-item__texto p:last-child { margin-bottom: 0; }
.ltacm-item__texto ul,
.ltacm-item__texto ol { margin: 0 0 8px 20px; }

/* ============================================================
   AÇÕES DO COMENTÁRIO
   ============================================================ */
.ltacm-item__acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: #eef1f4;
    border-top: 1px solid var(--ltacm-borda);
}

.ltacm-acao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 500;
    color: #ffffff;
    background: #5a6b7b;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.ltacm-acao:hover { background: #48586a; }

.ltacm-acao--concordo.ltacm-acao--ativo { background: var(--ltacm-verde); }
.ltacm-acao--concordo.ltacm-acao--ativo:hover { background: #16ab39; }

/* "Concordo" bloqueado (autor do próprio comentário) — sem hover/ação. */
.ltacm-acao--bloqueado { background: #8a94a0; cursor: not-allowed; opacity: 0.7; }
.ltacm-acao--bloqueado:hover { background: #8a94a0; }

.ltacm-acao--perigo { background: #c14b4b; }
.ltacm-acao--perigo:hover { background: var(--ltacm-perigo); }

/* ============================================================
   RESPOSTAS ANINHADAS
   ============================================================ */
.ltacm-respostas {
    margin-top: 14px;
    padding-left: 18px;
    border-left: 3px solid var(--ltacm-verde);
}

.ltacm-respostas[hidden] { display: none; }

.ltacm-item--resposta { margin-bottom: 14px; }
.ltacm-item--resposta .ltacm-item__autor { width: 64px; }
.ltacm-item--resposta .ltacm-item__nome { width: 64px; font-size: 10px; }
.ltacm-item--resposta .ltacm-item__corpo { background: #eef1f4; }
.ltacm-item--resposta .ltacm-item__cabecalho { background: #e2e6ea; }

/* ============================================================
   FORMULÁRIO DE RESPOSTA
   ============================================================ */
.ltacm-responder:empty { display: none; }

.ltacm-resp-form {
    margin-top: 14px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--ltacm-borda);
    border-radius: 8px;
}

.ltacm-resp-form__cab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--ltacm-borda);
}

.ltacm-resp-form__info { font-size: 13px; color: var(--ltacm-suave); }
.ltacm-resp-form__info strong { color: var(--ltacm-texto); }

.ltacm-resp-form__campo {
    width: 100%;
    min-height: 76px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ltacm-texto);
    background: #ffffff;
    border: 1px solid var(--ltacm-borda);
    border-radius: 6px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.ltacm-resp-form__campo:focus { border-color: var(--ltacm-primario); }

.ltacm-resp-form__rodape {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.ltacm-resp-form__contador { font-size: 12px; color: var(--ltacm-suave); }
.ltacm-resp-form__btns { display: flex; gap: 8px; }

/* ============================================================
   INFO / CARREGAR MAIS / RODAPÉ
   ============================================================ */
.ltacm-info {
    padding: 14px 0;
    margin-top: 6px;
    text-align: center;
    font-size: 13px;
    color: var(--ltacm-suave);
    border-top: 1px solid var(--ltacm-borda);
}

.ltacm-mais-wrap { text-align: center; padding: 8px 0 4px; }

.ltacm-area__rodape {
    text-align: right;
    padding-top: 5px;
    margin-top: 5px;
    border-top: 1px solid #2A2D35;
}

/* ============================================================
   AVATARES
   ============================================================ */
.ltacm-avatar {
    border-radius: 50%;
    object-fit: cover;
    background: #e2e6ea;
    display: block;
    flex-shrink: 0;
}
.ltacm-avatar--md { width: 56px; height: 56px; }
.ltacm-avatar--sm { width: 70px; height: 70px; }
.ltacm-avatar--xs { width: 45px; height: 45px; }

/* ============================================================
   EDIÇÃO INLINE
   ============================================================ */
.ltacm-edicao { margin: 4px 0; }
.ltacm-edicao__campo { min-height: 80px; }

/* ============================================================
   SKELETON (carregando)
   ============================================================ */
@keyframes ltacm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.ltacm-skel {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    animation: ltacm-pulse 1.4s ease-in-out infinite;
}
.ltacm-skel__av { width: 48px; height: 48px; border-radius: 50%; background: #e2e6ea; flex-shrink: 0; }
.ltacm-skel__linha { flex: 1; height: 78px; border-radius: 8px; background: #eef1f4; }

/* ============================================================
   UPLOADER DE AVATAR (shortcode)
   ============================================================ */
.ltacm-uploader {
    max-width: 400px;
    margin: 20px auto;
    padding: 24px;
    text-align: center;
    background: #c9cdd2;
    border: 1px solid var(--ltacm-borda, #e2e6ea);
    border-radius: 12px;
}
.ltacm-uploader__titulo { margin: 0 0 18px; font-size: 17px; }
.ltacm-uploader__preview {
    width: 120px; height: 120px;
    margin: 0 auto 18px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #e2e6ea;
}
.ltacm-uploader__acoes { display: flex; justify-content: center; gap: 8px; }
.ltacm-uploader__btn {
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #3498db;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.ltacm-uploader__btn--salvar { background: #21ba45; }
.ltacm-uploader__btn[hidden] { display: none; }
.ltacm-uploader__dica { margin: 14px auto 0; max-width: 300px; font-size: 12.5px; color: #7a8590; line-height: 1.5; }
.ltacm-uploader__msg { margin-top: 14px; padding: 10px; border-radius: 6px; font-size: 13px; color: #ffffff; }
.ltacm-uploader__msg--ok { background: #21ba45; }
.ltacm-uploader__msg--erro { background: #db2828; }
.ltacm-uploader__msg[hidden] { display: none; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1024px) {
    .ltacm-form { flex-direction: column; gap: 12px; }
    .ltacm-form__autor { flex-direction: row; width: 100%; }
    .ltacm-form__nome { max-width: none; }

    .ltacm-item { flex-direction: column; gap: 10px; }
    .ltacm-item__autor { flex-direction: row; width: 100%; }
    .ltacm-item__nome { width: auto; }
    .ltacm-item--resposta .ltacm-item__autor { width: 100%; }
    .ltacm-item--resposta .ltacm-item__nome { width: auto; }
}

@media (max-width: 768px) {
    .ltacm-area { padding: 5px; }
    .ltacm-acao { font-size: 9px; padding: 3px 7px; }
    .ltacm-respostas { padding-left: 10px; }
}