/**
 * ================================================================
 * ARQUIVO: comentarios.css
 * PASTA: assets/css/comentarios.css
 * DESCRIÇÃO: Estilos do widget de comentários de estudantes
 * VERSÃO: 1.1 - Removido !important para permitir customização Elementor
 * DATA: 2025-11-21
 * ================================================================
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

.comments-widget { background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); overflow: hidden; max-width: 1200px; margin: 0 auto; }

.comments-button { width: 100%; padding: 10px 15px; background: #1A1A1A; 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; }
.comments-button:hover svg { fill: #ffffff; }
.comments-button.expanded { background: #1A1A1A; }

.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; }

/* Ícone do botão */
.button-icon {
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-icon svg,
.button-icon i {
    transition: all 0.3s ease;
}

.comments-area { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; background: #1A1A1A; }
.comments-area.expanded { max-height: 850px; padding: 20px; overflow-y: auto; }

.comments-container { background: #1A1A1A; border-radius: 8px; overflow: hidden; }

.comments-header { padding: 20px 20px 0 20px; border-bottom: 1px solid #e1e5e9; background: #28A745; }

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

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

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

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

.perfil-usuario-foto-mini { width: 45px !important; height: 45px !important; border-radius: 50% !important; object-fit: cover !important; border: 2px solid #fff !important; background: #f5f5f5; flex-shrink: 0; display: block !important; }

.nome-usuario-form { font-size: 12px; color: #fff; font-weight: 600; }

.editor-wrapper { flex: 1; }

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

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

.editor-btn { background: none; border: 1px solid #ccc; border-radius: 3px; padding: 6px 10px; font-size: 12px; cursor: pointer; color: #333; min-width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }

.editor-btn:hover { background: #38a169; border-color: #38a169; color: white; }

.color-selector { position: relative; }

.color-dropdown { position: absolute; top: 100%; left: 0; background: white; border: 1px solid #ddd; border-radius: 4px; padding: 8px; display: none; z-index: 1000; box-shadow: 0 2px 8px rgba(0,0,0,0.1); 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: 1px solid #ddd; }

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

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

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

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

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

.contador { font-size: 12px; color: #666; }
.contador.warning { color: #38a169; }

.btn-publicar { background: #007cba; color: white; border: none; padding: 8px 20px; border-radius: 5px; font-size: 14px; font-weight: 600; cursor: pointer; }

.btn-publicar:hover { background: #38a169; }
.btn-publicar:disabled { background: #ccc; cursor: not-allowed; }

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

.comentarios-lista { margin-top: 0; padding-bottom: 20px; }

.comentario-item { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 15px; margin-bottom: 15px; color: #333; }

.comentario-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

.comentario-avatar { width: 40px !important; height: 40px !important; border-radius: 50% !important; object-fit: cover !important; border: 2px solid #ddd !important; background: #f5f5f5; flex-shrink: 0; display: block !important; }

.comentario-info { flex: 1; }

.comentario-autor { font-size: 14px; font-weight: 600; color: #333; margin: 0 0 2px 0; }

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

.comentario-texto { 
    font-size: 14px; 
    line-height: 1.5; 
    margin-bottom: 12px; 
}

/* Preserva cores inline nos spans */
.comentario-texto span[style*="color"] {
    color: inherit;
}

.comentario-acoes { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    align-items: center; 
    width: 100%; 
}

/* REMOVIDO !important - agora customizável pelo Elementor */
.comentario-acao { 
    background: #B7B5B5; 
    border: none; 
    color: #000; 
    font-size: 12px; 
    cursor: pointer; 
    text-decoration: none; 
    transition: all 0.2s ease; 
    padding: 4px 12px; 
    border-radius: 4px; 
}

.comentario-acao:hover { 
    background: #34495E; 
    color: #fff; 
}

.editor-edicao { margin: 10px 0; }
.editor-edicao .editor-container { border: 1px solid #ddd; border-radius: 6px; background: white; }

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

.editor-edicao .editor-btn { 
    background: #B7B5B5; 
    border: 1px solid #ccc; 
    border-radius: 3px; 
    padding: 5px 5px; 
    font-size: 12px; 
    cursor: pointer; 
    color: #333; 
    min-width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.editor-edicao .editor-btn:hover { 
    background: #38a169; 
    border-color: #38a169; 
    color: white; 
}

.editor-edicao .separator { 
    width: 1px; 
    height: 20px; 
    background: #ddd; 
    margin: 0 4px; 
}

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

.color-selector-edit { position: relative; display: inline-block; }

.color-dropdown-edit { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    background: white; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    padding: 8px; 
    display: none; 
    z-index: 9999; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
    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: 1px solid #ddd; 
}

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

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

/* Responsivo */
@media (max-width: 768px) {
    .comments-area.expanded { max-height: 600px; padding: 10px; }
    .sistema-comentarios { padding: 10px; }
    .comentario-form { padding: 10px; flex-direction: column; gap: 10px; }
    .editor-toolbar { padding: 6px 8px; gap: 6px; }
    .editor-btn { padding: 4px 8px; min-width: 28px; height: 28px; font-size: 11px; }
    .comments-button { font-size: 14px; padding: 10px 10px; }
    .comments-icon { display: none; }
    .comments-button svg:not(.comments-icon) { width: 25px; height: 30px; }
}

@media (min-width: 481px) and (max-width: 1024px) {
    .editor-content { min-height: 350px; max-height: 500px; }
    .comments-area.expanded { max-height: 850px; }
    .comentario-form { padding: 20px; flex-direction: row; align-items: flex-start; gap: 15px; }
}

/* Correção: Botões de Ação em Mobile - REMOVIDO !important */
.comentario-acoes { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    align-items: center; 
    width: 100%;
    margin-top: 12px;
}

.comentario-acao { 
    background: #B7B5B5; 
    border: none; 
    color: #000; 
    font-size: 12px; 
    cursor: pointer; 
    text-decoration: none; 
    transition: all 0.2s ease; 
    padding: 6px 12px; 
    border-radius: 4px; 
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.comentario-acao:hover { 
    background: #34495E; 
    color: #fff; 
}

/* Mobile: Ajustes específicos para telas pequenas */
@media (max-width: 767px) {
    .comentario-acoes { 
        gap: 6px;
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .comentario-acao { 
        font-size: 11px;
        padding: 5px 10px;
        min-height: 30px;
        flex: 0 1 auto;
    }
}

/* Mobile muito pequeno: 1 botão por linha */
@media (max-width: 399px) {
    .comentario-acao { 
        flex: 0 1 100%;
        max-width: 100%;
    }
}