/**
 * Estilos para Sistema de Comentários - Cinema Livre
 * Design moderno e responsivo
 */

/* Container principal */
.comentarios-container {
    width: 100%;
    max-width: 550px;
    margin: 30px auto;
    margin-left: calc((100% - 550px) / 2 - 20px); /* Move 20px para a esquerda do centro */
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ajuste específico para comentários de filmes - mais 5px para esquerda */
.social_filme .comentarios-container {
    margin-left: calc((100% - 550px) / 2 - 25px);
}

/* Header dos comentários */
.comentarios-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8eaed;
}

.comentarios-titulo {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

/* Título mais leve para páginas de artistas */
.social_artista .comentarios-titulo {
    font-weight: 400;
    letter-spacing: 0.5px;
    font-size: 25px;
}

.comentarios-ordenacao {
    display: flex;
    gap: 8px;
}

.btn-ordenacao {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ordenacao:hover {
    background: #e8eaed;
    border-color: #c4c7cc;
}

.btn-ordenacao.active {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

.btn-ordenacao svg {
    width: 16px;
    height: 16px;
}

/* Formulário de comentário */
.comentarios-form-container {
    margin-bottom: 24px;
}

.comentario-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.comentario-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.comentario-form {
    background: #f8f9fa;
    border: 2px dashed #dadce0;
}

.comentario-form:hover {
    border-color: #1a73e8;
    background: #fff;
}

/* Avatar */
.comentario-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

/* Avatar das respostas - alterna entre preto e vermelho */
.comentario-resposta:nth-child(odd) .comentario-avatar {
    background: #000000;
}

.comentario-resposta:nth-child(even) .comentario-avatar {
    background: #bc3427;
}

/* Conteúdo do comentário */
.comentario-conteudo {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
}

.comentario-info {
    flex: 1;
}

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

.comentario-autor {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.comentario-data {
    font-size: 12px;
    color: #5f6368;
}

.comentario-editado {
    font-size: 11px;
    color: #9aa0a6;
    font-style: italic;
}

.comentario-texto {
    color: #3c4043;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
}

/* Ações do comentário */
.comentario-acoes {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.comentario-votos {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 20px;
}

.btn-voto {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-voto:hover {
    background: #e8eaed;
    transform: scale(1.1);
}

.btn-voto.active {
    color: #1a73e8;
    background: #e8f0fe;
}

.btn-voto svg {
    width: 16px;
    height: 16px;
}

.votos-count {
    font-size: 14px;
    font-weight: 600;
    color: #5f6368;
    min-width: 24px;
    text-align: center;
}

.votos-count.positivo {
    color: #34a853;
}

.votos-count.negativo {
    color: #ea4335;
}

.btn-acao {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-acao:hover {
    background: #f8f9fa;
    color: #1a73e8;
}

.btn-acao.btn-deletar:hover {
    color: #ea4335;
}

.btn-acao svg {
    width: 16px;
    height: 16px;
}

/* Formulário de resposta */
.comentario-form-resposta {
    display: none;
    flex-direction: column;
    margin-top: 12px;
    margin-left: 52px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e8eaed;
}

/* Ocultar avatar no formulário de resposta */
.comentario-form-resposta .comentario-avatar {
    display: none;
}

.comentario-form-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.comentario-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
    min-height: 80px;
}

.comentario-textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.comentario-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.comentario-contador {
    font-size: 12px;
    color: #5f6368;
}

/* Botões */
.btn-primary {
    padding: 8px 20px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #1557b0;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.btn-primary:disabled {
    background: #dadce0;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 8px 20px;
    background: #fff;
    color: #5f6368;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #c4c7cc;
}

/* Respostas */
.comentario-respostas {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    margin-left: 52px;
    padding-left: 16px;
    border-left: 2px solid #e8eaed;
    max-width: calc(100% - 52px); /* Subtrai a margem esquerda */
}

.comentario-resposta {
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    box-sizing: border-box;
}

.comentario-resposta:last-child {
    margin-bottom: 0;
}

/* Aviso para não logados */
.comentario-aviso {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 14px;
}

.comentario-aviso svg {
    flex-shrink: 0;
    color: #ffc107;
}

.comentario-aviso a {
    color: #1a73e8;
    font-weight: 600;
    text-decoration: none;
}

.comentario-aviso a:hover {
    text-decoration: underline;
}

/* Loading */
.comentarios-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #5f6368;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8eaed;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Lista vazia */
.comentarios-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9aa0a6;
    text-align: center;
}

.comentarios-vazio svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.comentarios-vazio p {
    font-size: 16px;
    margin: 0;
}

/* Lista de comentários */
.comentarios-lista {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    transition: opacity 0.3s ease;
}

/* Modal de edição */
.modal-comentario {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8eaed;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #1a1a1a;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e8eaed;
    background: #f8f9fa;
}

/* Responsividade */
@media (max-width: 768px) {
    .comentarios-container {
        padding: 16px;
        border-radius: 0;
        margin: 20px 0;
    }
    
    .comentarios-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .comentarios-ordenacao {
        width: 100%;
    }
    
    .btn-ordenacao {
        flex: 1;
        justify-content: center;
    }
    
    .comentario-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .comentario-respostas {
        margin-left: 24px;
        padding-left: 12px;
    }
    
    .comentario-form-resposta {
        margin-left: 24px;
    }
    
    .comentario-acoes {
        gap: 8px;
    }
    
    .btn-acao {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .modal-content {
        margin: 0 16px;
    }
}

@media (max-width: 480px) {
    .comentarios-titulo {
        font-size: 20px;
    }
    
    .btn-ordenacao {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .comentario-card {
        padding: 12px;
    }
    
    .comentario-autor {
        font-size: 13px;
    }
    
    .comentario-texto {
        font-size: 13px;
    }
    
    .comentario-respostas {
        margin-left: 16px;
    }
    
    .comentario-form-resposta {
        margin-left: 16px;
    }
}

