/**
 * ================================================================
 * ARQUIVO: comentarios.css
 * PASTA: assets/css/comentarios.css
 * DESCRIÇÃO: Estilos do sistema de comentários - REVISADO
 * VERSÃO: 4.0
 * DATA: 2025-12-20
 * ================================================================
 */

/* ============================================================
   RESET E BASE
   ============================================================ */

.comments-widget { 
    background: #0A0A0A; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); 
    max-width: 1200px; 
    margin: 0 auto; 
    position: relative; 
    z-index: 1; 
    overflow: hidden; 
}

/* ============================================================
   BOTÃO PRINCIPAL (EXPANDIR/OCULTAR)
   ============================================================ */

.comments-button { 
    width: 100%; 
    padding: 10px 15px; 
    background: #0A0A0A; 
    color: #B7B5B5; 
    border: none; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 500; 
    transition: all 0.3s ease; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
}

.comments-button:hover { 
    background: #28A745; 
    color: #fff;
}

.comments-button.expanded { 
    background: #0A0A0A; 
}

.comments-icon { 
    width: 36px; 
    height: 36px; 
    transition: transform 0.3s ease; 
    display: none; 
}

.comments-button.expanded .comments-icon { 
    transform: rotate(180deg); 
}

.comments-button svg:not(.comments-icon) { 
    width: 18px; 
    height: 18px; 
}

.button-icon { 
    margin-left: 5px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
}

.custom-icon-wrapper {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

/* ============================================================
   ÁREA DE COMENTÁRIOS
   ============================================================ */

.comments-area { 
    display: none; 
    background: #0A0A0A; 
    padding: 0; 
    position: relative; 
}

.comments-area.expanded { 
    display: block; 
    padding: 20px; 
}

.comments-container { 
    background: #0A0A0A; 
    border-radius: 8px; 
}

/* ============================================================
   CABEÇALHO (DISCUSSÕES)
   ============================================================ */

.comments-header { 
    padding: 10px 20px; 
    border-bottom: 1px solid #333; 
    background: #34495E; 
    border-radius: 8px 8px 0 0;
}

.comments-title { 
    font-size: 14px; 
    font-weight: 600; 
    color: #fff; 
    margin: 0;
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.comments-count { 
    background: #34495E; 
    color: #fff; 
    font-size: 14px; 
    font-weight: 600; 
    padding: 4px 10px; 
    border-radius: 12px; 
    min-width: 24px; 
    text-align: center; 
}

.discussoes-icon-wrapper {
    display: inline-flex;
    align-items: center;
    margin-right: 5px;
}

/* ============================================================
   SISTEMA DE COMENTÁRIOS - CONTAINER
   ============================================================ */

.sistema-comentarios { 
    padding: 20px; 
    font-family: 'Sen', Arial, sans-serif; 
}

/* ============================================================
   FORMULÁRIO DE NOVO COMENTÁRIO
   ============================================================ */

.comentario-form { 
    background: #212121; 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 30px; 
    display: flex; 
    gap: 15px; 
    align-items: flex-start; 
}

.comentario-form .form-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.nome-usuario-form { 
    font-size: 12px; 
    color: #fff; 
    font-weight: 600; 
    text-align: center;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-wrapper { 
    flex: 1; 
}

/* ============================================================
   EDITOR DE TEXTO (TOOLBAR + CONTEÚDO)
   ============================================================ */

.editor-container { 
    border: 1px solid #444; 
    border-radius: 6px; 
    background: #212121; 
    overflow: hidden;
}

.editor-toolbar { 
    background: #2a2a2a; 
    border-bottom: 1px solid #444; 
    padding: 8px 12px; 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    flex-wrap: wrap; 
}

.editor-btn { 
    background: #3a3a3a; 
    border: 1px solid #555; 
    border-radius: 4px; 
    padding: 6px 10px; 
    font-size: 12px; 
    cursor: pointer; 
    color: #ddd; 
    min-width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s ease;
}

.editor-btn:hover { 
    background: #28A745; 
    border-color: #28A745; 
    color: #fff; 
}

.separator { 
    width: 1px; 
    height: 20px; 
    background: #444; 
    margin: 0 4px; 
}

.editor-content { 
    min-height: 120px; 
    max-height: 300px;
    padding: 12px; 
    outline: none; 
    font-family: inherit; 
    font-size: 14px; 
    line-height: 1.6; 
    overflow-y: auto; 
    cursor: text; 
    user-select: text; 
    background: #f5f5f5; 
    color: #333; 
}

.editor-content:empty:before { 
    content: "Escreva o seu comentário..."; 
    color: #999; 
    font-style: italic; 
    pointer-events: none; 
}

/* ============================================================
   SELETOR DE COR
   ============================================================ */

.color-selector { 
    position: relative; 
}

.color-dropdown { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    background: #2a2a2a; 
    border: 1px solid #444; 
    border-radius: 4px; 
    padding: 8px; 
    display: none; 
    z-index: 1000; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
    grid-template-columns: repeat(4, 1fr); 
    gap: 4px; 
    width: 120px; 
}

.color-dropdown.show { 
    display: grid; 
}

.color-item { 
    width: 24px; 
    height: 24px; 
    border-radius: 4px; 
    cursor: pointer; 
    border: 2px solid transparent; 
    transition: all 0.2s ease;
}

.color-item:hover { 
    transform: scale(1.15); 
    border-color: #fff; 
}

/* ============================================================
   FOOTER DO FORMULÁRIO
   ============================================================ */

.comentario-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: 12px; 
}

.contador { 
    font-size: 12px; 
    color: #888; 
}

.contador.warning { 
    color: #e74c3c; 
}

.btn-publicar { 
    background: #007cba; 
    color: #fff; 
    border: none; 
    padding: 10px 24px; 
    border-radius: 5px; 
    font-size: 14px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s ease;
}

.btn-publicar:hover { 
    background: #28A745; 
}

.btn-publicar:disabled { 
    background: #555; 
    cursor: not-allowed; 
}

.loading { 
    text-align: center; 
    color: #888; 
    font-size: 14px; 
    display: none; 
    padding: 10px;
}

/* ============================================================
   AVATARES - PADRÃO GLOBAL
   ============================================================ */

.avatar-padrao {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #fff !important;
    background: #2a2a2a !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.avatar-pequeno {
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #fff !important;
    background: #2a2a2a !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.avatar-mini {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #fff !important;
    background: #2a2a2a !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* Classes legadas (compatibilidade) */
.perfil-usuario-foto-mini,
.comentario-avatar,
.responder-avatar {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #fff !important;
    background: #2a2a2a !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.responder-avatar {
    width: 32px !important;
    height: 32px !important;
}

/* ============================================================
   LISTA DE COMENTÁRIOS
   ============================================================ */

.comentarios-lista { 
    margin-top: 0; 
}

/* ============================================================
   COMENTÁRIO INDIVIDUAL
   ============================================================ */

.comentario-item { 
    display: flex; 
    gap: 25px !important; 
    align-items: flex-start; 
    margin-bottom: 20px; 
}

.comentario-avatar-wrapper { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 5px; 
    flex-shrink: 0; 
    width: 120px !important;
    min-width: 120px !important; 
}

.comentario-autor-nome { 
    font-size: 11px; 
    color: #fff; 
    font-weight: 600; 
    text-align: center; 
    width: 120px !important;
    white-space: nowrap !important;      
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.comentario-conteudo-wrapper { 
    flex: 1; 
    background: #f5f5f5; 
    border: 1px solid #e0e0e0; 
    border-radius: 8px; 
    overflow: hidden; 
}

.comentario-header { 
    background: #e9ecef; 
    padding: 8px 12px; 
    border-bottom: 1px solid #ddd; 
}

.comentario-data { 
    font-size: 12px; 
    color: #666; 
    margin: 0; 
}

.comentario-texto { 
    font-size: 14px; 
    line-height: 1.6; 
    padding: 12px; 
    color: #333; 
    background: #f5f5f5; 
}

/* ============================================================
   BOTÕES DE AÇÃO (EDITAR, EXCLUIR, CONCORDO, RESPOSTAS)
   ============================================================ */

.comentario-acoes { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    align-items: center; 
    padding: 10px 12px; 
    background: #f0f0f0; 
    border-top: 1px solid #e0e0e0; 
}

.comentario-acao { 
    background: #34495E !important; 
    border: none !important; 
    color: #fff !important; 
    font-size: 12px !important; 
    cursor: pointer !important; 
    padding: 6px 14px !important; 
    border-radius: 4px !important; 
    white-space: nowrap !important; 
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    min-height: 32px !important; 
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

.comentario-acao:hover { 
    background: #28A745 !important; 
}

/* ============================================================
   RESPOSTAS ANINHADAS
   ============================================================ */

.respostas-lista { 
    margin-top: 15px; 
    padding-left: 20px; 
    border-left: 3px solid #28A745; 
}

.comentario-resposta { 
    margin-bottom: 15px; 
}

.comentario-resposta .comentario-avatar-wrapper { 
    width: 60px; 
}

.comentario-resposta .comentario-avatar { 
    width: 35px !important; 
    height: 35px !important; 
}

.comentario-resposta .comentario-autor-nome { 
    font-size: 10px; 
    width: 60px; 
}

.comentario-resposta .comentario-conteudo-wrapper { 
    background: #f0f0f0; 
}

.comentario-resposta .comentario-header { 
    background: #e0e0e0; 
}

/* ============================================================
   FORMULÁRIO DE RESPOSTA
   ============================================================ */

.responder-container { 
    margin-top: 15px; 
}

.responder-form { 
    background: #2a2a2a; 
    border-radius: 8px; 
    padding: 15px; 
    border: 1px solid #444;
}

.responder-header { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 12px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #444; 
}

.responder-info { 
    font-size: 13px; 
    color: #aaa; 
}

.responder-info strong { 
    color: #fff; 
}

.responder-textarea { 
    width: 100%; 
    min-height: 80px; 
    padding: 12px; 
    border: 1px solid #444; 
    border-radius: 6px; 
    background: #0A0A0A; 
    color: #fff; 
    font-family: inherit; 
    font-size: 14px; 
    resize: vertical; 
    outline: none; 
    transition: border-color 0.2s; 
}

.responder-textarea:focus { 
    border-color: #28A745; 
}

.responder-textarea::placeholder { 
    color: #666; 
}

.responder-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: 10px; 
}

.responder-contador { 
    font-size: 12px; 
    color: #888; 
}

.responder-btns { 
    display: flex; 
    gap: 8px; 
}

.btn-cancelar-resposta { 
    background: #444; 
    color: #fff; 
    border: none; 
    padding: 8px 16px; 
    border-radius: 5px; 
    font-size: 13px; 
    cursor: pointer; 
    transition: background 0.2s; 
}

.btn-cancelar-resposta:hover { 
    background: #555; 
}

.btn-enviar-resposta { 
    background: #28A745; 
    color: #fff; 
    border: none; 
    padding: 8px 16px; 
    border-radius: 5px; 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: background 0.2s; 
}

.btn-enviar-resposta:hover { 
    background: #218838; 
}

.btn-enviar-resposta:disabled { 
    background: #555; 
    cursor: not-allowed; 
}

/* ============================================================
   BOTÃO CARREGAR MAIS
   ============================================================ */

.btn-carregar-mais-wrapper { 
    text-align: center; 
    padding: 20px 0; 
    margin-top: 10px; 
}

.btn-carregar-mais { 
    background: linear-gradient(135deg, #28A745 0%, #20c997 100%); 
    color: #fff; 
    border: none; 
    padding: 8px 14px; 
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3); 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
}

.btn-carregar-mais:hover { 
    background: linear-gradient(135deg, #218838 0%, #1aa085 100%); 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4); 
}

.btn-carregar-mais:disabled { 
    background: #555; 
    cursor: not-allowed; 
    transform: none; 
    box-shadow: none; 
}

.btn-carregar-mais .spinner { 
    width: 16px; 
    height: 16px; 
    border: 2px solid rgba(255,255,255,0.3); 
    border-top-color: #fff; 
    border-radius: 50%; 
    animation: spin 0.8s linear infinite; 
    display: none; 
}

.btn-carregar-mais.loading .spinner { 
    display: inline-block; 
}

.btn-carregar-mais.loading .btn-texto { 
    display: none; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* ============================================================
   INFORMAÇÕES E RODAPÉ
   ============================================================ */

.comentarios-info { 
    text-align: center; 
    color: #888; 
    font-size: 13px; 
    padding: 15px 0; 
    border-top: 1px solid #333; 
    margin-top: 20px; 
}

.comentarios-fim { 
    text-align: center; 
    color: #28A745; 
    font-size: 13px; 
    padding: 15px 0; 
    font-weight: 500;
}

.btn-fechar-wrapper { 
    text-align: right; 
    padding: 15px 0 5px; 
    margin-top: 10px; 
    border-top: 1px solid #333; 
}

.btn-fechar-comentarios { 
    background: #34495E; 
    color: #fff; 
    border: none; 
    padding: 8px 12px; 
    border-radius: 8px; 
    font-size: 13px; 
    font-weight: 500; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
}

.btn-fechar-comentarios:hover { 
    background: #28A745; 
    transform: translateY(-2px); 
}

/* ============================================================
   EDITOR DE EDIÇÃO (INLINE)
   ============================================================ */

.editor-edicao { 
    margin: 10px 0; 
}

.editor-edicao .editor-container { 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    background: #fff; 
}

.editor-edicao .editor-toolbar { 
    background: #f8f9fa; 
    border-bottom: 1px solid #ddd; 
}

.editor-edicao .editor-btn { 
    background: #e9ecef; 
    border: 1px solid #ccc; 
    color: #333; 
}

.editor-edicao .editor-btn:hover { 
    background: #28A745; 
    border-color: #28A745; 
    color: #fff; 
}

.editor-edicao .separator { 
    background: #ccc; 
}

.editor-content-edit { 
    min-height: 100px; 
    max-height: 300px;
    padding: 12px; 
    outline: none; 
    font-family: inherit; 
    font-size: 14px; 
    line-height: 1.6; 
    overflow-y: auto; 
    cursor: text; 
    user-select: text; 
    background: #fff; 
    color: #333; 
}

.color-selector-edit { 
    position: relative; 
}

.color-dropdown-edit { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    padding: 8px; 
    display: none; 
    z-index: 9999; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    grid-template-columns: repeat(4, 1fr); 
    gap: 4px; 
    width: 120px; 
}

.color-dropdown-edit.show { 
    display: grid; 
}

.color-item-edit { 
    width: 24px; 
    height: 24px; 
    border-radius: 4px; 
    cursor: pointer; 
    border: 2px solid transparent; 
    transition: all 0.2s ease;
}

.color-item-edit:hover { 
    transform: scale(1.15); 
    border-color: #333; 
}

.contador-edicao { 
    font-size: 12px; 
    color: #666; 
    margin-top: 8px; 
    padding: 0 12px; 
}

.contador-edicao.warning { 
    color: #e74c3c; 
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.comentario-skeleton {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 768px) {
    .comments-area.expanded { 
        padding: 10px; 
    }
    
    .sistema-comentarios { 
        padding: 10px; 
    }
    
    .comentario-form { 
        padding: 15px; 
        flex-direction: column; 
        gap: 10px; 
    }
    
    .comentario-item { 
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important; 
    }
    
    .comentario-avatar-wrapper { 
        flex-direction: row !important;
        width: 100% !important;
        min-width: 100% !important;
        gap: 10px !important; 
    }

    .comentario-avatar-wrapper .comentario-avatar {
        width: 40px !important;
        height: 40px !important;
    }
    
    .comentario-autor-nome { 
        width: auto !important;
        font-size: 11px !important; 
    }

    .comentario-conteudo-wrapper {
        width: 100% !important;
    }
    
    .editor-toolbar { 
        padding: 6px 8px; 
        gap: 4px; 
    }
    
    .editor-btn { 
        padding: 4px 8px; 
        min-width: 28px; 
        height: 28px; 
        font-size: 11px; 
    }
    
    .comments-button { 
        font-size: 14px; 
        padding: 10px; 
    }
    
    .btn-carregar-mais { 
        padding: 10px 24px; 
        font-size: 13px; 
    }
    
    .respostas-lista {
        padding-left: 10px;
    }
    
    .comentario-acoes {
        gap: 6px;
    }
    
    .comentario-acao {
        font-size: 11px !important;
        padding: 5px 5px !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {      
    .comentario-form { 
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important; 
    }

    .comentario-form .form-avatar-wrapper {
        flex-direction: row !important;
        width: 100% !important;
        min-width: 100% !important;
        gap: 10px !important;
    }
    
    .comentario-form .nome-usuario-form {
        max-width: none !important;
    }
    
    .editor-wrapper {
        width: 100% !important;
    }
    
    .comentario-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .comentario-avatar-wrapper {
        flex-direction: row !important;
        width: 100% !important;
        min-width: 100% !important;
        gap: 10px !important;
    }
    
    .comentario-avatar-wrapper .comentario-avatar {
        width: 45px !important;
        height: 45px !important;
    }
    
    .comentario-autor-nome {
        width: auto !important;
        font-size: 14px !important;
    }
    
    .comentario-conteudo-wrapper {
        width: 100% !important;
    }
}

/* ============================================================
BOTÃO CONCORDO DESABILITADO (AUTOR)
============================================================ */

.comentario-acao.concordo-disabled {
    background: #5a6268 !important;
    cursor: default !important;
    opacity: 0.8 !important;
}

.comentario-acao.concordo-disabled:hover {
    background: #5a6268 !important;
    transform: none !important;
}