/* ========================================================================== */
/* ESTILOS PARA SEÇÃO DE COMENTÁRIOS (ESTILO GEMINI) */
/* ========================================================================== */

@keyframes subtle-user-glow {
    0%, 100% { text-shadow: 0 0 5px rgba(96, 165, 250, 0.5); }
    50% { text-shadow: 0 0 10px rgba(96, 165, 250, 0.7), 0 0 15px rgba(96, 165, 250, 0.5); }
}

#comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 2rem;
}

.comment-input-wrapper {
    position: relative;
    background-color: #1e293b;
    border-radius: 1.5rem;
    padding: 0.75rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 1px 2px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.comment-input-wrapper:focus-within {
    border-color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(0, 255, 140, 0.25);
}

#comment-textarea {
    background-color: transparent;
    border: none;
    color: var(--text-light);
    width: 100%;
    resize: none;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.5rem 3.5rem 0.5rem 1rem; /* Aumenta o padding à direita */
    min-height: 80px;
    max-height: 250px;
    outline: none;
    /* Adicionado para ocultar a barra de rolagem */
    scrollbar-width: none; /* Firefox */
}

/* Adicionado para ocultar a barra de rolagem no Chrome, Safari, e Edge */
#comment-textarea::-webkit-scrollbar {
    display: none;
}

#comment-textarea::placeholder {
    color: var(--text-dark);
}

#comment-submit-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-accent);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
#comment-submit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--primary-accent);
}
#comment-submit-btn:disabled {
    background-color: #334155;
    cursor: not-allowed;
    transform: scale(1);
    box-shadow: none;
}
#comment-submit-btn i {
    transition: transform 0.3s ease;
}
#comment-submit-btn:not(:disabled):hover i {
    transform: rotate(45deg);
}

.comment-char-counter {
    position: absolute;
    bottom: -1.5rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-dark);
}

#comments-list {
    display: flex;
    flex-direction: column;
}

.comment-date-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin: 2.5rem 0 1.5rem;
}
.comment-date-separator:first-child {
    margin-top: 0;
}
.comment-date-separator::before,
.comment-date-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}
.comment-date-separator:not(:empty)::before {
    margin-right: .5em;
}
.comment-date-separator:not(:empty)::after {
    margin-left: .5em;
}

.comment-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
#comments-list > .comment-group:last-of-type {
    margin-bottom: 0;
}

.comment-entry {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 0.75rem;
}

.comment-entry-user {
    justify-content: flex-end;
}

.comment-entry-ia {
    justify-content: flex-start;
}

.comment-avatar-container {
    padding: 2px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.user-avatar-container {
    background: linear-gradient(to bottom right, #10b981, #34d399); /* Verde */
}

.ia-avatar-container {
    background: var(--border-color);
}

.comment-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.ia-avatar-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #141E30;
    color: var(--primary-accent);
    font-size: 14px;
}

.comment-points-award {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: bold;
    color: #facc15; /* Amarelo */
    background-color: rgba(250, 204, 21, 0.1);
    padding: 2px 6px;
    border-radius: 9999px;
}
.comment-points-award .fa-star {
    font-size: 0.6rem;
}

.comment-content-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.comment-entry-user .comment-content-wrapper {
    align-items: flex-end;
}

.comment-entry-ia .comment-content-wrapper {
    align-items: flex-start;
}

.comment-bubble {
    padding: 0.85rem 1.15rem;
    border-radius: 1.25rem;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.comment-entry-user .comment-bubble {
    background-image: linear-gradient(to right, #1e3a8a, #312e81);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.comment-entry-ia .comment-bubble {
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0.25rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.comment-username, .comment-ia-agent {
    font-weight: 700;
    font-size: 0.875rem;
}

.comment-entry-user .comment-username {
    color: white;
    animation: subtle-user-glow 4s ease-in-out infinite;
}

.comment-entry-ia .comment-ia-agent {
    color: var(--primary-accent);
}

.comment-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.comment-entry-user .comment-footer {
    justify-content: flex-end;
}

.like-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.comment-meta {
    font-size: 0.75rem;
    color: var(--text-dark);
    opacity: 0.7;
}

.comment-like-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.25rem;
}

.comment-like-btn.liked i {
    font-weight: 900;
}

.comment-like-btn:hover,
.comment-like-btn.liked {
    color: var(--primary-accent);
}

.points-feedback-message {
    color: var(--primary-accent);
    font-size: 0.75rem;
    font-weight: 600;
    position: absolute;
    left: 100%;
    margin-left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    white-space: nowrap;
}
.points-feedback-message.visible {
    opacity: 1;
}

/* NOVO: Estilo para mensagem de erro/limite */
.points-feedback-message.error {
    color: #f87171; /* red-400 */
    left: 50%;
    top: -2.5rem;
    transform: translateX(-50%);
    background-color: rgba(220, 38, 38, 0.8);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(185, 28, 28, 0.9);
    font-size: 0.8rem;
}


/* NOVO: Estilo para Comentários Inválidos (Visível apenas para o autor) */
.comment-group.comment-invalid {
    opacity: 0.8;
    order: -1; /* Joga o comentário inválido para o topo da lista */
    margin-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--border-color);
}

.comment-invalid-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fcd34d; /* amber-300 */
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

/* --- INÍCIO DA IMPLEMENTAÇÃO --- */
.comment-pending-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fcd34d; /* Cor âmbar (amarelo) */
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}
/* --- FIM DA IMPLEMENTAÇÃO --- */