/* css/social.css - Estilos para likes, comentários, seguidores e mensagens */

/* ============================================ */
/* Botão de Curtir */
/* ============================================ */
.like-container {
    display: inline-flex;
    align-items: center;
}

.like-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #666;
}

.like-button i {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.like-button:hover {
    background: #ffe6e6;
    transform: scale(1.02);
}

.like-button.liked {
    background: #ff4d4d;
    color: white;
}

.like-button.liked i {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.like-count {
    font-weight: 600;
}

/* ============================================ */
/* Comentários - Estilo Facebook */
/* ============================================ */
.comments-container {
    margin-top: 24px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.comments-title {
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-form-container {
    margin-bottom: 24px;
}

.comment-form-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 12px;
}

.comment-form-container textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-form-container .btn-primary {
    width: auto;
    padding: 8px 24px;
}

.comments-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Comentário principal */
.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.comment-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.comment-date {
    font-size: 11px;
    color: var(--gray-light);
}

.comment-text {
    font-size: 13px;
    line-height: 1.4;
    color: #555;
    margin-bottom: 8px;
    word-break: break-word;
}

.comment-footer {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

/* Botão de responder */
.reply-btn {
    background: none;
    border: none;
    font-size: 11px;
    color: #65676b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.reply-btn:hover {
    background: #f0f2f5;
}

/* Botão de excluir */
.delete-comment-btn {
    background: none;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    opacity: 0;
}

.comment-item:hover .delete-comment-btn {
    opacity: 1;
}

.delete-comment-btn:hover {
    color: var(--danger);
    background: #fee;
}

/* Container de respostas - estilo Facebook (abaixo) */
.replies-container {
    margin-top: 12px;
    margin-left: 0;
    padding-left: 44px;
    border-left: none;
    position: relative;
}

/* Linha vertical de conexão (opcional) */
.replies-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

/* Cada resposta */
.reply-item {
    padding: 12px 0;
    border-bottom: none;
    margin-bottom: 0;
    position: relative;
}

.reply-item:first-child {
    padding-top: 8px;
}

.reply-item:last-child {
    padding-bottom: 0;
}

/* Ajustes nos avatares das respostas */
.reply-item .comment-avatar {
    width: 32px;
    height: 32px;
}

/* Formulário de resposta */
.reply-form {
    margin-top: 12px;
    margin-left: 44px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 12px;
}

.reply-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 12px;
    resize: vertical;
    margin-bottom: 8px;
}

.reply-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.reply-form-actions button {
    padding: 6px 16px;
    font-size: 12px;
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    font-size: 13px;
}

/* ============================================ */
/* Seguidores e Botão Seguir */
/* ============================================ */
.follow-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.followers-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray);
}

.followers-count i {
    font-size: 16px;
    color: var(--primary);
}

.follow-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.follow-button:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.follow-button.following {
    background: #e0e0e0;
    color: var(--dark);
}

/* ============================================ */
/* Interações Section */
/* ============================================ */
.interacoes-section {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.share-button {
    background: none;
    border: 1px solid #910085;
    padding: 8px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 13px;
    color: #910085;
    transition: all 0.2s;
}

.share-button:hover {
    background: #f5f5f5;
}

/* ============================================ */
/* Botões do Vendedor */
/* ============================================ */
.vendedor-acoes {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-mensagem, .btn-message {
    background: #00752c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-mensagem:hover, .btn-message:hover {
    background: #128C7E;
    transform: scale(1.02);
}

.btn-message {
    background: #ff7800;
}

.btn-message:hover {
    background: var(--primary-dark);
}

.btn-message-store {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.btn-message-store:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

/* ============================================ */
/* Chat Modal */
/* ============================================ */
.chat-modal .modal-content {
    max-width: 500px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.chat-header h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot.offline {
    background: #9ca3af;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9f9f9;
}

.chat-message {
    display: flex;
    margin-bottom: 12px;
}

.chat-message.own {
    justify-content: flex-end;
}

.chat-message.other {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
}

.own .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.other .message-bubble {
    background: white;
    color: var(--dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-text {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    margin: 0;
}

.message-time {
    font-size: 9px;
    opacity: 0.7;
    margin-left: 8px;
    display: inline-block;
}

.message-status {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: white;
    border-top: 1px solid var(--border);
}

.chat-input textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 13px;
    resize: none;
    font-family: inherit;
    max-height: 80px;
}

.chat-input textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================ */
/* Conversas List (Dashboard) */
/* ============================================ */
.conversations-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.conversation-item:hover {
    background: #f9f9f9;
}

.conversation-item.unread {
    background: #e8f0fe;
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.conversation-last-message {
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 10px;
    color: var(--gray-light);
    white-space: nowrap;
}

.conversation-unread {
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* ============================================ */
/* Notificações Dropdown */
/* ============================================ */
.notifications-dropdown {
    width: 320px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.notifications-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.mark-all-read {
    background: none;
    border: none;
    font-size: 11px;
    color: var(--primary);
    cursor: pointer;
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notification-item.unread {
    background: #e8f0fe;
}

.notification-item:hover {
    background: #f5f5f5;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon i {
    font-size: 14px;
    color: var(--primary);
}

.notification-content {
    flex: 1;
}

.notification-text {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 4px;
    color: var(--dark);
}

.notification-time {
    font-size: 10px;
    color: var(--gray-light);
}

.notification-dot {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.no-notifications {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    font-size: 12px;
}

/* ============================================ */
/* Nav Badges */
/* ============================================ */
.nav-badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: auto;
}

/* ============================================ */
/* Vendedor Status */
/* ============================================ */
.vendedor-status {
    margin: 8px 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gray);
}

.vendedor-status i {
    font-size: 8px;
}

.vendedor-status .online {
    color: #10b981;
}

/* ============================================ */
/* Responsividade */
/* ============================================ */
@media (max-width: 768px) {
    .interacoes-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .like-button, .share-button {
        width: 100%;
        justify-content: center;
    }
    
    .reply-form {
        margin-left: 0;
    }
    
    .replies-container {
        margin-left: 20px;
    }
    
    .chat-modal .modal-content {
        height: 90vh;
        margin: 5% auto;
    }
    
    .vendedor-acoes {
        flex-direction: column;
    }
    
    .btn-mensagem, .btn-message {
        width: 100%;
        justify-content: center;
    }
}

/* Adicionar ao final de social.css */
.follow-button {
    background: #ff7800;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.follow-button:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.follow-button.following {
    background: #e0e0e0;
    color: var(--dark);
}

.follow-button.following:hover {
    background: #d0d0d0;
}

.btn-message-store {
    background: #ff7800;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.btn-message-store:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

/* Forçar respostas abaixo do comentário */
.comment-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
}

.comment-item .replies-container {
    flex: 0 0 100%;
    margin-left: 44px;
    margin-top: 12px;
}

/* Reset para garantir que não fique ao lado */
.reply-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.reply-item .comment-avatar {
    flex-shrink: 0;
}

.reply-item .comment-content {
    flex: 1;
}

/* Garantir que o container de respostas fique abaixo */
.comment-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    position: relative;
}

.comment-item .replies-container {
    flex: 0 0 100%;
    margin-top: 12px;
    margin-left: 44px;
}

/* Ajuste para mobile */
@media (max-width: 768px) {
    .comment-item .replies-container {
        margin-left: 20px;
    }
}