/* Forum Mensagens - Estilos Modernos e Melhorados */

/* Reset e base */
* {
    box-sizing: border-box;
}

/* Alertas modernos */
.alert-message {
    padding: 16px 24px;
    margin: 20px 0;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    animation: slideInFromTop 0.4s ease-out;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.alert-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Animações aprimoradas */
@keyframes slideInFromTop {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.15); }
    28% { transform: scale(1); }
    42% { transform: scale(1.15); }
    70% { transform: scale(1); }
}

/* Comentários - Nova estrutura moderna */
.comments {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    margin-bottom: 24px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.comment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.comment:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Container do avatar */
.avatar-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    object-fit: cover;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.avatar:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Bloco de comentário */
.comment-block {
    margin-left: 80px;
    position: relative;
}

/* Cabeçalho do comentário */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.comment-author {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comment-author strong {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
}

.comment-date {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 400;
}

/* Ações do comentário - Botões modernos */
.comment-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-action {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #495057;
    position: relative;
    overflow: hidden;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.btn-action:hover::before {
    left: 100%;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Botões específicos com cores */
.btn-like {
    background: linear-gradient(135deg, #ff6b9d 0%, #ffa8a8 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-like:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.btn-like.liked {
    background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    animation: pulse 0.3s ease;
}

.btn-like.liked:hover {
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

.btn-reply {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border: none;
}

.btn-edit,
.btn-editar-mensagem {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    color: white;
    border: none;
}

.btn-delete,
.btn-excluir-mensagem {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: white;
    border: none;
}

.btn-action i {
    font-size: 11px;
}

.like-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    min-width: 20px;
    text-align: center;
}

/* Conteúdo da mensagem - Suporte completo ao HTML */
.mensagem-conteudo {
    line-height: 1.7;
    font-size: 15px;
    color: #2c3e50;
    margin-top: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Estilos para elementos HTML do TinyMCE */
.mensagem-conteudo p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.mensagem-conteudo iframe {
    max-width: 100%;
    border-radius: 8px;
    margin: 12px 0;
}

.mensagem-conteudo img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.mensagem-conteudo blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    background: rgba(102, 126, 234, 0.05);
    padding: 12px 16px;
    border-radius: 8px;
}

.mensagem-conteudo code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.mensagem-conteudo pre {
    background: #2d3748;
    color: #ffffff;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.mensagem-conteudo ul, .mensagem-conteudo ol {
    padding-left: 20px;
    margin: 12px 0;
}

.mensagem-conteudo li {
    margin-bottom: 4px;
}

.mensagem-conteudo a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.mensagem-conteudo a:hover {
    border-bottom-color: #667eea;
    color: #764ba2;
}

.mensagem-conteudo strong {
    font-weight: 600;
    color: #2c3e50;
}

/* Paginação moderna */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a, 
.pagination span {
    padding: 12px 18px;
    text-decoration: none;
    border-radius: 12px;
    color: #667eea;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.pagination a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.pagination a:hover::before {
    left: 100%;
}

.pagination a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.pagination .current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    cursor: default;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

/* Formulário de comentário moderno */
#form-comentario {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    margin-top: 32px;
    padding: 32px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

#form-comentario::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

#form-comentario .form-control {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    padding: 12px 16px;
    font-size: 14px;
    background: rgba(255,255,255,0.8);
}

#form-comentario .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
    transform: scale(1.02);
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.btn-modern {
    border-radius: 12px;
    padding: 14px 32px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
    box-shadow: 0 12px 32px rgba(108, 117, 125, 0.4);
}

/* Loading overlay moderno */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

#loading-overlay .spinner {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    animation: bounceIn 0.6s ease;
}

/* Sidebar melhorada */
.simple-post-list li {
    padding: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border-radius: 12px;
    margin-bottom: 8px;
}

.simple-post-list li:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.simple-post-list a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: color 0.3s ease;
    display: block;
    line-height: 1.4;
}

.simple-post-list a:hover {
    color: #667eea;
}

.post-meta {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 6px;
    font-weight: 400;
}

/* Responsividade melhorada */
@media (max-width: 768px) {
    .comment {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .avatar-container {
        position: static;
        margin-bottom: 12px;
        text-align: center;
    }
    
    .comment-block {
        margin-left: 0;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .comment-actions {
        justify-content: center;
        margin-top: 12px;
    }
    
    .btn-action {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .pagination a, 
    .pagination span {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    #form-comentario {
        padding: 20px;
        margin: 20px 0;
    }
    
    .mensagem-conteudo iframe {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .comment-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .btn-action {
        justify-content: center;
        width: 100%;
    }
    
    .avatar {
        width: 48px;
        height: 48px;
    }
}

/* Melhorias no TinyMCE */
.tox-tinymce {
    border-radius: 12px !important;
    border: 2px solid #e9ecef !important;
    overflow: hidden;
}

.tox-toolbar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-radius: 12px 12px 0 0 !important;
}

.tox-edit-area {
    border-radius: 0 0 12px 12px !important;
}

/* Contador de comentários */
.comments-count {
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

/* Notificações toast */
.toast-notification {
    position: fixed;
    top: 30px;
    right: 30px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    padding: 20px 24px;
    z-index: 10000;
    border-left: 4px solid #667eea;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from { 
        transform: translateX(100%) scale(0.8); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
}

/* Efeitos especiais */
.comment.new-comment {
    animation: bounceIn 0.6s ease;
}

.btn-action.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-action.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Respostas Aninhadas */
.nivel-1, .nivel-2, .nivel-3, .nivel-4, .nivel-5 {
    position: relative;
}

.nivel-1 {
    border-left: 3px solid #e0e6ed;
    background: linear-gradient(90deg, rgba(240, 244, 248, 0.3) 0%, transparent 20px);
}

.nivel-2 {
    border-left: 3px solid #c3d4e6;
    background: linear-gradient(90deg, rgba(195, 212, 230, 0.3) 0%, transparent 20px);
}

.nivel-3 {
    border-left: 3px solid #a6c1de;
    background: linear-gradient(90deg, rgba(166, 193, 222, 0.3) 0%, transparent 20px);
}

.nivel-4 {
    border-left: 3px solid #89aed6;
    background: linear-gradient(90deg, rgba(137, 174, 214, 0.3) 0%, transparent 20px);
}

.nivel-5 {
    border-left: 3px solid #6c9bce;
    background: linear-gradient(90deg, rgba(108, 155, 206, 0.3) 0%, transparent 20px);
}

/* Badge de resposta */
.resposta-badge {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* Formulário de resposta inline */
.reply-form-container {
    margin-top: 15px;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

.reply-form {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.reply-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reply-header i {
    margin-right: 8px;
}

.btn-close-reply {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-close-reply:hover {
    background-color: rgba(255,255,255,0.2);
}

.reply-form-content {
    padding: 20px;
}

.reply-form-content .form-group {
    margin-bottom: 20px;
}

.reply-form-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.reply-form-content textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reply-form-content textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 15px;
}

.btn-submit-reply {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-submit-reply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Animações para respostas aninhadas */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade para respostas aninhadas */
@media (max-width: 768px) {
    .nivel-1, .nivel-2, .nivel-3, .nivel-4, .nivel-5 {
        margin-left: 10px !important;
        padding-left: 8px !important;
    }
    
    .reply-form-content {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit-reply,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Melhorias visuais para threads */
.comment-block {
    position: relative;
}

.nivel-1 .comment-block::before,
.nivel-2 .comment-block::before,
.nivel-3 .comment-block::before,
.nivel-4 .comment-block::before,
.nivel-5 .comment-block::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 0;
    width: 2px;
    height: 100%;
    background: currentColor;
    opacity: 0.3;
}

/* Estilos para o modo de edição */
.edit-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #007bff;
    border-radius: 12px;
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
    animation: editModeIn 0.3s ease-out;
    position: relative;
}

.edit-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    color: #007bff;
    font-weight: 600;
}

.edit-header i {
    font-size: 16px;
}

.edit-content {
    margin-bottom: 20px;
}

.edit-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.edit-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.edit-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 15px;
    flex-wrap: wrap;
}

.edit-buttons .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-decoration: none;
}

.edit-buttons .btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.edit-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.edit-buttons .btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.edit-buttons .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

.edit-buttons .btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.edit-buttons .btn.loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Indicação visual de que está em modo de edição */
li[data-original-html] {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08) 0%, rgba(0, 86, 179, 0.04) 100%);
    border-left: 4px solid #007bff;
    position: relative;
    transform: scale(1.01);
    transition: all 0.3s ease;
}

li[data-original-html]::before {
    content: '✏️ Editando...';
    position: absolute;
    top: 10px;
    right: 15px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Animação para entrar no modo de edição */
@keyframes editModeIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
        scale: 0.95;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        scale: 1;
    }
}

/* Responsividade para modo de edição */
@media (max-width: 768px) {
    .edit-container {
        padding: 15px;
        margin: 8px 0;
    }
    
    .edit-buttons {
        flex-direction: column;
    }
    
    .edit-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    li[data-original-html]::before {
        position: static;
        display: block;
        margin-bottom: 10px;
        text-align: center;
        border-radius: 8px;
    }
}

/* Efeito de destaque para mensagem após resposta */
.mensagem-destacada {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.15) 0%, rgba(0, 86, 179, 0.08) 100%) !important;
    border-left: 4px solid #007bff !important;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2) !important;
    position: relative;
}

.mensagem-destacada::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    animation: shimmer 2s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.mensagem-destacada .comment {
    position: relative;
    z-index: 2;
}

@keyframes pulseHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 8px 25px rgba(0, 123, 255, 0.25);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Transição suave para voltar ao normal */
li:not(.mensagem-destacada) {
    transition: all 0.5s ease-out;
}

/* Estilos específicos para TinyMCE inline */
.reply-form .tox-tinymce {
    border-radius: 8px !important;
    border: 2px solid #ced4da !important;
    margin: 10px 0 !important;
}

.reply-form .tox-tinymce:focus-within {
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
}

.edit-container .tox-tinymce {
    border-radius: 8px !important;
    border: 2px solid #ced4da !important;
    margin: 10px 0 !important;
}

.edit-container .tox-tinymce:focus-within {
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
}

/* Toolbar do TinyMCE inline */
.reply-form .tox-toolbar,
.edit-container .tox-toolbar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 8px !important;
}

.reply-form .tox-toolbar__primary,
.edit-container .tox-toolbar__primary {
    background: transparent !important;
}

/* Editor do TinyMCE */
.reply-form .tox-edit-area,
.edit-container .tox-edit-area {
    background: white !important;
}

.reply-form .tox-edit-area__iframe,
.edit-container .tox-edit-area__iframe {
    background: white !important;
}

/* Botões do TinyMCE */
.reply-form .tox-tbtn,
.edit-container .tox-tbtn {
    border-radius: 4px !important;
    margin: 2px !important;
}

.reply-form .tox-tbtn:hover,
.edit-container .tox-tbtn:hover {
    background: rgba(0, 123, 255, 0.1) !important;
    border-color: rgba(0, 123, 255, 0.2) !important;
}

/* Responsividade para TinyMCE mobile */
@media (max-width: 768px) {
    .reply-form .tox-tinymce,
    .edit-container .tox-tinymce {
        font-size: 14px !important;
    }
    
    .reply-form .tox-toolbar,
    .edit-container .tox-toolbar {
        padding: 6px !important;
    }
    
    .reply-form .tox-tbtn,
    .edit-container .tox-tbtn {
        margin: 1px !important;
        padding: 4px !important;
    }
}

/* Melhorias no formulário com TinyMCE */
.reply-form-content .form-group {
    margin-bottom: 20px;
}

.reply-form-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

/* Ocultar textarea original quando TinyMCE está ativo */
.tinymce-reply,
.tinymce-edit {
    display: none;
}

.tinymce-reply.tox-target,
.tinymce-edit.tox-target {
    display: block;
}

/* ===== SISTEMA DE BADGES E INFORMAÇÕES DO USUÁRIO ===== */

/* Container do avatar com wrapper */
.avatar-wrapper {
    position: relative;
    display: inline-block;
}

/* Badges de usuário */
.user-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 10px;
    animation: badgePulse 2s infinite;
}

.user-badge.super-admin {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #b45309;
}

.user-badge.admin {
    background: linear-gradient(45deg, #e53e3e, #fc8181);
    color: white;
}

.user-badge.moderator {
    background: linear-gradient(45deg, #3182ce, #63b3ed);
    color: white;
}

@keyframes badgePulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    }
}

/* Informações do usuário */
.user-info {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.user-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6c757d;
    padding: 2px 0;
}

.stat-item i {
    width: 12px;
    text-align: center;
    color: #007bff;
    opacity: 0.7;
}

.stat-item span {
    font-weight: 500;
}

.stat-item.user-role {
    color: #495057;
    font-weight: 600;
}

.stat-item.user-role i {
    color: #28a745;
}

/* Super Admin específico */
.user-badge.super-admin + .user-info {
    border: 1px solid rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,248,220,0.95) 100%);
}

.user-badge.super-admin ~ .user-info .stat-item.user-role {
    color: #b45309;
}

.user-badge.super-admin ~ .user-info .stat-item.user-role i {
    color: #ffd700;
}

/* Admin específico */
.user-badge.admin + .user-info {
    border: 1px solid rgba(229, 62, 62, 0.2);
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,245,245,0.95) 100%);
}

/* Moderador específico */
.user-badge.moderator + .user-info {
    border: 1px solid rgba(49, 130, 206, 0.2);
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(240,249,255,0.95) 100%);
}

/* Responsividade para badges */
@media (max-width: 768px) {
    .user-info {
        margin-top: 6px;
        padding: 6px;
    }
    
    .stat-item {
        font-size: 10px;
        gap: 4px;
    }
    
    .user-badge {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    
    .stat-item i {
        width: 10px;
    }
}

/* Tooltip para badges (hover) */
.user-badge:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
}

/* Novos estilos para sistema simplificado de badges */
.badge-super-admin {
    background: linear-gradient(45deg, #ffd700, #ffed4e) !important;
    animation: badge-glow 2s ease-in-out infinite alternate;
}

.badge-admin {
    background: linear-gradient(45deg, #e53e3e, #fc8181) !important;
}

.badge-moderator {
    background: linear-gradient(45deg, #3182ce, #63b3ed) !important;
}

@keyframes badge-glow {
    from { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3); }
    to { box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6); }
}

.user-info-box {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-size: 11px;
    color: #666;
}

.user-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.user-stat:last-child {
    margin-bottom: 0;
}

/* ========================================
   SISTEMA DE BADGES MODERNO
======================================== */

/* Container dos badges - FORÇA MÁXIMA */
.user-badges-modern {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 10px 0 !important;
    justify-content: center !important;
    padding: 8px !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    backdrop-filter: blur(10px) !important;
    height: auto !important;
    width: auto !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Base do badge - FORÇA TOTAL */
.badge {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    border: 1px solid transparent !important;
    position: relative !important;
    overflow: hidden !important;
    height: auto !important;
    width: auto !important;
    z-index: 10 !important;
}

.badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.badge:hover::before {
    left: 100%;
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Badge de Crown (Super Admin) - FORÇA TOTAL */
.badge-crown {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffc107 100%) !important;
    color: #b45309 !important;
    border-color: #ffc107 !important;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3) !important;
}

.badge-crown:hover {
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 50%, #ffb300 100%);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
}

/* Badge de Moderador */
.badge-mod {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Badge Veterano */
.badge-veteran {
    background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
    color: white;
    border-color: #e91e63;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

/* Badge Expert */
.badge-expert {
    background: linear-gradient(135deg, #9c27b0 0%, #6a1b9a 100%);
    color: white;
    border-color: #9c27b0;
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.3);
}

/* Badge Avançado */
.badge-advanced {
    background: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%);
    color: white;
    border-color: #3f51b5;
    box-shadow: 0 2px 8px rgba(63, 81, 181, 0.3);
}

/* Badge Ativo */
.badge-active {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

/* Badge Novato */
.badge-newbie {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Badge Iniciante */
.badge-starter {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    color: white;
    border-color: #9e9e9e;
    box-shadow: 0 2px 8px rgba(158, 158, 158, 0.3);
}

/* Badge Fiel */
.badge-loyal {
    background: linear-gradient(135deg, #ff5722 0%, #d84315 100%);
    color: white;
    border-color: #ff5722;
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3);
}

/* Badge Membro */
.badge-member {
    background: linear-gradient(135deg, #795548 0%, #5d4037 100%);
    color: white;
    border-color: #795548;
    box-shadow: 0 2px 8px rgba(121, 85, 72, 0.3);
}

/* Informações compactas do usuário */
.user-info-compact {
    text-align: center;
    padding: 8px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    margin-top: 8px;
}

.user-info-compact .user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 12px;
    margin-bottom: 4px;
}

.user-info-compact .user-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 10px;
    color: #7f8c8d;
}

.user-info-compact .post-count,
.user-info-compact .join-date {
    background: rgba(255,255,255,0.8);
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Animações para os badges */
@keyframes badgeAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.badge {
    animation: badgeAppear 0.5s ease-out;
}

.badge:nth-child(1) { animation-delay: 0.1s; }
.badge:nth-child(2) { animation-delay: 0.2s; }
.badge:nth-child(3) { animation-delay: 0.3s; }

/* Responsividade */
@media (max-width: 768px) {
    .user-badges-modern {
        flex-direction: column;
        align-items: center;
    }
    
    .badge {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .user-info-compact .user-stats {
        flex-direction: column;
        gap: 4px;
    }
}

/* Blocos de código (```lang``` via renderizarTextoSeguro / TinyMCE codesample) */
.code-block, .mensagem-conteudo pre, pre[class*="language-"] {
    background: #1e1e2e;
    color: #d4e157;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    margin: 10px 0;
    text-align: left;
}
.code-block code, pre[class*="language-"] code {
    color: inherit;
    font-family: inherit;
}
.mensagem-conteudo code:not(pre code), p code, li code {
    background: #eef1f4;
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
