/* Estilos para comentários no estilo YouTube */

/* Seção de comentários */
.comments-section,
.learned-lesson-section {
    margin-top: 24px;
    border-top: 1px solid #303030;
    padding-top: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.comments-header,
.learned-lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.comments-count,
.learned-lesson-count {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

/* Área de adição de comentários */
.add-comment,
.add-learned-lesson {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.user-avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-block;
}

.user-avatar-small {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.linkedin-icon {
    position: absolute;
    bottom: -8px;
    left: 38%;
    transform: translateX(-50%);
    background-color: #0077b5;
    color: white;
    height: 20px;
    width: 20px;
    padding: 0 6px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    text-decoration: none;
    z-index: 2;
    border: 1px solid #0f0f0f;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.linkedin-icon:hover {
    background-color: #006399;
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.linkedin-icon i {
    font-size: 10px;
    line-height: 1;
}

.comment-input-container {
    flex: 1;
}

.comment-input {
    width: 100%;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #303030;
    padding: 8px 0;
    color: #fff;
    font-size: 14px;
    resize: none;
    outline: none;
}

.comment-input:focus {
    border-bottom: 2px solid #feaf50;
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    gap: 8px;
}

.cancel-button, .submit-button {
    padding: 8px 16px;
    border: none;
    border-radius: 18px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cancel-button {
    background-color: transparent;
    color: #aaa;
}

.cancel-button:hover {
    background-color: #303030;
}

.submit-button {
    background-color: #feaf50;
    color: #0f0f0f;
    font-weight: 500;
}

.submit-button:hover {
    background-color: #303030;
    color: #feaf50;
}

/* Lista de comentários */
.comments-list,
.learned-lesson-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Comentário individual */
.comment-item,
.learned-lesson-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.comment-item.reply-item,
.learned-lesson-item.reply-item {
    margin-bottom: 16px;
    margin-left: 24px; /* Identação para respostas */
}

.comment-content,
.learned-lesson-content {
    flex: 1;
}

.comment-author,
.learned-lesson-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author .name,
.learned-lesson-author .name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.comment-author .time,
.learned-lesson-author .time {
    font-size: 12px;
    color: #aaa;
}

.comment-text,
.learned-lesson-text {
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 8px;
    word-break: break-word;
}

/* Botões de ação dos comentários */
.comment-actions-buttons,
.learned-lesson-actions-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

/* Botão de responder */
.reply-button {
    font-size: 13px;
    color: #aaa;
    background: none;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.reply-button:hover {
    color: #feaf50;
    background-color: rgba(254, 175, 80, 0.1);
    border-radius: 4px;
}

.reply-button i {
    font-size: 14px;
}

/* Botão de excluir */
.delete-comment-button {
    font-size: 13px;
    color: #e74c3c;
    background: none;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.delete-comment-button:hover {
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
}

.delete-comment-button i {
    font-size: 14px;
}

/* Botão de editar */
.edit-button {
    font-size: 13px;
    color: #aaa;
    background: none;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.edit-button:hover {
    color: #65b8ff;
    background-color: rgba(101, 184, 255, 0.1);
    border-radius: 4px;
}

.edit-button i {
    font-size: 14px;
}

/* Formulário de respostas */
.reply-form {
    background-color: #272727;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    margin-left: 40px;
    margin-bottom: 15px;
}

.reply-form .comment-input,
.reply-form .learned-lesson-input {
    background-color: #1a1a1a;
}

.reply-form-container {
    margin: 8px 0 16px 0;
}

/* Estilo para mensagens de erro em comentários */
.comment-error-message,
.learned-lesson-error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    background-color: rgba(231, 76, 60, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
}

/* Toggle para exibir respostas */
.toggle-replies {
    background: none;
    border: none;
    cursor: pointer;
    color: #feaf50;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.toggle-replies:hover {
    color: #65b8ff;
}

.toggle-replies i {
    font-size: 14px;
    transition: transform 0.2s;
}

.toggle-replies.expanded i {
    transform: rotate(180deg);
}

/* Lista de respostas */
.replies-list {
    transition: all 0.3s ease;
    margin-top: 12px;
}

/* Estilos para o contador de respostas */
.replies-count {
    color: #feaf50;
}

/* Estado vazio (sem comentários) */
.no-comments,
.no-learned-lessons {
    color: #aaa;
    font-style: italic;
    text-align: center;
    padding: 24px 0;
}

/* Estilos para o componente de avaliação de comentários */
.comment-rating,
.learned-lesson-rating {
    margin-top: 12px;
    padding: 10px 0;
    border-top: 1px solid #303030;
}

.rating-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.rating-label {
    font-size: 13px;
    color: #aaa;
    transition: color 0.3s ease;
}

.rating-label.rating-given {
    color: #feaf50;
    font-weight: 500;
}

/* Container para os ícones de informação */
.rating-info-icons {
    display: flex;
    gap: 12px;
    margin-left: 4px;
    position: relative;
}

/* Estilos para o ícone de privacidade e tooltip */
.privacy-info, .points-info, .warning-info {
    position: relative;
    display: inline-block;
}

.privacy-icon, .points-icon, .warning-icon {
    color: #feaf50;
    font-size: 14px;
    cursor: help;
    transition: color 0.2s ease;
}

.privacy-icon:hover, .points-icon:hover {
    color: #65b8ff;
}

.warning-icon {
    color: #e74c3c;
}

.warning-icon:hover {
    color: #ff6b6b;
}

.privacy-tooltip, .points-tooltip, .warning-tooltip {
    position: absolute;
    top: -5px;
    left: 20px;
    background-color: #1a1a1a;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    min-width: 280px;
    width: max-content;
    max-width: 320px;
    border: 1px solid #303030;
    white-space: normal;
}

/* Regras para exibir o tooltip no hover (apenas desktop) */
@media (hover: hover) and (pointer: fine) {
    .privacy-info:hover .privacy-tooltip,
    .points-info:hover .points-tooltip,
    .warning-info:hover .warning-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateY(-5px);
    }
}

/* Classe active para dispositivos móveis */
@media (hover: none), (pointer: coarse) {
    .privacy-tooltip.active,
    .points-tooltip.active,
    .warning-tooltip.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.privacy-tooltip-content, .points-tooltip-content, .warning-tooltip-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.privacy-tooltip-content i, .points-tooltip-content i, .warning-tooltip-content i {
    color: #feaf50;
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.warning-tooltip-content i {
    color: #e74c3c;
}

.privacy-tooltip-content span, .points-tooltip-content span, .warning-tooltip-content span {
    font-size: 12px;
    color: #ddd;
    line-height: 1.5;
    flex: 1;
    white-space: normal;
    word-wrap: break-word;
}

/* Estilos responsivos para dispositivos móveis */
@media (max-width: 768px) {
    .rating-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rating-info-icons {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
    
    .privacy-tooltip, .points-tooltip, .warning-tooltip {
        left: 0;
        top: 25px;
        width: calc(100vw - 40px);
        max-width: 320px;
        min-width: 240px;
    }
    
    .privacy-info:hover .privacy-tooltip,
    .points-info:hover .points-tooltip,
    .warning-info:hover .warning-tooltip,
    .privacy-tooltip.active,
    .points-tooltip.active,
    .warning-tooltip.active {
        transform: translateY(0);
    }

    .rating-label {
        font-size: 11px;
    }
}

/* Ajustes adicionais para telas muito pequenas */
@media (max-width: 480px) {
    .rating-stars {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px 4px;
    }
    .rating-option {
        flex: 1 1 30%;
        min-width: 48px;
        max-width: 60px;
        margin-bottom: 4px;
    }
    .rating-header {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        overflow-x: hidden;
    }
    .rating-info-icons {
        width: 100%;
        margin-top: 8px;
        justify-content: flex-start;
        flex-wrap: wrap;
        overflow-x: auto;
        max-width: 100vw;
    }
    .privacy-tooltip, .points-tooltip, .warning-tooltip {
        left: 0 !important;
        right: 0 !important;
        width: 95vw !important;
        min-width: unset !important;
        max-width: 98vw !important;
    }
}

.rating-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.rating-option {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.rating-option:hover {
    transform: scale(1.1);
}

.rating-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #303030;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.rating-option:hover .rating-circle {
    background-color: #feaf50;
    color: #0f0f0f;
}

.rating-option.selected .rating-circle {
    background-color: #feaf50;
    color: #0f0f0f;
    box-shadow: 0 0 8px rgba(254, 175, 80, 0.5);
}

.rating-selected {
    font-size: 13px;
    color: #feaf50;
    margin-top: 5px;
    min-height: 18px;
}

/* Formulário de edição */
.edit-form {
    background-color: #272727;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    margin-left: 40px;
    margin-bottom: 15px;
}

.edit-form .comment-input,
.edit-form .learned-lesson-input {
    background-color: #1a1a1a;
}

.edit-form-container {
    margin: 8px 0 16px 0;
}

/* Área de respostas a comentários */
.comment-reply,
.learned-lesson-reply {
    margin-top: 16px;
    margin-left: 16px;
    border-left: 2px solid #303030;
    padding-left: 16px;
}

.comment-reply-item,
.learned-lesson-reply-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #303030;
}

.comment-reply-item:last-child,
.learned-lesson-reply-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.comment-reply-avatar,
.learned-lesson-reply-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.comment-reply-avatar img,
.learned-lesson-reply-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.comment-reply-content,
.learned-lesson-reply-content {
    flex: 1;
}

.comment-reply-author,
.learned-lesson-reply-author {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
}

.comment-reply-actions,
.learned-lesson-reply-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.delete-reply-link {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.delete-reply-link:hover {
    opacity: 1;
}

.delete-reply-link i {
    font-size: 14px;
}

/* Notificação de comentário */
.comment-notification,
.learned-lesson-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    max-width: 300px;
    transition: all 0.3s ease;
}

.comment-notification.success,
.learned-lesson-notification.success {
    background-color: #4caf50;
}

.comment-notification.error,
.learned-lesson-notification.error {
    background-color: #f44336;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos responsivos para notificações */
@media (max-width: 768px) {
    .comment-notification,
    .learned-lesson-notification {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
        text-align: center;
    }
}

/* Estilos para ações de curtir */
.like-actions {
    display: flex;
    align-items: center;
    margin-right: 16px;
}

.like-button {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #aaa;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.like-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.like-button.active {
    color: #feaf50;
}

.like-button i {
    font-size: 14px;
}

.like-count {
    font-size: 12px;
    font-weight: 500;
}

/* Estilos para quem curtiu */
.liked-by-container {
    display: none;
    margin-top: 8px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.liked-by-container.show {
    display: block;
}

.liked-by-avatars {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.liked-by-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #feaf50;
}

.liked-by-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.liked-by-names {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* --- INÍCIO DAS CORREÇÕES DE RESPONSIVIDADE --- */
@media (max-width: 768px) {
    /* Formulários de resposta e edição ocupando toda a largura */
    .reply-form-area,
    .edit-form-area {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 0 8px !important;
        box-sizing: border-box;
    }
    .reply-form,
    .edit-form {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 10px !important;
    }
    .comment-input-container {
        width: 100%;
    }
    .comment-input,
    .edit-input,
    .reply-input {
        width: 100%;
        min-width: 0;
        font-size: 15px;
    }
    .comment-actions {
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    .cancel-button, .submit-button {
        width: 100%;
        box-sizing: border-box;
    }
    /* Ajuste de margens para itens de comentário e resposta */
    .comment-item,
    .learned-lesson-item,
    .comment-reply,
    .learned-lesson-reply {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
}
@media (max-width: 480px) {
    /* Tooltips de avaliação não ultrapassam a tela */
    .privacy-tooltip, .points-tooltip, .warning-tooltip {
        left: 0 !important;
        right: 0 !important;
        width: 95vw !important;
        min-width: unset !important;
        max-width: 98vw !important;
    }
}
/* --- FIM DAS CORREÇÕES DE RESPONSIVIDADE --- */