/* Container principal */
.cafe-comentarios-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 20px;
    font-family: "Poppins", sans-serif;
}

/* Título */
.cafe-comentarios-titulo {
    color: #312317;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ffc107;
    text-align: center;
}

/* Comentário individual */
.cafe-comentario {
    display: flex;
    gap: 15px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(175, 87, 34, 0.1);
    border: 1px solid #ffecb3;
    transition: all 0.3s ease;
    position: relative;
}

.cafe-comentario:hover {
    box-shadow: 0 4px 20px rgba(175, 87, 34, 0.15);
    transform: translateY(-2px);
}

/* Respostas (comentários filhos) */
.cafe-comentario[data-nivel="1"] {
    margin-left: 60px;
    background: #faf6f0;
    border-color: #e8d7c0;
}

.cafe-comentario[data-nivel="2"] {
    margin-left: 120px;
    background: #f5f0e8;
    border-color: #dcc9a8;
}

/* Avatar */
.cafe-comentario-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #ffc107;
}

.cafe-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cafe-avatar-padrao {
    width: 100%;
    height: 100%;
    background: #AF5722;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Conteúdo do comentário */
.cafe-comentario-conteudo {
    flex: 1;
    min-width: 0;
}

.cafe-comentario-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.cafe-comentario-autor {
    font-weight: 700;
    color: #AF5722;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cafe-comentario-editado {
    font-size: 0.8rem;
    color: #995e25;
    opacity: 0.7;
    font-style: italic;
}

.cafe-comentario-data {
    color: #995e25;
    font-size: 0.85rem;
    opacity: 0.8;
    white-space: nowrap;
}

.cafe-comentario-texto {
    color: #312317;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.cafe-comentario-texto p {
    margin-bottom: 8px;
}

/* Ações do comentário */
.cafe-comentario-acoes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.cafe-btn-responder,
.cafe-btn-editar,
.cafe-btn-excluir {
    background: transparent;
    border: 1px solid;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Poppins", sans-serif;
    text-decoration: none;
    display: inline-block;
}

.cafe-btn-responder {
    border-color: #ffc107;
    color: #AF5722;
}

.cafe-btn-responder:hover {
    background: #ffc107;
    color: #fff;
}

.cafe-btn-editar {
    border-color: #2196F3;
    color: #2196F3;
}

.cafe-btn-editar:hover {
    background: #2196F3;
    color: #fff;
}

.cafe-btn-excluir {
    border-color: #f44336;
    color: #f44336;
}

.cafe-btn-excluir:hover {
    background: #f44336;
    color: #fff;
}

/* Container de respostas */
.cafe-respostas {
    margin-top: 20px;
    border-left: 3px solid #ffc107;
    padding-left: 20px;
}

/* Sem comentários */
.cafe-sem-comentarios {
    text-align: center;
    padding: 60px 40px;
    background: #faf6f0;
    border-radius: 16px;
    border: 2px dashed #ffc107;
}

.cafe-sem-comentarios-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.cafe-sem-comentarios h4 {
    color: #312317;
    margin-bottom: 0.5rem;
}

.cafe-sem-comentarios p {
    color: #995e25;
    opacity: 0.8;
}

/* Formulário */
.cafe-form-container,
.cafe-form-edicao {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(175, 87, 34, 0.1);
    border: 1px solid #ffc107;
    margin-top: 2rem;
}

.cafe-form-titulo-principal {
    color: #312317;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.cafe-form-titulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ffecb3;
}

.cafe-form-titulo span {
    color: #AF5722;
    font-weight: 600;
}

.cafe-btn-cancelar-resposta,
.cafe-btn-cancelar-edicao {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #666;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    font-family: "Poppins", sans-serif;
}

.cafe-btn-cancelar-resposta:hover,
.cafe-btn-cancelar-edicao:hover {
    background: #e9ecef;
}

.cafe-form-campos {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cafe-campo-duplo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cafe-campo-grupo input,
.cafe-campo-grupo textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e8d7c0;
    border-radius: 8px;
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #faf6f0;
    box-sizing: border-box;
    resize: vertical;
}

.cafe-campo-grupo input:focus,
.cafe-campo-grupo textarea:focus {
    outline: none;
    border-color: #AF5722;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(175, 87, 34, 0.1);
}

.cafe-usuario-logado {
    background: #e8f5e8;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    font-size: 0.9rem;
}

/* Botão enviar */
.cafe-btn-enviar {
    background: linear-gradient(135deg, #AF5722, #c6692e);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    position: relative;
    min-height: 48px;
    font-family: "Poppins", sans-serif;
}

.cafe-btn-enviar:hover:not(:disabled) {
    background: linear-gradient(135deg, #c6692e, #AF5722);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(175, 87, 34, 0.3);
}

.cafe-btn-enviar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.cafe-btn-texto {
    display: inline-block;
}

.cafe-btn-loading {
    display: none;
}

/* Loading state */
.cafe-btn-enviar.loading .cafe-btn-texto {
    display: none;
}

.cafe-btn-enviar.loading .cafe-btn-loading {
    display: inline-block;
}

/* Mensagens */
.cafe-mensagem {
    margin-top: 15px;
}

.cafe-alerta {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.cafe-sucesso {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.cafe-erro {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/* Formulário de resposta dinâmico */
.cafe-form-resposta-dinamico {
    margin: 15px 0;
}

/* Estados de debug */
.cafe-debug-info {
    background: #e3f2fd;
    border: 1px solid #2196F3;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.8rem;
    color: #0d47a1;
}

/* Responsivo */
@media (max-width: 768px) {
    .cafe-comentarios-container {
        padding: 0 15px;
    }
    
    .cafe-comentario {
        padding: 15px;
        flex-direction: column;
    }
    
    .cafe-comentario-avatar {
        align-self: flex-start;
    }
    
    .cafe-comentario[data-nivel="1"],
    .cafe-comentario[data-nivel="2"] {
        margin-left: 20px;
    }
    
    .cafe-campo-duplo {
        grid-template-columns: 1fr;
    }
    
    .cafe-respostas {
        margin-left: 0;
        padding-left: 15px;
    }
    
    .cafe-comentario-cabecalho {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .cafe-comentario-acoes {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cafe-btn-enviar {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cafe-comentarios-titulo {
        font-size: 1.3rem;
    }
    
    .cafe-form-container,
    .cafe-form-edicao {
        padding: 20px 15px;
    }
    
    .cafe-comentario-avatar {
        width: 40px;
        height: 40px;
    }
    
    .cafe-comentario-autor {
        font-size: 0.9rem;
    }
    
    .cafe-comentario-data {
        font-size: 0.75rem;
    }
    
    .cafe-comentario-acoes {
        gap: 5px;
    }
    
    .cafe-btn-responder,
    .cafe-btn-editar,
    .cafe-btn-excluir {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}